Disable KV cache shifting automatically for unsupported models

instead of exiting directly

Signed-off-by: Molly Sophia <mollysophia379@gmail.com>
This commit is contained in:
Molly Sophia 2025-01-03 16:30:25 +08:00
parent f66f582927
commit 672983a9cc

View file

@ -889,9 +889,8 @@ struct common_init_result common_init_from_params(common_params & params) {
} }
if (params.ctx_shift && !llama_kv_cache_can_shift(lctx)) { if (params.ctx_shift && !llama_kv_cache_can_shift(lctx)) {
LOG_ERR("%s: KV cache shifting is not supported for this model (--no-context-shift to disable)'\n", __func__); LOG_WRN("%s: KV cache shifting is not supported for this model, disabling KV cache shifting'\n", __func__);
llama_free_model(model); params.ctx_shift = false;
return iparams;
} }
if (!params.control_vectors.empty()) { if (!params.control_vectors.empty()) {