diff --git a/README.md b/README.md index 730d7270b..86070706e 100644 --- a/README.md +++ b/README.md @@ -158,6 +158,7 @@ At present, we have introduced several key features to showcase our current capa We offer extensive model support, including dozens of large language models (LLMs) from both open-source and API agents, such as LLaMA/LLaMA2, Baichuan, ChatGLM, Wenxin, Tongyi, Zhipu, and many more. - News + - πŸ”₯πŸ”₯πŸ”₯ [Qwen1.5-32B-Chat](https://huggingface.co/Qwen/Qwen1.5-32B-Chat) - πŸ”₯πŸ”₯πŸ”₯ [Starling-LM-7B-beta](https://huggingface.co/Nexusflow/Starling-LM-7B-beta) - πŸ”₯πŸ”₯πŸ”₯ [gemma-7b-it](https://huggingface.co/google/gemma-7b-it) - πŸ”₯πŸ”₯πŸ”₯ [gemma-2b-it](https://huggingface.co/google/gemma-2b-it) diff --git a/README.zh.md b/README.zh.md index 2131d7b12..b6444d6b8 100644 --- a/README.zh.md +++ b/README.zh.md @@ -152,6 +152,7 @@ ζ΅·ι‡ζ¨‘εž‹ζ”―ζŒοΌŒεŒ…ζ‹¬εΌ€ζΊγ€APIδ»£η†η­‰ε‡ εη§ε€§θ―­θ¨€ζ¨‘εž‹γ€‚ε¦‚LLaMA/LLaMA2、Baichuan、ChatGLMγ€ζ–‡εΏƒγ€ι€šδΉ‰γ€ζ™Ίθ°±η­‰γ€‚ε½“ε‰ε·²ζ”―ζŒε¦‚δΈ‹ζ¨‘εž‹: - ζ–°ε’žζ”―ζŒζ¨‘εž‹ + - πŸ”₯πŸ”₯πŸ”₯ [Qwen1.5-32B-Chat](https://huggingface.co/Qwen/Qwen1.5-32B-Chat) - πŸ”₯πŸ”₯πŸ”₯ [Starling-LM-7B-beta](https://huggingface.co/Nexusflow/Starling-LM-7B-beta) - πŸ”₯πŸ”₯πŸ”₯ [gemma-7b-it](https://huggingface.co/google/gemma-7b-it) - πŸ”₯πŸ”₯πŸ”₯ [gemma-2b-it](https://huggingface.co/google/gemma-2b-it) diff --git a/dbgpt/configs/model_config.py b/dbgpt/configs/model_config.py index 81ff0fcfb..ea8af4e63 100644 --- a/dbgpt/configs/model_config.py +++ b/dbgpt/configs/model_config.py @@ -99,6 +99,13 @@ def get_device() -> str: "qwen-1.8b-chat-int8": os.path.join(MODEL_PATH, "wen-1_8B-Chat-Int8"), # https://huggingface.co/Qwen/Qwen-1_8B-Chat-Int4 "qwen-1.8b-chat-int4": os.path.join(MODEL_PATH, "Qwen-1_8B-Chat-Int4"), + # https://huggingface.co/Qwen/Qwen1.5-1.8B-Chat + "qwen1.5-1.8b-chat": os.path.join(MODEL_PATH, "Qwen1.5-1.8B-Chat"), + "qwen1.5-7b-chat": os.path.join(MODEL_PATH, "Qwen1.5-7B-Chat"), + "qwen1.5-14b-chat": os.path.join(MODEL_PATH, "Qwen1.5-14B-Chat"), + # https://huggingface.co/Qwen/Qwen1.5-32B-Chat + "qwen1.5-32b-chat": os.path.join(MODEL_PATH, "Qwen1.5-32B-Chat"), + "qwen1.5-72b-chat": os.path.join(MODEL_PATH, "Qwen1.5-72B-Chat"), # (Llama2 based) We only support WizardLM-13B-V1.2 for now, which is trained from Llama-2 13b, see https://huggingface.co/WizardLM/WizardLM-13B-V1.2 "wizardlm-13b": os.path.join(MODEL_PATH, "WizardLM-13B-V1.2"), # wget https://huggingface.co/TheBloke/vicuna-13B-v1.5-GGUF/resolve/main/vicuna-13b-v1.5.Q4_K_M.gguf -O models/ggml-model-q4_0.gguf diff --git a/dbgpt/model/adapter/hf_adapter.py b/dbgpt/model/adapter/hf_adapter.py index 9c4f85a52..090eb5827 100644 --- a/dbgpt/model/adapter/hf_adapter.py +++ b/dbgpt/model/adapter/hf_adapter.py @@ -246,8 +246,33 @@ def get_str_prompt( return str_prompt +class QwenAdapter(NewHFChatModelAdapter): + """ + https://huggingface.co/Qwen/Qwen1.5-32B-Chat + + TODO: There are problems with quantization. + """ + + support_4bit: bool = True + support_8bit: bool = False # TODO: Support 8bit quantization + + def check_transformer_version(self, current_version: str) -> None: + if not current_version >= "4.37.0": + raise ValueError( + "Qwen 1.5 require transformers.__version__>=4.37.0, please upgrade your transformers package." + ) + + def do_match(self, lower_model_name_or_path: Optional[str] = None): + return ( + lower_model_name_or_path + and "qwen" in lower_model_name_or_path + and "1.5" in lower_model_name_or_path + ) + + register_model_adapter(YiAdapter) register_model_adapter(Mixtral8x7BAdapter) register_model_adapter(SOLARAdapter) register_model_adapter(GemmaAdapter) register_model_adapter(StarlingLMAdapter) +register_model_adapter(QwenAdapter) diff --git a/dbgpt/util/date_utils.py b/dbgpt/util/date_utils.py index e711070e8..26e16ab7b 100644 --- a/dbgpt/util/date_utils.py +++ b/dbgpt/util/date_utils.py @@ -6,6 +6,7 @@ def is_datetime(value): def convert_datetime_in_row(row): - return [value.strftime('%Y-%m-%d %H:%M:%S') if is_datetime(value) - else value for value in row] - + return [ + value.strftime("%Y-%m-%d %H:%M:%S") if is_datetime(value) else value + for value in row + ] diff --git a/requirements/dev-requirements.txt b/requirements/dev-requirements.txt index 8061d24d2..c67f77c5d 100644 --- a/requirements/dev-requirements.txt +++ b/requirements/dev-requirements.txt @@ -13,4 +13,5 @@ aioresponses # for git hooks pre-commit # Type checking -mypy==1.7.0 \ No newline at end of file +mypy==1.7.0 +httpx==0.26.0 \ No newline at end of file