"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "ff8870350151091d3d8b2af4c1c0fa3ebcc1052a"
Unverified Commit 8b03615b authored by Matt's avatar Matt Committed by GitHub
Browse files

Fix embarrassing typo in the doc chat template! (#26596)

parent 9deb18ca
...@@ -222,7 +222,7 @@ If you like this one, here it is in one-liner form, ready to copy into your code ...@@ -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! 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 This template wraps each message in `<|im_start|>` and `<|im_end|>` tokens, and simply writes the role as a string, which
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment