8000 server : fix format_infill by ngxson · Pull Request #10724 · ggml-org/llama.cpp · GitHub
[go: up one dir, main page]

Skip to content

server : fix format_infill #10724

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Dec 8, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix
  • Loading branch information
ngxson committed Dec 8, 2024
commit 6ec3f77a4181cbe2dcad7994e15f315ec10c9019
2 changes: 1 addition & 1 deletion examples/server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3519,7 +3519,7 @@ int main(int argc, char ** argv) {
std::string prompt = json_value(data, "prompt", std::string());
std::vector<llama_tokens> tokenized_prompts = tokenize_input_prompts(ctx_server.ctx, prompt, true, true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably return an error if there is more than 1 resulting prompt?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because above we already checked if data["prompt"] is string, here we can be sure that we only have one single prompt to deal with. Probably an GGML_ASSERT here make more sense?

(The expected behavior of tokenize_input_prompts is that if prompt is a string, then output vector size is == 1)

8D44
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. It's fine as it is.

SRV_DBG("creating infill tasks, n_prompts = %d\n", (int) tokenized_prompts.size());
auto tokens = format_infill(
data["prompts"] = format_infill(
ctx_server.ctx,
data.at("input_prefix"),
data.at("input_suffix"),
Expand Down
Loading
0