]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
Add docs for llama_chat_apply_template (#5645)
authorXuan Son Nguyen <redacted>
Wed, 21 Feb 2024 23:31:00 +0000 (00:31 +0100)
committerGitHub <redacted>
Wed, 21 Feb 2024 23:31:00 +0000 (00:31 +0100)
* add docs for llama_chat_apply_template

* fix typo

examples/server/README.md
llama.h

index 6d9f96cd4ba648384c068114b920c7ff38375066..4b24ee5dc3f2836209de37df78616aa87b39896a 100644 (file)
@@ -41,6 +41,7 @@ see https://github.com/ggerganov/llama.cpp/issues/1437
 - `--grp-attn-w`: Set the group attention width to extend context size through self-extend(default: 512), used together with group attention factor `--grp-attn-n`
 - `-n, --n-predict`: Set the maximum tokens to predict (default: -1)
 - `--slots-endpoint-disable`: To disable slots state monitoring endpoint. Slots state may contain user data, prompts included.
+- `--chat-template JINJA_TEMPLATE`: Set custom jinja chat template. This parameter accepts a string, not a file name (default: template taken from model's metadata). We only support [some pre-defined templates](https://github.com/ggerganov/llama.cpp/wiki/Templates-supported-by-llama_chat_apply_template)
 
 ## Build
 
diff --git a/llama.h b/llama.h
index 8ba20696f8af97b041730e2c7315f5b627bc93fb..84f196b3bb625e6dcb402416c37281c3decb7a9b 100644 (file)
--- a/llama.h
+++ b/llama.h
@@ -708,7 +708,7 @@ extern "C" {
 
     /// Apply chat template. Inspired by hf apply_chat_template() on python.
     /// Both "model" and "custom_template" are optional, but at least one is required. "custom_template" has higher precedence than "model"
-    /// NOTE: This function only support some known jinja templates. It is not a jinja parser.
+    /// NOTE: This function does not use a jinja parser. It only support a pre-defined list of template. See more: https://github.com/ggerganov/llama.cpp/wiki/Templates-supported-by-llama_chat_apply_template
     /// @param tmpl A Jinja template to use for this chat. If this is nullptr, the model’s default chat template will be used instead.
     /// @param chat Pointer to a list of multiple llama_chat_message
     /// @param n_msg Number of llama_chat_message in this chat