From: Robert Collins Date: Fri, 29 Nov 2024 17:21:37 +0000 (-0500) Subject: imatrix : support combine-only (#10492) X-Git-Tag: upstream/0.0.4488~263 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=3a8e9af402f7893423bdab444aa16c5d9a2d429a;p=pkg%2Fggml%2Fsources%2Fllama.cpp imatrix : support combine-only (#10492) * imatrix-combine-only idea * ensured that behavior consistent with log --- diff --git a/examples/imatrix/imatrix.cpp b/examples/imatrix/imatrix.cpp index 70ff4776..45206f4a 100644 --- a/examples/imatrix/imatrix.cpp +++ b/examples/imatrix/imatrix.cpp @@ -637,10 +637,19 @@ int main(int argc, char ** argv) { LOG_INF("%s\n", common_params_get_system_info(params).c_str()); } - if (!compute_imatrix(ctx, params)) { - return 1; + if (params.prompt.empty()) { + if (params.in_files.empty()) { + 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)) { + return 1; + } } + g_collector.save_imatrix(); LOG("\n");