From 237acf7d79c771ab65a94ca4b5b55a46f15aa33b Mon Sep 17 00:00:00 2001 From: Philipp Schmid Date: Fri, 19 Apr 2024 12:04:58 +0000 Subject: [PATCH] Fix chat template to add generation prompt only if the option is selected (#9) - Fix chat template to add generation prompt only if the option is selected (a8e4780a4e78247711e28fdf3603cef715d2d4c7) Co-authored-by: Arka Pal --- tokenizer_config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tokenizer_config.json b/tokenizer_config.json index 5777175..870479e 100644 --- a/tokenizer_config.json +++ b/tokenizer_config.json @@ -2050,7 +2050,7 @@ } }, "bos_token": "<|begin_of_text|>", - "chat_template": "{% set loop_messages = messages %}{% for message in loop_messages %}{% set content = '<|start_header_id|>' + message['role'] + '<|end_header_id|>\n\n'+ message['content'] | trim + '<|eot_id|>' %}{% if loop.index0 == 0 %}{% set content = bos_token + content %}{% endif %}{{ content }}{% endfor %}{{ '<|start_header_id|>assistant<|end_header_id|>\n\n' }}", + "chat_template": "{% set loop_messages = messages %}{% for message in loop_messages %}{% set content = '<|start_header_id|>' + message['role'] + '<|end_header_id|>\n\n'+ message['content'] | trim + '<|eot_id|>' %}{% if loop.index0 == 0 %}{% set content = bos_token + content %}{% endif %}{{ content }}{% endfor %}{% if add_generation_prompt %}{{ '<|start_header_id|>assistant<|end_header_id|>\n\n' }}{% endif %}", "clean_up_tokenization_spaces": true, "eos_token": "<|end_of_text|>", "model_input_names": [