From: Georgi Gerganov Date: Sun, 14 May 2023 15:55:29 +0000 (+0300) Subject: whisper : sync whisper.cpp X-Git-Tag: upstream/0.0.1642~1470 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=f591df4a5eadb23d6adad82c6a744b1c8b9fc753;p=pkg%2Fggml%2Fsources%2Fggml whisper : sync whisper.cpp --- diff --git a/examples/whisper/main.cpp b/examples/whisper/main.cpp index c6bf32ed..e659b7e5 100644 --- a/examples/whisper/main.cpp +++ b/examples/whisper/main.cpp @@ -191,7 +191,7 @@ void whisper_print_usage(int /*argc*/, char ** argv, const whisper_params & para fprintf(stderr, " -ps, --print-special [%-7s] print special tokens\n", params.print_special ? "true" : "false"); fprintf(stderr, " -pc, --print-colors [%-7s] print colors\n", params.print_colors ? "true" : "false"); fprintf(stderr, " -pp, --print-progress [%-7s] print progress\n", params.print_progress ? "true" : "false"); - fprintf(stderr, " -nt, --no-timestamps [%-7s] do not print timestamps\n", params.no_timestamps ? "false" : "true"); + fprintf(stderr, " -nt, --no-timestamps [%-7s] do not print timestamps\n", params.no_timestamps ? "true" : "false"); fprintf(stderr, " -l LANG, --language LANG [%-7s] spoken language ('auto' for auto-detect)\n", params.language.c_str()); fprintf(stderr, " -dl, --detect-language [%-7s] exit after automatically detecting language\n", params.detect_language ? "true" : "false"); fprintf(stderr, " --prompt PROMPT [%-7s] initial prompt\n", params.prompt.c_str()); diff --git a/examples/whisper/whisper.cpp b/examples/whisper/whisper.cpp index 1cdd3507..a7d736d6 100644 --- a/examples/whisper/whisper.cpp +++ b/examples/whisper/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;