talk-llama : add language auto detect (#1467)

* Add '-l auto' to talk-llama example

* Update examples/talk-llama/talk-llama.cpp

---------

Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
This commit is contained in:
Jakub Ráček 2023-11-09 18:21:44 +01:00 committed by GitHub
parent 953419c69a
commit 37947203e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -248,7 +248,7 @@ int main(int argc, char ** argv) {
return 1;
}
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);