From e5cd55cff994f208cb2428a91b39ee97eaeff217 Mon Sep 17 00:00:00 2001 From: NanoCode012 Date: Mon, 14 Oct 2024 12:22:22 +0700 Subject: [PATCH] feat: add example using fallback --- docs/dataset-formats/conversation.qmd | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/dataset-formats/conversation.qmd b/docs/dataset-formats/conversation.qmd index 1e2454efe..4660ca102 100644 --- a/docs/dataset-formats/conversation.qmd +++ b/docs/dataset-formats/conversation.qmd @@ -127,7 +127,6 @@ We recommend checking the below examples for other usecases. datasets: - path: ... type: chat_template - # chat_template: tokenizer_default # This is the default value ``` 2. Using the `gemma` chat template to override the tokenizer_config.json's chat template on OpenAI messages format, training on all assistant messages. @@ -140,7 +139,17 @@ datasets: roles_to_train: ["assistant"] ``` -3. Using a custom jinja template on OpenAI messages format, training on all assistant messages. +3. Using the tokenizer_config.json's chat template or `chatml` as fallback if the former's chat template does not exist, on OpenAI messages format, training on all assistant messages. + +```yaml +chat_template: tokenizer_default_fallback_chatml # this overwrites the tokenizer's chat_template +datasets: + - path: ... + type: chat_template + roles_to_train: ["assistant"] +``` + +4. Using a custom jinja template on OpenAI messages format, training on all assistant messages. ```yaml # chat_template: jinja # `jinja` will be implied if the `chat_template_jinja` is set and this field is empty @@ -152,7 +161,7 @@ datasets: roles_to_train: ["assistant"] ``` -4. (Advanced) Using fine-grained control over tokens and turns to train in a conversation +5. (Advanced) Using fine-grained control over tokens and turns to train in a conversation For a data sample that looks like: