Skip to content

Commit 2988943

Browse files
authored
Support xDAN-L1-Chat Model (#2732)
1 parent ea90cf0 commit 2988943

File tree

4 files changed

+30
-1
lines changed

4 files changed

+30
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ You can use the commands below to chat with FastChat-T5. It will automatically d
105105

106106
#### Supported Models
107107
FastChat supports a wide range of models, including
108-
LLama 2, Vicuna, Alpaca, Baize, ChatGLM, Dolly, Falcon, FastChat-T5, GPT4ALL, Guanaco, MTP, OpenAssistant, OpenChat, RedPajama, StableLM, WizardLM, and more.
108+
LLama 2, Vicuna, Alpaca, Baize, ChatGLM, Dolly, Falcon, FastChat-T5, GPT4ALL, Guanaco, MTP, OpenAssistant, OpenChat, RedPajama, StableLM, WizardLM, xDAN-AI and more.
109109

110110
See a complete list of supported models and instructions to add a new model [here](docs/model_support.md).
111111

fastchat/conversation.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,6 +1271,18 @@ def get_conv_template(name: str) -> Conversation:
12711271
stop_str="<|user|>",
12721272
)
12731273
)
1274+
# xDAN default template
1275+
# source: https://huggingface.co/xDAN-AI/xDAN-L1-Chat-v0.1
1276+
register_conv_template(
1277+
Conversation(
1278+
name="xdan-v1",
1279+
system_message="You are a helpful and harmless assistant named xDAN and created by xDAN-AI.Please response and work on questions thinking step by step.",
1280+
roles=("### Human", "### Assistant"),
1281+
sep_style=SeparatorStyle.NO_COLON_SINGLE,
1282+
sep="\n",
1283+
stop_str="</s>",
1284+
)
1285+
)
12741286

12751287
# Zephyr template
12761288
# reference: https://huggingface.co/spaces/HuggingFaceH4/zephyr-playground/blob/main/dialogues.py

fastchat/model/model_adapter.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1915,6 +1915,16 @@ def get_default_conv_template(self, model_path: str) -> Conversation:
19151915
return get_conv_template("metharme")
19161916

19171917

1918+
class XdanAdapter(BaseModelAdapter):
1919+
"""The model adapter for xDAN-AI (e.g. xDAN-AI/xDAN-L1-Chat-v0.1)"""
1920+
1921+
def match(self, model_path: str):
1922+
return "xdan" in model_path.lower()
1923+
1924+
def get_default_conv_template(self, model_path: str) -> Conversation:
1925+
return get_conv_template("xdan-v1")
1926+
1927+
19181928
class MicrosoftOrcaAdapter(BaseModelAdapter):
19191929
"""The model adapter for Microsoft/Orca-2 series of models (e.g. Microsoft/Orca-2-7b, Microsoft/Orca-2-13b)"""
19201930

@@ -2039,6 +2049,7 @@ def get_default_conv_template(self, model_path: str) -> Conversation:
20392049
register_model_adapter(LemurAdapter)
20402050
register_model_adapter(PygmalionAdapter)
20412051
register_model_adapter(MicrosoftOrcaAdapter)
2052+
register_model_adapter(XdanAdapter)
20422053
register_model_adapter(YiAdapter)
20432054
register_model_adapter(DeepseekCoderAdapter)
20442055
register_model_adapter(DeepseekChatAdapter)

fastchat/model/model_registry.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,12 @@ def get_model_info(name: str) -> ModelInfo:
421421
"https://huggingface.co/BAAI/AquilaChat2-34B",
422422
"Chat models developed by BAAI team",
423423
)
424+
register_model_info(
425+
["xDAN-L1-Chat-v0.1"],
426+
"xDAN-L1-Chat",
427+
"https://huggingface.co/xDAN-AI/xDAN-L1-Chat-v0.1",
428+
"A large language chat model created by xDAN-AI.",
429+
)
424430

425431
register_model_info(
426432
["MetaMath-70B-V1.0", "MetaMath-7B-V1.0"],

0 commit comments

Comments
 (0)