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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ You can use the commands below to chat with FastChat-T5. It will automatically d

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

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

Expand Down
1 change: 1 addition & 0 deletions docs/model_support.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
- [NousResearch/Nous-Hermes-13b](https://huggingface.co/NousResearch/Nous-Hermes-13b)
- [openaccess-ai-collective/manticore-13b-chat-pyg](https://huggingface.co/openaccess-ai-collective/manticore-13b-chat-pyg)
- [OpenAssistant/oasst-sft-4-pythia-12b-epoch-3.5](https://huggingface.co/OpenAssistant/oasst-sft-4-pythia-12b-epoch-3.5)
- [openchat/openchat_3.5](https://huggingface.co/openchat/openchat_3.5)
- [Open-Orca/Mistral-7B-OpenOrca](https://huggingface.co/Open-Orca/Mistral-7B-OpenOrca)
- [VMware/open-llama-7b-v2-open-instruct](https://huggingface.co/VMware/open-llama-7b-v2-open-instruct)
- [Phind/Phind-CodeLlama-34B-v2](https://huggingface.co/Phind/Phind-CodeLlama-34B-v2)
Expand Down
10 changes: 10 additions & 0 deletions fastchat/conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,16 @@ def get_conv_template(name: str) -> Conversation:
)
)

# OpenChat 3.5 default template
register_conv_template(
Conversation(
name="openchat_3.5",
roles=("GPT4 Correct User", "GPT4 Correct Assistant"),
sep_style=SeparatorStyle.FALCON_CHAT,
sep="<|end_of_turn|>",
Comment on lines +486 to +489
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, why do you choose this template?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the conversation template looks like https://huggingface.co/openchat/openchat_3.5/discussions/5#6544c046ee8e348cf9990a8b

If there is no system prompt, there should be no extra separators, FALCON_CHAT will do the job.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@imoneoi Why do you use "GPT4 Correct User"/"GPT4 Correct Assistant" instead of simple "User"/"Assistant"?

)
)

# Tulu default template
register_conv_template(
Conversation(
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 @@ -798,6 +798,16 @@ def get_default_conv_template(self, model_path: str) -> Conversation:
return get_conv_template("oasst_llama")


class OpenChat35Adapter(BaseModelAdapter):
"""The model adapter for OpenChat 3.5 (e.g. openchat/openchat_3.5)"""

def match(self, model_path: str):
return "openchat" in model_path.lower() and "3.5" in model_path.lower()

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


class PythiaAdapter(BaseModelAdapter):
"""The model adapter for any EleutherAI/pythia model"""

Expand Down Expand Up @@ -1755,6 +1765,7 @@ def get_default_conv_template(self, model_path: str) -> Conversation:
register_model_adapter(DollyV2Adapter)
register_model_adapter(OasstPythiaAdapter)
register_model_adapter(OasstLLaMAAdapter)
register_model_adapter(OpenChat35Adapter)
register_model_adapter(StableLMAdapter)
register_model_adapter(BaizeAdapter)
register_model_adapter(RwkvAdapter)
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 @@ -152,6 +152,12 @@ def get_model_info(name: str) -> ModelInfo:
"https://open-assistant.io",
"an Open Assistant for everyone by LAION",
)
register_model_info(
["openchat_3.5"],
"OpenChat 3.5",
"https://github.com/imoneoi/openchat",
"OpenChat 3.5 is a versatile, open-source language model fine-tuned using C-RLFT",
)
register_model_info(
["llama-7b", "llama-13b"],
"LLaMA",
Expand Down