Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/model_support.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,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)
- [Xwin-LM/Xwin-LM-7B-V0.1](https://huggingface.co/Xwin-LM/Xwin-LM-70B-V0.1)
- Any [EleutherAI](https://huggingface.co/EleutherAI) pythia model such as [pythia-6.9b](https://huggingface.co/EleutherAI/pythia-6.9b)
- Any [Peft](https://github.com/huggingface/peft) adapter trained on top of a
model above. To activate, must have `peft` in the model path. Note: If
Expand Down
13 changes: 13 additions & 0 deletions fastchat/model/model_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1672,6 +1672,18 @@ def get_default_conv_template(self, model_path: str) -> Conversation:
return get_conv_template("zephyr")


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)"""

# use_fast_tokenizer = False

def match(self, model_path: str):
return "xwin-lm" in model_path.lower()

def get_default_conv_template(self, model_path: str) -> Conversation:
return get_conv_template("vicuna_v1.1")


# Note: the registration order matters.
# The one registered earlier has a higher matching priority.
register_model_adapter(PeftModelAdapter)
Expand Down Expand Up @@ -1733,6 +1745,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(XwinLMAdapter)

# After all adapters, try the default base adapter.
register_model_adapter(BaseModelAdapter)
12 changes: 12 additions & 0 deletions fastchat/model/model_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,3 +325,15 @@ 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(
[
"Xwin-LM-7B-V0.1",
"Xwin-LM-13B-V0.1",
"Xwin-LM-70B-V0.1",
"Xwin-LM-7B-V0.2",
"Xwin-LM-13B-V0.2",
],
"Xwin-LM",
"https://github.com/Xwin-LM/Xwin-LM",
"Chat models developed by Xwin-LM team",
)