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|>",