From 8b03615b7b937ff67d81d9a6b8b6c8c9cf6dcfd4 Mon Sep 17 00:00:00 2001 From: Matt Date: Wed, 4 Oct 2023 16:28:53 +0100 Subject: [PATCH] Fix embarrassing typo in the doc chat template! (#26596) --- docs/source/en/chat_templating.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/en/chat_templating.md b/docs/source/en/chat_templating.md index af4ec4c06b..814935ff67 100644 --- a/docs/source/en/chat_templating.md +++ b/docs/source/en/chat_templating.md @@ -222,7 +222,7 @@ If you like this one, here it is in one-liner form, ready to copy into your code handy support for "generation prompts" - see the next section for more! ``` -tokenizer.chat_template = "{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %})" +tokenizer.chat_template = "{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}" ``` This template wraps each message in `<|im_start|>` and `<|im_end|>` tokens, and simply writes the role as a string, which