From ac5830d7293d3603bf0a6a1699700fe9b3bb5c44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Tom=C3=A1s=20Collins?= Date: Mon, 25 Nov 2024 09:29:04 -0500 Subject: [PATCH 1/2] imatrix-combine-only idea --- examples/imatrix/imatrix.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/imatrix/imatrix.cpp b/examples/imatrix/imatrix.cpp index 70ff47768c02b..7aed7ab4765ca 100644 --- a/examples/imatrix/imatrix.cpp +++ b/examples/imatrix/imatrix.cpp @@ -637,10 +637,15 @@ 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()) { + LOG_INF("No prompt provided; combining precomputed matrices only.\n"); + } else { + if (!compute_imatrix(ctx, params)) { + return 1; + } } + g_collector.save_imatrix(); LOG("\n"); From 65bcf2e14fcc95b321d77d89c74e06f8222b659c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Tom=C3=A1s=20Collins?= Date: Mon, 25 Nov 2024 09:51:16 -0500 Subject: [PATCH 2/2] ensured that behavior consistent with log --- examples/imatrix/imatrix.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/imatrix/imatrix.cpp b/examples/imatrix/imatrix.cpp index 7aed7ab4765ca..45206f4a7dee1 100644 --- a/examples/imatrix/imatrix.cpp +++ b/examples/imatrix/imatrix.cpp @@ -638,6 +638,10 @@ int main(int argc, char ** argv) { } 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)) {