Skip to content

Commit

Permalink
qwen1.5,xverse and yi
Browse files Browse the repository at this point in the history
  • Loading branch information
jstzwj committed Mar 4, 2024
1 parent d64df60 commit 64d5b3c
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
8 changes: 8 additions & 0 deletions chatproto/conversation/models/qwen.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,11 @@
], # "<|endoftext|>", "<|im_start|>", "<|im_end|>"
stop_str="<|endoftext|>",
)

Qwen = qwen.alias("Qwen")

qwen1 = qwen.alias("qwen1")
Qwen1 = qwen.alias("Qwen1")

qwen15 = qwen.alias("qwen1.5")
Qwen15 = qwen.alias("Qwen1.5")
18 changes: 18 additions & 0 deletions chatproto/conversation/models/xverse.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from ..settings import ConversationSettings, SeparatorStyle

# xverse template: https://huggingface.co/xverse/XVERSE-13B-Chat/blob/main/modeling_xverse.py#L780
xverse = ConversationSettings(
name="xverse",
system_template="Human: {system_message}\n",
roles=("Human", "Assistant"),
sep_style=SeparatorStyle.ADD_COLON_TWO,
sep="\n\n",
sep2="<|endoftext|>",
stop_token_ids=[
3,
], # eos_token_id: <|endoftext|>
stop_str="<|endoftext|>",
)


XVERSE = xverse.alias("XVERSE")
19 changes: 19 additions & 0 deletions chatproto/conversation/models/yi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from ..settings import ConversationSettings, SeparatorStyle

# Yi template: https://huggingface.co/01-ai/Yi-6B-Chat/blob/main/tokenizer_config.json
yi = ConversationSettings(
name="yi",
roles=("<|im_start|>user", "<|im_start|>assistant"),
sep_style=SeparatorStyle.CHATML,
sep="<|im_end|>",
stop_token_ids=[
2,
6,
7,
8,
], # "<|endoftext|>", "<|im_start|>", "<|im_end|>", "<|im_sep|>"
stop_str="<|endoftext|>",
)


Yi = yi.alias("Yi")

0 comments on commit 64d5b3c

Please sign in to comment.