From: Daniel Bevenius Date: Thu, 4 Dec 2025 12:36:50 +0000 (+0100) Subject: common : skip model validation when --help is requested (#17755) X-Git-Tag: upstream/0.0.7446~175 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=bd4ef134763d81e251fd097019578f2df571dfef;p=pkg%2Fggml%2Fsources%2Fllama.cpp common : skip model validation when --help is requested (#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: https://github.com/ggml-org/llama.cpp/issues/17754 --- diff --git a/common/arg.cpp b/common/arg.cpp index 45c0d1a7..9e062ee7 100644 --- a/common/arg.cpp +++ b/common/arg.cpp @@ -427,7 +427,7 @@ static bool common_params_parse_ex(int argc, char ** argv, common_params_context // model is required (except for server) // TODO @ngxson : maybe show a list of available models in CLI in this case - if (params.model.path.empty() && ctx_arg.ex != LLAMA_EXAMPLE_SERVER) { + if (params.model.path.empty() && ctx_arg.ex != LLAMA_EXAMPLE_SERVER && !params.usage) { throw std::invalid_argument("error: --model is required\n"); }