Spaces:
Sleeping
Sleeping
Ali Alameh
commited on
stream : support language auto-detect (#501)
Browse files#445 fix Language auto-detect "auto" flag does not work using the stream tool
examples/stream/stream.cpp
CHANGED
|
@@ -148,7 +148,7 @@ int main(int argc, char ** argv) {
|
|
| 148 |
|
| 149 |
// whisper init
|
| 150 |
|
| 151 |
-
if (whisper_lang_id(params.language.c_str()) == -1)
|
| 152 |
fprintf(stderr, "error: unknown language '%s'\n", params.language.c_str());
|
| 153 |
whisper_print_usage(argc, argv, params);
|
| 154 |
exit(0);
|
|
|
|
| 148 |
|
| 149 |
// whisper init
|
| 150 |
|
| 151 |
+
if (params.language != "auto" && whisper_lang_id(params.language.c_str()) == -1){
|
| 152 |
fprintf(stderr, "error: unknown language '%s'\n", params.language.c_str());
|
| 153 |
whisper_print_usage(argc, argv, params);
|
| 154 |
exit(0);
|