]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
imatrix : support combine-only (#10492)
authorRobert Collins <redacted>
Fri, 29 Nov 2024 17:21:37 +0000 (12:21 -0500)
committerGitHub <redacted>
Fri, 29 Nov 2024 17:21:37 +0000 (19:21 +0200)
* imatrix-combine-only idea

* ensured that behavior consistent with log

examples/imatrix/imatrix.cpp

index 70ff47768c02be681407e203100c50b68e6d3c7f..45206f4a7dee111f5586526efd8e0f9da62056c4 100644 (file)
@@ -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");