Skip to content

Commit 4b0c638

Browse files
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 <[email protected]> * Update common/common.cpp Co-authored-by: Georgi Gerganov <[email protected]> --------- Signed-off-by: Molly Sophia <[email protected]> Co-authored-by: Georgi Gerganov <[email protected]>
1 parent e7da954 commit 4b0c638

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

common/common.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -889,9 +889,8 @@ struct common_init_result common_init_from_params(common_params & params) {
889889
}
890890

891891
if (params.ctx_shift && !llama_kv_cache_can_shift(lctx)) {
892-
LOG_ERR("%s: KV cache shifting is not supported for this model (--no-context-shift to disable)'\n", __func__);
893-
llama_free_model(model);
894-
return iparams;
892+
LOG_WRN("%s: KV cache shifting is not supported for this model, disabling KV cache shifting\n", __func__);
893+
params.ctx_shift = false;
895894
}
896895

897896
if (!params.control_vectors.empty()) {

0 commit comments

Comments
 (0)