Skip to content

Commit 66d8ecc

Browse files
authored
server : do context shift only while generating (ggml-org#17000)
1 parent afd3532 commit 66d8ecc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/server/server.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3587,7 +3587,7 @@ struct server_context {
35873587
// apply context-shift if needed
35883588
// TODO: simplify and improve
35893589
for (server_slot & slot : slots) {
3590-
if (slot.is_processing() && slot.prompt.n_tokens() + 1 >= slot.n_ctx) {
3590+
if (slot.state == SLOT_STATE_GENERATING && slot.prompt.n_tokens() + 1 >= slot.n_ctx) {
35913591
if (!params_base.ctx_shift) {
35923592
// this check is redundant (for good)
35933593
// we should never get here, because generation should already stopped in process_token()

0 commit comments

Comments
 (0)