Browse Source

server : do not release slot on image input (#3798)

Georgi Gerganov 2 years ago
parent
commit
34b2a5e1ee
1 changed files with 1 additions and 1 deletions
  1. 1 1
      examples/server/server.cpp

+ 1 - 1
examples/server/server.cpp

@@ -1502,7 +1502,7 @@ struct llama_server_context
         {
         {
             for (auto & slot : slots)
             for (auto & slot : slots)
             {
             {
-                const bool has_prompt = slot.prompt.is_array() || (slot.prompt.is_string() && !slot.prompt.get<std::string>().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)
                 if (slot.state == IDLE && slot.command == LOAD_PROMPT && !has_prompt)