]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
imatrix : fix arg parser for imatrix (#9366)
authorXuan Son Nguyen <redacted>
Sun, 8 Sep 2024 10:12:17 +0000 (12:12 +0200)
committerGitHub <redacted>
Sun, 8 Sep 2024 10:12:17 +0000 (12:12 +0200)
* imatrix : fix arg parser

* beautify printing first arg

common/common.cpp
examples/imatrix/imatrix.cpp

index c5c4d7508f033a12d114d15312d1b9c3be64c78e..9228eafcafae2c947886b2458fad4a85f189b08e 100644 (file)
@@ -600,7 +600,9 @@ std::string llama_arg::to_string() {
             if (args.size() == 1) {
                 ss << arg;
             } else {
-                ss << format("%-7s", arg) << ", ";
+                // first arg is usually abbreviation, we need padding to make it more beautiful
+                auto tmp = std::string(arg) + ", ";
+                ss << format("%-7s", tmp.c_str());
             }
         } else {
             ss << arg << (arg != args.back() ? ", " : "");
index 302292ab269e8f3300a79ba69e99ac5e4dc2f143..15a3f0d147fb93eafa13dfbb51454d821998a917 100644 (file)
@@ -577,7 +577,7 @@ int main(int argc, char ** argv) {
     params.logits_all = true;
     params.verbosity = 1;
 
-    auto options = gpt_params_parser_init(params, LLAMA_EXAMPLE_COMMON, print_usage);
+    auto options = gpt_params_parser_init(params, LLAMA_EXAMPLE_IMATRIX, print_usage);
     if (!gpt_params_parse(argc, argv, params, options)) {
         return 1;
     }