From fd01209d0923de14bd0640eb4e386e937789d063 Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Sun, 14 May 2023 18:09:44 +0300 Subject: [PATCH] coreml : support quantized model files --- whisper.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/whisper.cpp b/whisper.cpp index 1cdd350..a7d736d 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;