From b1892b55112d8d8ddeead4b7f09632f2ba9a3d84 Mon Sep 17 00:00:00 2001 From: Daniel Han-Chen Date: Thu, 29 Feb 2024 00:09:00 +1100 Subject: [PATCH] Update chat_templates.py --- unsloth/chat_templates.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unsloth/chat_templates.py b/unsloth/chat_templates.py index 6f0237c27b..5ad34d6882 100644 --- a/unsloth/chat_templates.py +++ b/unsloth/chat_templates.py @@ -221,6 +221,7 @@ CHAT_TEMPLATES["alpaca"] = (alpaca_template, alpaca_eos_token,) # Notice we must use |trim for lstrip and rstrip. maps to 106. # maps to 107. user and model are normal 1 word tokens. gemma_template = \ + "{{ bos_token }}"\ "{% for message in messages %}"\ "{% if message['role'] == 'user' %}"\ "{{'user\n' + message['content'] | trim + '\n'}}"\ @@ -238,7 +239,7 @@ CHAT_TEMPLATES["gemma"] = (gemma_template, gemma_eos_token,) # Gemma with ChatML instead -gemma_chatml_template = chatml_template +gemma_chatml_template = "{{ bos_token }}" + chatml_template gemma_chatml_eos_token = ( {"" : "<|im_start|>", "" : "<|im_end|>"}, "<|im_end|>",