Skip to content

Commit

Permalink
Add support for CatPPT (lm-sys#2840)
Browse files Browse the repository at this point in the history
  • Loading branch information
rishiraj authored and zhanghao.smooth committed Jan 26, 2024
1 parent 04d6528 commit ae1a725
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/model_support.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
- [WizardLM/WizardCoder-15B-V1.0](https://huggingface.co/WizardLM/WizardCoder-15B-V1.0)
- [HuggingFaceH4/starchat-beta](https://huggingface.co/HuggingFaceH4/starchat-beta)
- [HuggingFaceH4/zephyr-7b-alpha](https://huggingface.co/HuggingFaceH4/zephyr-7b-alpha)
- [rishiraj/CatPPT](https://huggingface.co/rishiraj/CatPPT)
- [Xwin-LM/Xwin-LM-7B-V0.1](https://huggingface.co/Xwin-LM/Xwin-LM-70B-V0.1)
- [OpenLemur/lemur-70b-chat-v1](https://huggingface.co/OpenLemur/lemur-70b-chat-v1)
- [allenai/tulu-2-dpo-7b](https://huggingface.co/allenai/tulu-2-dpo-7b)
Expand Down
14 changes: 14 additions & 0 deletions fastchat/conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1334,6 +1334,20 @@ def get_conv_template(name: str) -> Conversation:
)
)

# CatPPT template
# reference: https://huggingface.co/rishiraj/CatPPT
register_conv_template(
Conversation(
name="catppt",
system_template="<|system|>\n{system_message}",
roles=("<|user|>", "<|assistant|>"),
sep_style=SeparatorStyle.CHATML,
sep="</s>",
stop_token_ids=[2],
stop_str="</s>",
)
)

# Orca-2 template
# reference: https://huggingface.co/microsoft/Orca-2-7b
register_conv_template(
Expand Down
11 changes: 11 additions & 0 deletions fastchat/model/model_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1932,6 +1932,16 @@ def get_default_conv_template(self, model_path: str) -> Conversation:
return get_conv_template("zephyr")


class CatPPTAdapter(BaseModelAdapter):
"""The model adapter for CatPPT (e.g. rishiraj/CatPPT)"""

def match(self, model_path: str):
return "catppt" in model_path.lower()

def get_default_conv_template(self, model_path: str) -> Conversation:
return get_conv_template("catppt")


class XwinLMAdapter(BaseModelAdapter):
"""The model adapter for Xwin-LM V0.1 and V0.2 series of models(e.g., Xwin-LM/Xwin-LM-70B-V0.1)"""

Expand Down Expand Up @@ -2112,6 +2122,7 @@ def get_default_conv_template(self, model_path: str) -> Conversation:
register_model_adapter(CodeLlamaAdapter)
register_model_adapter(Llama2ChangAdapter)
register_model_adapter(ZephyrAdapter)
register_model_adapter(CatPPTAdapter)
register_model_adapter(XwinLMAdapter)
register_model_adapter(LemurAdapter)
register_model_adapter(PygmalionAdapter)
Expand Down
6 changes: 6 additions & 0 deletions fastchat/model/model_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ def get_model_info(name: str) -> ModelInfo:
"https://huggingface.co/HuggingFaceH4/zephyr-7b-alpha",
"a chatbot fine-tuned from Mistral by Hugging Face",
)
register_model_info(
["catppt"],
"CatPPT",
"https://huggingface.co/rishiraj/CatPPT",
"a chatbot fine-tuned from a SLERP merged model by Rishiraj Acharya",
)
register_model_info(
["qwen-14b-chat"],
"Qwen",
Expand Down

0 comments on commit ae1a725

Please sign in to comment.