]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
server : do not get prompt in infill mode (#7286)
authorwoodx <redacted>
Fri, 7 Jun 2024 07:09:45 +0000 (15:09 +0800)
committerGitHub <redacted>
Fri, 7 Jun 2024 07:09:45 +0000 (10:09 +0300)
* avoid to get prompt in infill mode and embedding mode

* remove embedding mode

* refactor format

---------

Co-authored-by: wudexiang <redacted>
examples/server/server.cpp

index 74da81dadb49da92be0f3c5f467b7075955d5705..528220607a4f62af2e24e559794125aebcb1ad0e 100644 (file)
@@ -888,7 +888,7 @@ struct server_context {
         slot.params.input_suffix = json_value(data, "input_suffix", default_params.input_suffix);
 
         // get prompt
-        {
+        if (!task.infill) {
             const auto & prompt = data.find("prompt");
             if (prompt == data.end()) {
                 send_error(task, "Either \"prompt\" or \"messages\" must be provided", ERROR_TYPE_INVALID_REQUEST);