Text Generation
Transformers
Safetensors
English
olmo2
conversational

Update model card to reflect the correct chat template

#1
by TheRootOf3 - opened

Background

The current description of the chat template is incorrect. The model uses the same template as the chat-tuned 7B and 13B variants. The tokenizer_config.json specifies:

"bos_token": "<|endoftext|>",
"chat_template": "{{ bos_token }}{% for message in messages %}{% if message['role'] == 'system' %}{{ '<|system|>\n' + message['content'] + '\n' }}{% elif message['role'] == 'user' %}{{ '<|user|>\n' + message['content'] + '\n' }}{% elif message['role'] == 'assistant' %}{% if not loop.last %}{{ '<|assistant|>\n'  + message['content'] + eos_token + '\n' }}{% else %}{{ '<|assistant|>\n'  + message['content'] + eos_token }}{% endif %}{% endif %}{% if loop.last and add_generation_prompt %}{{ '<|assistant|>\n' }}{% endif %}{% endfor %}",

Hence, the tokenizer will include the <|endoftext|> token at the start. This is inconsistent with the model card description, which says the opposite.

Key Change

  • Copied the chat template description from the allenai/OLMo-2-1124-13B-Instruct model card.
Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment