Skip to content

Commit

Permalink
server : fix extra BOS in infill endpoint (#11106)
Browse files Browse the repository at this point in the history
* server : fix extra BOS in infill endpoing

ggml-ci

* server : update infill tests
  • Loading branch information
ggerganov authored Jan 6, 2025
1 parent 09186fa commit e6e7c75
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion examples/server/tests/unit/test_infill.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit e6e7c75

Please sign in to comment.