Files
mlc-ai--mlc-llm/python/mlc_llm/conversation_template/olmo2.py
T
wehub-resource-sync 770d92cb1f
Lint / lint (push) Waiting to run
Windows CI / Windows (push) Waiting to run
Build Docs / Deploy Docs (push) Waiting to run
chore: import upstream snapshot with attribution
2026-07-13 13:23:58 +08:00

25 lines
696 B
Python

"""OLMo2 default templates"""
from mlc_llm.protocol.conversation_protocol import Conversation, MessagePlaceholders
from .registry import ConvTemplateRegistry
# OLMo-2 Instruct (Tulu format)
ConvTemplateRegistry.register_conv_template(
Conversation(
name="olmo2",
system_template=f"<|system|>\n{MessagePlaceholders.SYSTEM.value}\n",
system_message="",
roles={
"user": "<|user|>",
"assistant": "<|assistant|>",
},
seps=["<|endoftext|>\n"],
role_content_sep="\n",
role_empty_sep="\n",
stop_str=["<|endoftext|>"],
stop_token_ids=[100257],
system_prefix_token_ids=[100257],
)
)