]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
coreml : support quantized model files
authorGeorgi Gerganov <redacted>
Sun, 14 May 2023 15:09:44 +0000 (18:09 +0300)
committerGeorgi Gerganov <redacted>
Sun, 14 May 2023 15:09:44 +0000 (18:09 +0300)
whisper.cpp

index 1cdd35078a274a9004390ab4d2524cfe67ce1170..a7d736d6646cd05a7389aefbf2d8c0b3b3c6a47b 100644 (file)
@@ -2598,6 +2598,15 @@ static std::string whisper_get_coreml_path_encoder(std::string path_bin) {
         path_bin = path_bin.substr(0, pos);
     }
 
+    // match "-qx_x"
+    pos = path_bin.rfind('-');
+    if (pos != std::string::npos) {
+        auto sub = path_bin.substr(pos);
+        if (sub.size() == 5 && sub[1] == 'q' && sub[3] == '_') {
+            path_bin = path_bin.substr(0, pos);
+        }
+    }
+
     path_bin += "-encoder.mlmodelc";
 
     return path_bin;