From: Xuan-Son Nguyen Date: Thu, 13 Mar 2025 11:34:54 +0000 (+0100) Subject: arg : no n_predict = -2 for examples except for main and infill (#12364) X-Git-Tag: upstream/0.0.5028~146 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=be7c3034108473beda214fd1d7c98fd6a7a3bdf5;p=pkg%2Fggml%2Fsources%2Fllama.cpp arg : no n_predict = -2 for examples except for main and infill (#12364) --- diff --git a/common/arg.cpp b/common/arg.cpp index 8531f087..fe6a1eec 100644 --- a/common/arg.cpp +++ b/common/arg.cpp @@ -764,7 +764,11 @@ common_params_context common_params_parser_init(common_params & params, llama_ex ).set_env("LLAMA_ARG_CTX_SIZE")); add_opt(common_arg( {"-n", "--predict", "--n-predict"}, "N", - string_format("number of tokens to predict (default: %d, -1 = infinity, -2 = until context filled)", params.n_predict), + string_format( + ex == LLAMA_EXAMPLE_MAIN || ex == LLAMA_EXAMPLE_INFILL + ? "number of tokens to predict (default: %d, -1 = infinity, -2 = until context filled)" + : "number of tokens to predict (default: %d, -1 = infinity)", + params.n_predict), [](common_params & params, int value) { params.n_predict = value; }