Fix bug where POST /infill doesn't work without prompt argument

Fixes https://github.com/ggerganov/llama.cpp/issues/4027
This commit is contained in:
Jonas Templestein 2023-11-10 21:26:48 +01:00 committed by GitHub
parent df9d1293de
commit 2927cca611
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1510,7 +1510,7 @@ 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();
// empty prompt passed -> release the slot and send empty response
if (slot.state == IDLE && slot.command == LOAD_PROMPT && !has_prompt)
if (slot.state == IDLE && slot.command == LOAD_PROMPT && !has_prompt && !slot.infill)
{
slot.release();
slot.print_timings();