llama-fit-params: keep explicit --ctx-size 0 (#19070)

This commit is contained in:
Johannes Gäßler 2026-01-24 22:13:08 +01:00 committed by GitHub
parent 4e5b83b226
commit e9fd8dcab4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 12 additions and 3 deletions

View file

@ -1231,6 +1231,10 @@ common_params_context common_params_parser_init(common_params & params, llama_ex
string_format("size of the prompt context (default: %d, 0 = loaded from model)", params.n_ctx),
[](common_params & params, int value) {
params.n_ctx = value;
if (value == 0) {
// disable context reduction in llama_params_fit if the user explicitly requests the full context size:
params.fit_params_min_ctx = UINT32_MAX;
}
}
).set_env("LLAMA_ARG_CTX_SIZE"));
add_opt(common_arg(