mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2025-01-12 03:31:46 +00:00
server : fix infill when prompt is empty (#4833)
This commit is contained in:
parent
7edefbd79c
commit
1d118386fe
@ -1406,7 +1406,7 @@ struct llama_server_context
|
|||||||
task.multitask_id = multitask_id;
|
task.multitask_id = multitask_id;
|
||||||
|
|
||||||
// when a completion task's prompt array is not a singleton, we split it into multiple requests
|
// when a completion task's prompt array is not a singleton, we split it into multiple requests
|
||||||
if (task.data.at("prompt").size() > 1)
|
if (task.data.count("prompt") && task.data.at("prompt").size() > 1)
|
||||||
{
|
{
|
||||||
lock.unlock(); // entering new func scope
|
lock.unlock(); // entering new func scope
|
||||||
return split_multiprompt_task(task);
|
return split_multiprompt_task(task);
|
||||||
@ -1731,7 +1731,8 @@ struct llama_server_context
|
|||||||
const bool has_prompt = slot.prompt.is_array() || (slot.prompt.is_string() && !slot.prompt.get<std::string>().empty()) || !slot.images.empty();
|
const bool has_prompt = slot.prompt.is_array() || (slot.prompt.is_string() && !slot.prompt.get<std::string>().empty()) || !slot.images.empty();
|
||||||
|
|
||||||
// empty prompt passed -> release the slot and send empty response
|
// empty prompt passed -> release the slot and send empty response
|
||||||
if (slot.state == IDLE && slot.command == LOAD_PROMPT && !has_prompt)
|
// note: infill mode allows empty prompt
|
||||||
|
if (slot.state == IDLE && slot.command == LOAD_PROMPT && !has_prompt && !slot.infill)
|
||||||
{
|
{
|
||||||
slot.release();
|
slot.release();
|
||||||
slot.print_timings();
|
slot.print_timings();
|
||||||
|
Loading…
Reference in New Issue
Block a user