From bb8aae5e60bde82e5f389c097c76a1bdd4b08341 Mon Sep 17 00:00:00 2001 From: Lianmin Zheng Date: Tue, 16 Jan 2024 23:47:04 -0800 Subject: [PATCH] Bump the version to 0.2.35 (#2927) --- fastchat/__init__.py | 2 +- fastchat/conversation.py | 7 +++---- fastchat/model/model_adapter.py | 26 ++++++++++++++++++++++---- fastchat/model/model_registry.py | 2 +- pyproject.toml | 2 +- 5 files changed, 28 insertions(+), 11 deletions(-) diff --git a/fastchat/__init__.py b/fastchat/__init__.py index 1ee4e63554..9b1b78b4b3 100644 --- a/fastchat/__init__.py +++ b/fastchat/__init__.py @@ -1 +1 @@ -__version__ = "0.2.34" +__version__ = "0.2.35" diff --git a/fastchat/conversation.py b/fastchat/conversation.py index ea552d797e..3d738def51 100644 --- a/fastchat/conversation.py +++ b/fastchat/conversation.py @@ -1434,9 +1434,9 @@ def get_conv_template(name: str) -> Conversation: ) -#yuan 2.0 template -#reference:https://github.com/IEIT-Yuan/Yuan-2.0 -#reference:https://huggingface.co/IEITYuan +# yuan 2.0 template +# reference:https://github.com/IEIT-Yuan/Yuan-2.0 +# reference:https://huggingface.co/IEITYuan register_conv_template( Conversation( name="yuan", @@ -1445,7 +1445,6 @@ def get_conv_template(name: str) -> Conversation: sep_style=SeparatorStyle.NO_COLON_SINGLE, sep="", stop_str="", - ) ) diff --git a/fastchat/model/model_adapter.py b/fastchat/model/model_adapter.py index 74d5b21b18..0d1a02dae1 100644 --- a/fastchat/model/model_adapter.py +++ b/fastchat/model/model_adapter.py @@ -2130,8 +2130,9 @@ def match(self, model_path: str): def get_default_conv_template(self, model_path: str) -> Conversation: return get_conv_template("solar") + class Yuan2Adapter(BaseModelAdapter): - """The model adapter for Yuan """ + """The model adapter for Yuan""" def match(self, model_path: str): return "yuan" in model_path.lower() @@ -2139,14 +2140,31 @@ def match(self, model_path: str): def load_model(self, model_path: str, from_pretrained_kwargs: dict): model, tokenizer = super().load_model(model_path, from_pretrained_kwargs) tokenizer.add_tokens( - ['', '', '', '', '', '', '', '', - '', '', '', '', '', - '', ''], special_tokens=True) + [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + ], + special_tokens=True, + ) return model, tokenizer def get_default_conv_template(self, model_path: str) -> Conversation: return get_conv_template("yuan") + # Note: the registration order matters. # The one registered earlier has a higher matching priority. register_model_adapter(PeftModelAdapter) diff --git a/fastchat/model/model_registry.py b/fastchat/model/model_registry.py index 5616a4e37c..0e8b650ff4 100644 --- a/fastchat/model/model_registry.py +++ b/fastchat/model/model_registry.py @@ -545,7 +545,7 @@ def get_model_info(name: str) -> ModelInfo: ) register_model_info( - ["Yuan2-2B-hf","Yuan2-51B-hf","Yuan2-102B-hf"], + ["Yuan2-2B-hf", "Yuan2-51B-hf", "Yuan2-102B-hf"], "IEIYuan", "https://huggingface.co/IEITYuan", "Yuan2 is a Basemodel developed by IEI.", diff --git a/pyproject.toml b/pyproject.toml index 6124b5ab32..ded93bde76 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "fschat" -version = "0.2.34" +version = "0.2.35" description = "An open platform for training, serving, and evaluating large language model based chatbots." readme = "README.md" requires-python = ">=3.8"