From 672983a9cce022b367a71218c91f3ff2b213500b Mon Sep 17 00:00:00 2001 From: Molly Sophia Date: Fri, 3 Jan 2025 16:30:25 +0800 Subject: [PATCH] Disable KV cache shifting automatically for unsupported models instead of exiting directly Signed-off-by: Molly Sophia --- common/common.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/common/common.cpp b/common/common.cpp index 3e37039ca..51f72a031 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()) {