diff --git a/docs/model_support.md b/docs/model_support.md index 8c1a58eea..a9eb4c895 100644 --- a/docs/model_support.md +++ b/docs/model_support.md @@ -31,6 +31,7 @@ - [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) - [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) - [project-baize/baize-v2-7b](https://huggingface.co/project-baize/baize-v2-7b) - [Qwen/Qwen-7B-Chat](https://huggingface.co/Qwen/Qwen-7B-Chat) - [Salesforce/codet5p-6b](https://huggingface.co/Salesforce/codet5p-6b) @@ -38,6 +39,7 @@ - [THUDM/chatglm-6b](https://huggingface.co/THUDM/chatglm-6b) - [THUDM/chatglm2-6b](https://huggingface.co/THUDM/chatglm2-6b) - [tiiuae/falcon-40b](https://huggingface.co/tiiuae/falcon-40b) +- [tiiuae/falcon-180B-chat](https://huggingface.co/tiiuae/falcon-180B-chat) - [timdettmers/guanaco-33b-merged](https://huggingface.co/timdettmers/guanaco-33b-merged) - [togethercomputer/RedPajama-INCITE-7B-Chat](https://huggingface.co/togethercomputer/RedPajama-INCITE-7B-Chat) - [WizardLM/WizardLM-13B-V1.0](https://huggingface.co/WizardLM/WizardLM-13B-V1.0) @@ -71,7 +73,7 @@ You can add `--debug` to see the actual prompt sent to the model. FastChat uses the `Conversation` class to handle prompt templates and `BaseModelAdapter` class to handle model loading. -1. Implement a conversation template for the new model at [fastchat/conversation.py](https://github.com/lm-sys/FastChat/blob/main/fastchat/conversation.py). You can follow existing examples and use `register_conv_template` to add a new one. +1. Implement a conversation template for the new model at [fastchat/conversation.py](https://github.com/lm-sys/FastChat/blob/main/fastchat/conversation.py). You can follow existing examples and use `register_conv_template` to add a new one. Please also add a link to the official reference code if possible. 2. Implement a model adapter for the new model at [fastchat/model/model_adapter.py](https://github.com/lm-sys/FastChat/blob/main/fastchat/model/model_adapter.py). You can follow existing examples and use `register_model_adapter` to add a new one. 3. (Optional) add the model name to the "Supported models" [section](#supported-models) above and add more information in [fastchat/model/model_registry.py](https://github.com/lm-sys/FastChat/blob/main/fastchat/model/model_registry.py). diff --git a/fastchat/conversation.py b/fastchat/conversation.py index 76e4f151d..763856f85 100644 --- a/fastchat/conversation.py +++ b/fastchat/conversation.py @@ -953,6 +953,7 @@ def get_conv_template(name: str) -> Conversation: ) # Falcon 180B chat template +# source: https://huggingface.co/spaces/tiiuae/falcon-180b-demo/blob/d1590ee7fae9b6ce331ba7808e61a29dcce9239f/app.py#L28-L37 register_conv_template( Conversation( name="falcon-chat", @@ -966,6 +967,7 @@ def get_conv_template(name: str) -> Conversation: ) # Phind template +# source: https://huggingface.co/Phind/Phind-CodeLlama-34B-v2 register_conv_template( Conversation( name="phind", diff --git a/fastchat/model/model_adapter.py b/fastchat/model/model_adapter.py index e6b7bd57e..a3b2632db 100644 --- a/fastchat/model/model_adapter.py +++ b/fastchat/model/model_adapter.py @@ -665,7 +665,7 @@ def match(self, model_path: str): class KoalaAdapter(BaseModelAdapter): - """The model adapter for koala""" + """The model adapter for Koala""" use_fast_tokenizer = False @@ -677,7 +677,7 @@ def get_default_conv_template(self, model_path: str) -> Conversation: class AlpacaAdapter(BaseModelAdapter): - """The model adapter for alpaca""" + """The model adapter for Alpaca""" use_fast_tokenizer = False @@ -1267,7 +1267,7 @@ def get_default_conv_template(self, model_path: str) -> Conversation: class Llama2Adapter(BaseModelAdapter): - """The model adapter for llama-2""" + """The model adapter for Llama-2 (e.g., meta-llama/Llama-2-7b-hf)""" def match(self, model_path: str): return "llama-2" in model_path.lower() @@ -1283,7 +1283,7 @@ def get_default_conv_template(self, model_path: str) -> Conversation: class CuteGPTAdapter(BaseModelAdapter): - """The model adapter for llama-2""" + """The model adapter for CuteGPT""" def match(self, model_path: str): return "cutegpt" in model_path.lower() @@ -1327,7 +1327,7 @@ def get_default_conv_template(self, model_path: str) -> Conversation: class WizardCoderAdapter(BaseModelAdapter): - """The model adapter for WizardCoder""" + """The model adapter for WizardCoder (e.g., WizardLM/WizardCoder-Python-34B-V1.0)""" use_fast_tokenizer = False @@ -1401,7 +1401,7 @@ def get_default_conv_template(self, model_path: str) -> Conversation: class BGEAdapter(BaseModelAdapter): - """The model adapter for BGE""" + """The model adapter for BGE (e.g., BAAI/bge-large-en-v1.5)""" use_fast_tokenizer = False @@ -1430,7 +1430,7 @@ def get_default_conv_template(self, model_path: str) -> Conversation: class E5Adapter(BaseModelAdapter): - """The model adapter for E5""" + """The model adapter for E5 (e.g., intfloat/e5-large-v2)""" use_fast_tokenizer = False @@ -1508,7 +1508,7 @@ def get_default_conv_template(self, model_path: str) -> Conversation: class VigogneInstructAdapter(BaseModelAdapter): - """The model adapter for Vigogne-Instruct""" + """The model adapter for Vigogne-Instruct (e.g., bofenghuang/vigogne-2-7b-instruct)""" use_fast_tokenizer = False @@ -1536,7 +1536,7 @@ def get_default_conv_template(self, model_path: str) -> Conversation: class VigogneChatAdapter(BaseModelAdapter): - """The model adapter for Vigogne-Chat""" + """The model adapter for Vigogne-Chat (e.g., bofenghuang/vigogne-7b-chat)""" use_fast_tokenizer = False @@ -1564,7 +1564,7 @@ def get_default_conv_template(self, model_path: str) -> Conversation: class OpenLLaMaOpenInstructAdapter(BaseModelAdapter): - """The model adapter for OpenLLaMa-Open-Instruct""" + """The model adapter for OpenLLaMa-Open-Instruct (e.g., VMware/open-llama-7b-open-instruct)""" use_fast_tokenizer = False @@ -1594,7 +1594,7 @@ def get_default_conv_template(self, model_path: str) -> Conversation: class CodeLlamaAdapter(BaseModelAdapter): - """The model adapter for Code Llama""" + """The model adapter for CodeLlama (e.g., codellama/CodeLlama-34b-hf)""" def match(self, model_path: str): return "codellama" in model_path.lower() @@ -1610,7 +1610,7 @@ def get_default_conv_template(self, model_path: str) -> Conversation: class PhindCodeLlamaAdapter(CodeLlamaAdapter): - """The model adapter for Phind Code Llama""" + """The model adapter for Phind-CodeLlama (e.g., Phind/Phind-CodeLlama-34B-v2)""" def match(self, model_path: str): return "phind-codellama-" in model_path.lower() diff --git a/fastchat/model/model_registry.py b/fastchat/model/model_registry.py index aaf7e5e5f..0612ca832 100644 --- a/fastchat/model/model_registry.py +++ b/fastchat/model/model_registry.py @@ -252,9 +252,16 @@ def get_model_info(name: str) -> ModelInfo: "A chatbot fine-tuned from RedPajama-INCITE-7B-Base by Together", ) register_model_info( - ["falcon-7b", "falcon-7b-instruct", "falcon-40b", "falcon-40b-instruct"], + [ + "falcon-7b", + "falcon-7b-instruct", + "falcon-40b", + "falcon-40b-instruct", + "falcon-180b", + "falcon-180b-chat", + ], "Falcon", - "https://huggingface.co/tiiuae/falcon-40b", + "https://huggingface.co/tiiuae/falcon-180B", "TII's flagship series of large language models", ) register_model_info(