mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-20 02:24:59 +00:00
Sync with upstream
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
parent
d2a5905500
commit
b9cf7c31b9
1 changed files with 8 additions and 0 deletions
|
@ -2272,6 +2272,14 @@ struct server_context {
|
||||||
slot.has_next_token = true;
|
slot.has_next_token = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if context shifting is disabled, make sure that we don't run out of context
|
||||||
|
if (!params_base.ctx_shift && slot.n_past + 1 >= slot.n_ctx) {
|
||||||
|
slot.stop = STOP_TYPE_LIMIT;
|
||||||
|
slot.has_next_token = false;
|
||||||
|
|
||||||
|
SLT_DBG(slot, "stopped due to running out of context, n_past = %d, n_ctx = %d\n", slot.n_past, slot.n_ctx);
|
||||||
|
}
|
||||||
|
|
||||||
// check the limits
|
// check the limits
|
||||||
if (slot.n_decoded > 0 && slot.has_next_token && !slot.has_budget(params_base)) {
|
if (slot.n_decoded > 0 && slot.has_next_token && !slot.has_budget(params_base)) {
|
||||||
slot.stop = STOP_TYPE_LIMIT;
|
slot.stop = STOP_TYPE_LIMIT;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue