Skip to content

Commit

Permalink
common : disable KV cache shifting automatically for unsupported mode…
Browse files Browse the repository at this point in the history
…ls (#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]>
  • Loading branch information
MollySophia and ggerganov authored Jan 3, 2025
1 parent e7da954 commit 4b0c638
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions common/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down

0 comments on commit 4b0c638

Please sign in to comment.