Skip to content

Commit 06092dd

Browse files
authored
Add Xwin-LM V0.1, V0.2 support (#2566)
1 parent ee0d4d2 commit 06092dd

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

docs/model_support.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
- [WizardLM/WizardCoder-15B-V1.0](https://huggingface.co/WizardLM/WizardCoder-15B-V1.0)
4747
- [HuggingFaceH4/starchat-beta](https://huggingface.co/HuggingFaceH4/starchat-beta)
4848
- [HuggingFaceH4/zephyr-7b-alpha](https://huggingface.co/HuggingFaceH4/zephyr-7b-alpha)
49+
- [Xwin-LM/Xwin-LM-7B-V0.1](https://huggingface.co/Xwin-LM/Xwin-LM-70B-V0.1)
4950
- Any [EleutherAI](https://huggingface.co/EleutherAI) pythia model such as [pythia-6.9b](https://huggingface.co/EleutherAI/pythia-6.9b)
5051
- Any [Peft](https://github.com/huggingface/peft) adapter trained on top of a
5152
model above. To activate, must have `peft` in the model path. Note: If

fastchat/model/model_adapter.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1674,6 +1674,18 @@ def get_default_conv_template(self, model_path: str) -> Conversation:
16741674
return get_conv_template("zephyr")
16751675

16761676

1677+
class XwinLMAdapter(BaseModelAdapter):
1678+
"""The model adapter for Xwin-LM V0.1 and V0.2 series of models(e.g., Xwin-LM/Xwin-LM-70B-V0.1)"""
1679+
1680+
# use_fast_tokenizer = False
1681+
1682+
def match(self, model_path: str):
1683+
return "xwin-lm" in model_path.lower()
1684+
1685+
def get_default_conv_template(self, model_path: str) -> Conversation:
1686+
return get_conv_template("vicuna_v1.1")
1687+
1688+
16771689
# Note: the registration order matters.
16781690
# The one registered earlier has a higher matching priority.
16791691
register_model_adapter(PeftModelAdapter)
@@ -1735,6 +1747,7 @@ def get_default_conv_template(self, model_path: str) -> Conversation:
17351747
register_model_adapter(CodeLlamaAdapter)
17361748
register_model_adapter(Llama2ChangAdapter)
17371749
register_model_adapter(ZephyrAdapter)
1750+
register_model_adapter(XwinLMAdapter)
17381751

17391752
# After all adapters, try the default base adapter.
17401753
register_model_adapter(BaseModelAdapter)

fastchat/model/model_registry.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,3 +325,15 @@ def get_model_info(name: str) -> ModelInfo:
325325
"https://huggingface.co/HuggingFaceH4/zephyr-7b-alpha",
326326
"a chatbot fine-tuned from Mistral by Hugging Face",
327327
)
328+
register_model_info(
329+
[
330+
"Xwin-LM-7B-V0.1",
331+
"Xwin-LM-13B-V0.1",
332+
"Xwin-LM-70B-V0.1",
333+
"Xwin-LM-7B-V0.2",
334+
"Xwin-LM-13B-V0.2",
335+
],
336+
"Xwin-LM",
337+
"https://github.com/Xwin-LM/Xwin-LM",
338+
"Chat models developed by Xwin-LM team",
339+
)

0 commit comments

Comments
 (0)