Skip to content

Commit

Permalink
modify conversation template (buggy)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gunjan Dhanuka committed Jul 17, 2024
1 parent adc2ae3 commit f50d58d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions python/mlc_llm/conversation_template/cohere.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Cohere default templates"""

# Referred from: https://huggingface.co/CohereForAI/aya-23-8B/blob/main/tokenizer_config.json
# and https://github.com/huggingface/transformers/blob/main/src/transformers/models/cohere/tokenization_cohere_fast.py

from mlc_llm.protocol.conversation_protocol import Conversation, MessagePlaceholders

Expand All @@ -10,18 +11,17 @@
ConvTemplateRegistry.register_conv_template(
Conversation(
name="aya-23",
system_template=f"<BOS_TOKEN><|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{MessagePlaceholders.SYSTEM.value}<|END_OF_TURN_TOKEN|>",
system_template=f"<|START_OF_TURN_TOKEN|><|SYSTEM_TOKEN|>{MessagePlaceholders.SYSTEM.value}<|END_OF_TURN_TOKEN|>",
system_message="You are Command-R, a brilliant, sophisticated, AI-assistant trained to assist human users by providing thorough responses.",
roles={
"user": "<|START_OF_TURN_TOKEN|><|USER_TOKEN|>",
"assistant": "<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>",
},
seps=["<|END_OF_TURN_TOKEN|>"],
role_content_sep="\n",
role_empty_sep="\n",
role_content_sep="",
role_empty_sep="",
system_prefix_token_ids=[5],
stop_str=["<|END_OF_TURN_TOKEN|>"],
stop_token_ids=[255001],
add_role_after_system_message=False,
)
)

0 comments on commit f50d58d

Please sign in to comment.