Skip to content

Commit bd4ef13

Browse files
authored
common : skip model validation when --help is requested (ggml-org#17755)
This commit skips the model validation check when the user specifies the --help option. The motivation for this is that currently and error is thrown before the --help could be processed. Now skips validation if params.usage is set, allowing help to display without requiring --model. Resolves: ggml-org#17754
1 parent 87a2084 commit bd4ef13

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

common/arg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ static bool common_params_parse_ex(int argc, char ** argv, common_params_context
427427

428428
// model is required (except for server)
429429
// TODO @ngxson : maybe show a list of available models in CLI in this case
430-
if (params.model.path.empty() && ctx_arg.ex != LLAMA_EXAMPLE_SERVER) {
430+
if (params.model.path.empty() && ctx_arg.ex != LLAMA_EXAMPLE_SERVER && !params.usage) {
431431
throw std::invalid_argument("error: --model is required\n");
432432
}
433433

0 commit comments

Comments
 (0)