server : do not block system prompt update
This commit is contained in:
parent
abd21fc99f
commit
01be4169bf
1 changed files with 1 additions and 12 deletions
|
@ -867,7 +867,7 @@ struct llama_server_context
|
||||||
|
|
||||||
kv_cache_clear();
|
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);
|
llama_batch_add(batch, system_tokens[i], i, { 0 }, false);
|
||||||
}
|
}
|
||||||
|
@ -897,13 +897,7 @@ struct llama_server_context
|
||||||
wait_all_are_idle();
|
wait_all_are_idle();
|
||||||
all_slots_are_idle = true;
|
all_slots_are_idle = true;
|
||||||
|
|
||||||
// wait until system prompt load
|
|
||||||
system_need_update = true;
|
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) {
|
void process_system_prompt_data(const json &sys_props) {
|
||||||
|
@ -915,10 +909,6 @@ struct llama_server_context
|
||||||
{
|
{
|
||||||
notify_system_prompt_changed();
|
notify_system_prompt_changed();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
system_need_update = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wait_all_are_idle() {
|
void wait_all_are_idle() {
|
||||||
|
@ -965,7 +955,6 @@ struct llama_server_context
|
||||||
slot.has_next_token = false;
|
slot.has_next_token = false;
|
||||||
}
|
}
|
||||||
stop_pos = pos;
|
stop_pos = pos;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue