浏览代码

imatrix : support combine-only (#10492)

* imatrix-combine-only idea

* ensured that behavior consistent with log
Robert Collins 1 年之前
父节点
当前提交
3a8e9af402
共有 1 个文件被更改,包括 11 次插入2 次删除
  1. 11 2
      examples/imatrix/imatrix.cpp

+ 11 - 2
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");