]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
common : disable KV cache shifting automatically for unsupported models (#11053)
authorMolly Sophia <redacted>
Fri, 3 Jan 2025 12:13:18 +0000 (20:13 +0800)
committerGitHub <redacted>
Fri, 3 Jan 2025 12:13:18 +0000 (14:13 +0200)
* Disable KV cache shifting automatically for unsupported models

instead of exiting directly

Signed-off-by: Molly Sophia <redacted>
* Update common/common.cpp

Co-authored-by: Georgi Gerganov <redacted>
---------

Signed-off-by: Molly Sophia <redacted>
Co-authored-by: Georgi Gerganov <redacted>
common/common.cpp

index 3e37039ca58f535539b73e683d835feb1be9460b..4bb140ee2eb152c443870b2ee4930f775119faf1 100644 (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)) {
-        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()) {