diff --git a/README.md b/README.md index f9b42b568..501400722 100644 --- a/README.md +++ b/README.md @@ -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). diff --git a/docs/model_support.md b/docs/model_support.md index 042e78963..b71bd5b19 100644 --- a/docs/model_support.md +++ b/docs/model_support.md @@ -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) diff --git a/fastchat/conversation.py b/fastchat/conversation.py index 77aad9844..73d24a72d 100644 --- a/fastchat/conversation.py +++ b/fastchat/conversation.py @@ -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|>", + ) +) + # Tulu default template register_conv_template( Conversation( diff --git a/fastchat/model/model_adapter.py b/fastchat/model/model_adapter.py index 730723c2e..43f5af189 100644 --- a/fastchat/model/model_adapter.py +++ b/fastchat/model/model_adapter.py @@ -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""" @@ -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) diff --git a/fastchat/model/model_registry.py b/fastchat/model/model_registry.py index 10af25a67..f7b18c0f4 100644 --- a/fastchat/model/model_registry.py +++ b/fastchat/model/model_registry.py @@ -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",