From 8b70b1db7e5b68b74fa9365daed5b201853d9209 Mon Sep 17 00:00:00 2001 From: zR <2448370773@qq.com> Date: Thu, 30 Nov 2023 17:25:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E4=BA=9B=E7=BB=86=E8=8A=82=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=20(#2235)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 更新Langchain依赖到0.0.342以上版本 * 更改了一些提示词和依赖,修改了openai异常的问题 * 注释data的打印日志 * 增加Qwen新模型的支持 --- configs/model_config.py.example | 45 +++++++++++++++++++++++++-------- webui_pages/utils.py | 4 +-- 2 files changed, 37 insertions(+), 12 deletions(-) diff --git a/configs/model_config.py.example b/configs/model_config.py.example index e08b5a0..06d7323 100644 --- a/configs/model_config.py.example +++ b/configs/model_config.py.example @@ -112,7 +112,7 @@ ONLINE_LLM_MODEL = { "api_key": "", "provider": "AzureWorker", }, - + # 昆仑万维天工 API https://model-platform.tiangong.cn/ "tiangong-api": { "version":"SkyChat-MegaVerse", @@ -163,6 +163,25 @@ MODEL_PATH = { "chatglm3-6b": "THUDM/chatglm3-6b", "chatglm3-6b-32k": "THUDM/chatglm3-6b-32k", + "chatglm3-6b-base": "THUDM/chatglm3-6b-base", + + "Qwen-1_8B": "Qwen/Qwen-1_8B", + "Qwen-1_8B-Chat":"Qwen/Qwen-1_8B-Chat", + "Qwen-1_8B-Chat-Int8":"Qwen/Qwen-1_8B-Chat-Int8", + "Qwen-1_8B-Chat-Int4":"Qwen/Qwen-1_8B-Chat-Int4", + + "Qwen-7B": "Qwen/Qwen-7B", + "Qwen-7B-Chat": "Qwen/Qwen-7B-Chat", + + "Qwen-14B": "Qwen/Qwen-14B", + "Qwen-14B-Chat": "Qwen/Qwen-14B-Chat", + "Qwen-14B-Chat-Int8": "Qwen/Qwen-14B-Chat-Int8", + "Qwen-14B-Chat-Int4": "Qwen/Qwen-14B-Chat-Int4", + + "Qwen-72B": "Qwen/Qwen-72B", + "Qwen-72B-Chat": "Qwen/Qwen-72B-Chat", + "Qwen-72B-Chat-Int8":"Qwen/Qwen-72B-Chat-Int8" + "Qwen-72B-Chat-Int4":"Qwen/Qwen-72B-Chat-Int4" "baichuan2-13b": "baichuan-inc/Baichuan2-13B-Chat", "baichuan2-7b": "baichuan-inc/Baichuan2-7B-Chat", @@ -204,18 +223,11 @@ MODEL_PATH = { "opt-66b": "facebook/opt-66b", "opt-iml-max-30b": "facebook/opt-iml-max-30b", - "Qwen-7B": "Qwen/Qwen-7B", - "Qwen-14B": "Qwen/Qwen-14B", - "Qwen-7B-Chat": "Qwen/Qwen-7B-Chat", - "Qwen-14B-Chat": "Qwen/Qwen-14B-Chat", - "Qwen-14B-Chat-Int8": "Qwen/Qwen-14B-Chat-Int8", # 确保已经安装了auto-gptq optimum flash-attn - "Qwen-14B-Chat-Int4": "Qwen/Qwen-14B-Chat-Int4", # 确保已经安装了auto-gptq optimum flash-attn - "agentlm-7b": "THUDM/agentlm-7b", "agentlm-13b": "THUDM/agentlm-13b", "agentlm-70b": "THUDM/agentlm-70b", - "Yi-34B-Chat": "https://huggingface.co/01-ai/Yi-34B-Chat", # 更多01-ai模型尚未进行测试。如果需要使用,请自行测试。 + "Yi-34B-Chat": "https://huggingface.co/01-ai/Yi-34B-Chat", }, } @@ -273,10 +285,23 @@ VLLM_MODEL_DICT = { "opt-66b": "facebook/opt-66b", "opt-iml-max-30b": "facebook/opt-iml-max-30b", + "Qwen-1_8B": "Qwen/Qwen-1_8B", + "Qwen-1_8B-Chat":"Qwen/Qwen-1_8B-Chat", + "Qwen-1_8B-Chat-Int8":"Qwen/Qwen-1_8B-Chat-Int8", + "Qwen-1_8B-Chat-Int4":"Qwen/Qwen-1_8B-Chat-Int4", + "Qwen-7B": "Qwen/Qwen-7B", - "Qwen-14B": "Qwen/Qwen-14B", "Qwen-7B-Chat": "Qwen/Qwen-7B-Chat", + + "Qwen-14B": "Qwen/Qwen-14B", "Qwen-14B-Chat": "Qwen/Qwen-14B-Chat", + "Qwen-14B-Chat-Int8": "Qwen/Qwen-14B-Chat-Int8", + "Qwen-14B-Chat-Int4": "Qwen/Qwen-14B-Chat-Int4", + + "Qwen-72B": "Qwen/Qwen-72B", + "Qwen-72B-Chat": "Qwen/Qwen-72B-Chat", + "Qwen-72B-Chat-Int8":"Qwen/Qwen-72B-Chat-Int8" + "Qwen-72B-Chat-Int4":"Qwen/Qwen-72B-Chat-Int4" "agentlm-7b": "THUDM/agentlm-7b", "agentlm-13b": "THUDM/agentlm-13b", diff --git a/webui_pages/utils.py b/webui_pages/utils.py index 9c34945..d33912a 100644 --- a/webui_pages/utils.py +++ b/webui_pages/utils.py @@ -313,8 +313,8 @@ class ApiRequest: "prompt_name": prompt_name, } - print(f"received input message:") - pprint(data) + # print(f"received input message:") + # pprint(data) response = self.post("/chat/chat", json=data, stream=True, **kwargs) return self._httpx_stream2generator(response, as_json=True)