From: Molly Sophia Date: Fri, 3 Jan 2025 12:13:18 +0000 (+0800) Subject: common : disable KV cache shifting automatically for unsupported models (#11053) X-Git-Tag: upstream/0.0.4488~78 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=4b0c638b9a68f577cb2066b638c9f622d91ee661;p=pkg%2Fggml%2Fsources%2Fllama.cpp common : disable KV cache shifting automatically for unsupported models (#11053) * Disable KV cache shifting automatically for unsupported models instead of exiting directly Signed-off-by: Molly Sophia * Update common/common.cpp Co-authored-by: Georgi Gerganov --------- Signed-off-by: Molly Sophia Co-authored-by: Georgi Gerganov --- diff --git a/common/common.cpp b/common/common.cpp index 3e37039c..4bb140ee 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -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)) { - LOG_ERR("%s: KV cache shifting is not supported for this model (--no-context-shift to disable)'\n", __func__); - llama_free_model(model); - return iparams; + LOG_WRN("%s: KV cache shifting is not supported for this model, disabling KV cache shifting\n", __func__); + params.ctx_shift = false; } if (!params.control_vectors.empty()) {