From 82af405161ef095f4e7c6e72ffa31fd70af2f8eb Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Mon, 4 May 2026 10:07:57 +0300 Subject: [PATCH] arg : silence warnings about removed params --- common/arg.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/common/arg.cpp b/common/arg.cpp index dd8ce40a61..4b5f65f9cb 100644 --- a/common/arg.cpp +++ b/common/arg.cpp @@ -3715,35 +3715,45 @@ common_params_context common_params_parser_init(common_params & params, llama_ex {"--draft", "--draft-n", "--draft-max"}, "N", "the argument has been removed. use --spec-draft-n-max or --spec-ngram-mod-n-max", [](common_params & /*params*/, int /*value*/) { - throw std::invalid_argument("the argument has been removed. use --spec-draft-n-max or --spec-ngram-mod-n-max"); + if (true) { + throw std::invalid_argument("the argument has been removed. use --spec-draft-n-max or --spec-ngram-mod-n-max"); + } } ).set_spec().set_examples({LLAMA_EXAMPLE_SPECULATIVE, LLAMA_EXAMPLE_LOOKUP, LLAMA_EXAMPLE_SERVER, LLAMA_EXAMPLE_CLI}).set_env("LLAMA_ARG_DRAFT_MAX")); add_opt(common_arg( {"--draft-min", "--draft-n-min"}, "N", "the argument has been removed. use --spec-draft-n-min or --spec-ngram-mod-n-min", [](common_params & /*params*/, int /*value*/) { - throw std::invalid_argument("the argument has been removed. use --spec-draft-n-min or --spec-ngram-mod-n-min"); + if (true) { + throw std::invalid_argument("the argument has been removed. use --spec-draft-n-min or --spec-ngram-mod-n-min"); + } } ).set_spec().set_examples({LLAMA_EXAMPLE_SPECULATIVE, LLAMA_EXAMPLE_LOOKUP, LLAMA_EXAMPLE_SERVER, LLAMA_EXAMPLE_CLI}).set_env("LLAMA_ARG_DRAFT_MIN")); add_opt(common_arg( {"--spec-ngram-size-n"}, "N", "the argument has been removed. use the respective --spec-ngram-*-size-n or --spec-ngram-mod-n-match", [](common_params & /*params*/, int /*value*/) { - throw std::invalid_argument("the argument has been removed. use the respective --spec-ngram-*-size-n"); + if (true) { + throw std::invalid_argument("the argument has been removed. use the respective --spec-ngram-*-size-n"); + } } ).set_spec().set_examples({LLAMA_EXAMPLE_SERVER})); add_opt(common_arg( {"--spec-ngram-size-m"}, "N", "the argument has been removed. use the respective --spec-ngram-*-size-m", [](common_params & /*params*/, int /*value*/) { - throw std::invalid_argument("the argument has been removed. use the respective --spec-ngram-*-size-m"); + if (true) { + throw std::invalid_argument("the argument has been removed. use the respective --spec-ngram-*-size-m"); + } } ).set_spec().set_examples({LLAMA_EXAMPLE_SERVER})); add_opt(common_arg( {"--spec-ngram-min-hits"}, "N", "the argument has been removed. use the respective --spec-ngram-*-min-hits", [](common_params & /*params*/, int /*value*/) { - throw std::invalid_argument("the argument has been removed. use the respective --spec-ngram-*-min-hits"); + if (true) { + throw std::invalid_argument("the argument has been removed. use the respective --spec-ngram-*-min-hits"); + } } ).set_spec().set_examples({LLAMA_EXAMPLE_SERVER}));