From ada3cbf8c5a5bc1f5197e9d76c0a694b028d2a8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjarke=20Viks=C3=B8e?= Date: Sat, 6 Jul 2024 23:07:26 +0200 Subject: [PATCH] Using chat_template naming convention --- examples/server/README.md | 4 ++-- examples/server/server.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/server/README.md b/examples/server/README.md index d3c218547..cb45ee06d 100644 --- a/examples/server/README.md +++ b/examples/server/README.md @@ -367,7 +367,7 @@ Notice that each `probs` is an array of length `n_probs`. "user_name": "", "default_generation_settings": { ... }, "total_slots": 1, - "model_template": "" + "chat_template": "" } ``` @@ -375,7 +375,7 @@ Notice that each `probs` is an array of length `n_probs`. - `user_name` - the required anti-prompt to generate the prompt in case you have specified a system prompt for all slots. - `default_generation_settings` - the default generation settings for the `/completion` endpoint, which has the same fields as the `generation_settings` response object from the `/completion` endpoint. - `total_slots` - the total number of slots for process requests (defined by `--parallel` option) -- `model_template` - the model's original Jinja2 prompt template +- `chat_template` - the model's original Jinja2 prompt template - **POST** `/v1/chat/completions`: OpenAI-compatible Chat Completions API. Given a ChatML-formatted json description in `messages`, it returns the predicted completion. Both synchronous and streaming mode are supported, so scripted and interactive applications work fine. While no strong claims of compatibility with OpenAI API spec is being made, in our experience it suffices to support many apps. Only models with a [supported chat template](https://github.com/ggerganov/llama.cpp/wiki/Templates-supported-by-llama_chat_apply_template) can be used optimally with this endpoint. By default, the ChatML template will be used. diff --git a/examples/server/server.cpp b/examples/server/server.cpp index c03f04d3d..37b99d6e5 100644 --- a/examples/server/server.cpp +++ b/examples/server/server.cpp @@ -2978,7 +2978,7 @@ int main(int argc, char ** argv) { { "system_prompt", ctx_server.system_prompt.c_str() }, { "default_generation_settings", ctx_server.default_generation_settings_for_props }, { "total_slots", ctx_server.params.n_parallel }, - { "model_template", curr_tmpl.c_str() } + { "chat_template", curr_tmpl.c_str() } }; res.set_content(data.dump(), "application/json; charset=utf-8");