]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
quantize : make output filename optional again (#2823)
authorCebtenzzre <redacted>
Mon, 28 Aug 2023 06:32:25 +0000 (02:32 -0400)
committerGitHub <redacted>
Mon, 28 Aug 2023 06:32:25 +0000 (09:32 +0300)
* quantize : make output filename optional again

* quantize : fix path parsing on Windows

suggested by @slaren

examples/quantize/quantize.cpp

index d172f645ae3225de2035973e770e72325103906d..df9a214fc5864d9688aa9f9de358ad164902d539 100644 (file)
@@ -100,7 +100,7 @@ int main(int argc, char ** argv) {
         }
     }
 
-    if (argc - arg_idx < 3) {
+    if (argc - arg_idx < 2) {
         usage(argv[0]);
     }
 
@@ -114,7 +114,7 @@ int main(int argc, char ** argv) {
     std::string ftype_str;
     if (try_parse_ftype(argv[arg_idx], params.ftype, ftype_str)) {
         std::string fpath;
-        const size_t pos = fname_inp.find_last_of('/');
+        const size_t pos = fname_inp.find_last_of("/\\");
         if (pos != std::string::npos) {
             fpath = fname_inp.substr(0, pos + 1);
         }