Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions examples/cli/cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -968,8 +968,6 @@ static void output_lrc(struct whisper_context * ctx, std::ofstream & fout, const
static void cb_log_disable(enum ggml_log_level , const char * , void * ) { }

int main(int argc, char ** argv) {
ggml_backend_load_all();

#if defined(_WIN32)
// Set the console output code page to UTF-8, while command line arguments
// are still encoded in the system's code page. In this way, we can print
Expand Down Expand Up @@ -1032,6 +1030,12 @@ int main(int argc, char ** argv) {
return 2;
}

if (!is_file_exist(params.model.c_str())) {
fprintf(stderr, "error: model file not found '%s'\n", params.model.c_str());
whisper_print_usage(argc, argv, params);
return 3;
}

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);
Expand All @@ -1048,6 +1052,8 @@ int main(int argc, char ** argv) {
whisper_log_set(cb_log_disable, NULL);
}

ggml_backend_load_all();

// whisper init
struct whisper_context_params cparams = whisper_context_default_params();

Expand Down
Loading