mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-12-25 02:44:36 +00:00
fix server hangs on empty prompt (#5733)
This commit is contained in:
parent
a33e6a0d2a
commit
b11a93df41
@ -1336,6 +1336,10 @@ struct llama_server_context
|
|||||||
split_multiprompt_task(task_id, task);
|
split_multiprompt_task(task_id, task);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// an empty prompt can make slot become buggy
|
||||||
|
if (task.data.contains("prompt") && task.data["prompt"].is_string() && task.data["prompt"].get<std::string>().empty()) {
|
||||||
|
task.data["prompt"] = " "; // add a space so that we have one token
|
||||||
|
}
|
||||||
queue_tasks.post(task);
|
queue_tasks.post(task);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user