imatrix : avoid loading model to convert or combine imatrix
This commit is contained in:
parent
50f53b3e40
commit
183eeb5518
|
|
@ -967,9 +967,23 @@ int main(int argc, char ** argv) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params.in_files.size() > 1) {
|
if (params.prompt.empty()) {
|
||||||
LOG_INF("%s : saving combined imatrix to '%s'\n", __func__, params.out_file.c_str());
|
LOG_INF("No prompt provided; combining precomputed matrices only.\n");
|
||||||
|
|
||||||
|
if (params.in_files.empty()) {
|
||||||
|
LOG_ERR("Error: No prompt provided and no precomputed matrices (--in-file) to combine.\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (params.in_files.size() == 1) {
|
||||||
|
LOG_INF("%s : saving imatrix to '%s'\n", __func__, params.out_file.c_str());
|
||||||
|
} else if (params.in_files.size() > 1) {
|
||||||
|
LOG_INF("%s : saving combined imatrix to '%s'\n", __func__, params.out_file.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
g_collector.save_imatrix();
|
g_collector.save_imatrix();
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
llama_backend_init();
|
llama_backend_init();
|
||||||
|
|
@ -1004,19 +1018,10 @@ int main(int argc, char ** argv) {
|
||||||
LOG_INF("%s\n", common_params_get_system_info(params).c_str());
|
LOG_INF("%s\n", common_params_get_system_info(params).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params.prompt.empty()) {
|
if (!compute_imatrix(ctx, params, n_ctx)) {
|
||||||
if (params.in_files.empty()) {
|
return 1;
|
||||||
LOG_ERR("Error: No prompt provided and no precomputed matrices (--in-file) to combine.\n");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
LOG_INF("No prompt provided; combining precomputed matrices only.\n");
|
|
||||||
} else {
|
|
||||||
if (!compute_imatrix(ctx, params, n_ctx)) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
g_collector.save_imatrix();
|
g_collector.save_imatrix();
|
||||||
|
|
||||||
LOG("\n");
|
LOG("\n");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue