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; - } }