From: Georgi Gerganov Date: Sun, 14 May 2023 15:09:44 +0000 (+0300) Subject: coreml : support quantized model files X-Git-Tag: upstream/1.7.4~1436 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=fd01209d0923de14bd0640eb4e386e937789d063;p=pkg%2Fggml%2Fsources%2Fwhisper.cpp coreml : support quantized model files --- diff --git a/whisper.cpp b/whisper.cpp index 1cdd3507..a7d736d6 100644 --- a/whisper.cpp +++ b/whisper.cpp @@ -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;