allow disabling context shift in the server
This commit is contained in:
parent
e244300df5
commit
cf77a846c6
1 changed files with 7 additions and 0 deletions
|
@ -1885,6 +1885,13 @@ struct server_context {
|
|||
for (server_slot & slot : slots) {
|
||||
if (slot.ga_n == 1) {
|
||||
if (slot.is_processing() && (int) system_tokens.size() + slot.n_past >= slot.n_ctx - 1) {
|
||||
if (!params.ctx_shift){
|
||||
slot.release();
|
||||
slot.print_timings();
|
||||
send_final_response(slot);
|
||||
metrics.on_prediction(slot);
|
||||
continue;
|
||||
}
|
||||
// Shift context
|
||||
const int n_keep = slot.params.n_keep + add_bos_token;
|
||||
const int n_left = (int) system_tokens.size() + slot.n_past - n_keep;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue