]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
stream : support language auto-detect (#501)
authorAli Alameh <redacted>
Fri, 14 Apr 2023 17:02:18 +0000 (20:02 +0300)
committerGitHub <redacted>
Fri, 14 Apr 2023 17:02:18 +0000 (20:02 +0300)
#445  fix Language auto-detect "auto" flag does not work using the stream tool

examples/stream/stream.cpp

index 258457faafe94333cca8fc89a649c1241b6916cb..e0a53dedaea9cda1f19f818899b3c2ad1ee3cb8c 100644 (file)
@@ -148,7 +148,7 @@ int main(int argc, char ** argv) {
 
     // whisper init
 
-    if (whisper_lang_id(params.language.c_str()) == -1) {
+    if (params.language != "auto" && whisper_lang_id(params.language.c_str()) == -1){
         fprintf(stderr, "error: unknown language '%s'\n", params.language.c_str());
         whisper_print_usage(argc, argv, params);
         exit(0);