From 6b34d50135155f59ad1b0ef64de41d31b6f22824 Mon Sep 17 00:00:00 2001 From: Jared Van Bortel Date: Wed, 21 Feb 2024 10:32:48 -0500 Subject: [PATCH] server : fix misplaced n_keep varible definition --- examples/server/server.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/server/server.cpp b/examples/server/server.cpp index 1cb37850a..808cc72b8 100644 --- a/examples/server/server.cpp +++ b/examples/server/server.cpp @@ -1440,8 +1440,6 @@ struct llama_server_context task.target_id = -1; queue_tasks.post(task); - int32_t n_keep = slot.params.n_keep + add_bos_token; - for (llama_client_slot &slot : slots) { if (slot.ga_n == 1) @@ -1449,6 +1447,7 @@ struct llama_server_context if (slot.is_processing() && system_tokens.size() + slot.cache_tokens.size() >= (size_t) slot.n_ctx) { // Shift context + const int n_keep = slot.params.n_keep + add_bos_token; const int n_left = system_tokens.size() + slot.n_past - n_keep; const int n_discard = n_left / 2;