From 4b0c638b9a68f577cb2066b638c9f622d91ee661 Mon Sep 17 00:00:00 2001 From: Molly Sophia Date: Fri, 3 Jan 2025 20:13:18 +0800 Subject: [PATCH] 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 --- common/common.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/common/common.cpp b/common/common.cpp index 3e37039ca58f5..4bb140ee2eb15 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()) {