Skip to content

Commit

Permalink
Fix conv_template of chinese alpaca 2 (lm-sys#2812)
Browse files Browse the repository at this point in the history
  • Loading branch information
zollty authored Dec 24, 2023
1 parent c77b0a2 commit c405ed6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions fastchat/conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,18 @@ def get_conv_template(name: str) -> Conversation:
)
)

register_conv_template(
Conversation(
name="chinese-alpaca2",
system_template="[INST] <<SYS>>\n{system_message}\n<</SYS>>\n\n",
system_message="You are a helpful assistant. 你是一个乐于助人的助手。请你提供专业、有逻辑、内容真实、有价值的详细回复。",
roles=("[INST]", "[/INST]"),
sep_style=SeparatorStyle.LLAMA2,
sep=" ",
sep2=" </s><s>",
)
)

register_conv_template(
Conversation(
name="cutegpt",
Expand Down
2 changes: 1 addition & 1 deletion fastchat/model/model_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1773,7 +1773,7 @@ def load_model(self, model_path: str, from_pretrained_kwargs: dict):
return model, tokenizer

def get_default_conv_template(self, model_path: str) -> Conversation:
return get_conv_template("llama2-chinese")
return get_conv_template("chinese-alpaca2")


class VigogneAdapter(BaseModelAdapter):
Expand Down

0 comments on commit c405ed6

Please sign in to comment.