From 01be4169bf40ac3ef655a2be6a2536b4d5f18d4a Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Tue, 24 Oct 2023 21:45:11 +0300 Subject: [PATCH] server : do not block system prompt update --- examples/server/server.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/examples/server/server.cpp b/examples/server/server.cpp index 693f9b773..b33a63c4a 100644 --- a/examples/server/server.cpp +++ b/examples/server/server.cpp @@ -867,7 +867,7 @@ struct llama_server_context kv_cache_clear(); - for (int32_t i = 0; i < batch.n_tokens; ++i) + for (int i = 0; i < (int) system_tokens.size(); ++i) { llama_batch_add(batch, system_tokens[i], i, { 0 }, false); } @@ -897,13 +897,7 @@ struct llama_server_context wait_all_are_idle(); all_slots_are_idle = true; - // wait until system prompt load system_need_update = true; - while (system_need_update) - { - std::this_thread::sleep_for(std::chrono::milliseconds(5)); - } - // system prompt loaded, continue } void process_system_prompt_data(const json &sys_props) { @@ -915,10 +909,6 @@ struct llama_server_context { notify_system_prompt_changed(); } - else - { - system_need_update = true; - } } void wait_all_are_idle() { @@ -965,7 +955,6 @@ struct llama_server_context slot.has_next_token = false; } stop_pos = pos; - } }