From 15800ce38c5646275a9391c5c12c5856321f8220 Mon Sep 17 00:00:00 2001 From: gabrielmbmb Date: Tue, 12 Dec 2023 16:16:16 +0000 Subject: [PATCH 1/2] Add `Notus` support Co-authored-by: alvarobartt --- docs/model_support.md | 1 + fastchat/model/model_adapter.py | 9 +++++++++ fastchat/model/model_registry.py | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/docs/model_support.md b/docs/model_support.md index 969311bee..1ba0e6451 100644 --- a/docs/model_support.md +++ b/docs/model_support.md @@ -29,6 +29,7 @@ - example: `python3 -m fastchat.serve.cli --model-path mosaicml/mpt-7b-chat` - [Neutralzz/BiLLa-7B-SFT](https://huggingface.co/Neutralzz/BiLLa-7B-SFT) - [nomic-ai/gpt4all-13b-snoozy](https://huggingface.co/nomic-ai/gpt4all-13b-snoozy) +- [argilla/notus-7b-v1](https://huggingface.co/argilla/notus-7b-v1) - [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) diff --git a/fastchat/model/model_adapter.py b/fastchat/model/model_adapter.py index 78e6c2c8c..6d1ce8473 100644 --- a/fastchat/model/model_adapter.py +++ b/fastchat/model/model_adapter.py @@ -1886,6 +1886,14 @@ def match(self, model_path: str): def get_default_conv_template(self, model_path: str) -> Conversation: return get_conv_template("zephyr") +class NotusAdapter(BaseModelAdapter): + """The model adapter for Notus (e.g. argilla/notus-7b-v1)""" + + def match(self, model_path: str): + return "notus" in model_path.lower() + + 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)""" @@ -2056,6 +2064,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(NotusAdapter) register_model_adapter(XwinLMAdapter) register_model_adapter(LemurAdapter) register_model_adapter(PygmalionAdapter) diff --git a/fastchat/model/model_registry.py b/fastchat/model/model_registry.py index 7f392c596..6eedccf50 100644 --- a/fastchat/model/model_registry.py +++ b/fastchat/model/model_registry.py @@ -134,6 +134,12 @@ 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( + ["notus-7b-v1"], + "Notus", + "https://huggingface.co/argilla/notus-7b-v1", + "a chatbot fine-tuned from Zephyr SFT by Argilla" +) register_model_info( ["qwen-14b-chat"], "Qwen", From 091454bdc86780bca3df30695cbb25902641e297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Mart=C3=ADn=20Bl=C3=A1zquez?= Date: Wed, 13 Dec 2023 11:06:17 +0100 Subject: [PATCH 2/2] Fix format --- fastchat/model/model_adapter.py | 2 ++ fastchat/model/model_registry.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/fastchat/model/model_adapter.py b/fastchat/model/model_adapter.py index 6d1ce8473..cec0e8163 100644 --- a/fastchat/model/model_adapter.py +++ b/fastchat/model/model_adapter.py @@ -1886,6 +1886,7 @@ def match(self, model_path: str): def get_default_conv_template(self, model_path: str) -> Conversation: return get_conv_template("zephyr") + class NotusAdapter(BaseModelAdapter): """The model adapter for Notus (e.g. argilla/notus-7b-v1)""" @@ -1895,6 +1896,7 @@ def match(self, model_path: str): 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)""" diff --git a/fastchat/model/model_registry.py b/fastchat/model/model_registry.py index 6eedccf50..b4ad4083c 100644 --- a/fastchat/model/model_registry.py +++ b/fastchat/model/model_registry.py @@ -138,7 +138,7 @@ def get_model_info(name: str) -> ModelInfo: ["notus-7b-v1"], "Notus", "https://huggingface.co/argilla/notus-7b-v1", - "a chatbot fine-tuned from Zephyr SFT by Argilla" + "a chatbot fine-tuned from Zephyr SFT by Argilla", ) register_model_info( ["qwen-14b-chat"],