]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
server : fix extra BOS in infill endpoint (#11106)
authorGeorgi Gerganov <redacted>
Mon, 6 Jan 2025 13:36:08 +0000 (15:36 +0200)
committerGitHub <redacted>
Mon, 6 Jan 2025 13:36:08 +0000 (15:36 +0200)
* server : fix extra BOS in infill endpoing

ggml-ci

* server : update infill tests

examples/server/server.cpp
examples/server/tests/unit/test_infill.py

index c2e62ba69165515a749486ecc58df4165eb35d8b..127323e776b6a9299087fe0de37edf16a65517ec 100644 (file)
@@ -3797,7 +3797,7 @@ int main(int argc, char ** argv) {
         data["input_extra"] = input_extra; // default to empty array if it's not exist
 
         std::string prompt = json_value(data, "prompt", std::string());
-        std::vector<llama_tokens> tokenized_prompts = tokenize_input_prompts(ctx_server.ctx, prompt, true, true);
+        std::vector<llama_tokens> tokenized_prompts = tokenize_input_prompts(ctx_server.ctx, prompt, false, true);
         SRV_DBG("creating infill tasks, n_prompts = %d\n", (int) tokenized_prompts.size());
         data["prompt"] = format_infill(
             ctx_server.ctx,
index ad4b8192a78756c884f95adeb04fb7c8bf887e00..10554db0f623e0ed0c096816ce2f10db986ea38e 100644 (file)
@@ -18,7 +18,7 @@ def test_infill_without_input_extra():
         "input_suffix": "}\n",
     })
     assert res.status_code == 200
-    assert match_regex("(Ann|small|shiny)+", res.body["content"])
+    assert match_regex("(Ann|small|shiny|Daddy)+", res.body["content"])
 
 
 def test_infill_with_input_extra():