From 94d430463862098d32ef77d86ea8dc3e23727d13 Mon Sep 17 00:00:00 2001 From: zR <2448370773@qq.com> Date: Mon, 13 Nov 2023 16:30:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BA=86chatglm3=206b=20agen?= =?UTF-8?q?t=E7=9A=84=E6=96=87=E6=A1=A3=EF=BC=8C=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E8=AF=8D=20(#2041)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新了chatglm3 6b agent的文档,提示词 修复代理no_proxy格式问题 #1838 的问题,感谢多次复现和验证 修改了pg清理知识库后还会引用之前知识库的问题 --- configs/model_config.py.example | 3 +++ configs/prompt_config.py.example | 4 ++-- server/knowledge_base/kb_service/pg_kb_service.py | 2 ++ server/utils.py | 3 ++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/configs/model_config.py.example b/configs/model_config.py.example index 7a7a20f..e1c2a09 100644 --- a/configs/model_config.py.example +++ b/configs/model_config.py.example @@ -153,6 +153,9 @@ MODEL_PATH = { "chatglm2-6b": "THUDM/chatglm2-6b", "chatglm2-6b-32k": "THUDM/chatglm2-6b-32k", + "chatglm3-6b": "THUDM/chatglm3-6b", + "chatglm3-6b-32k": "THUDM/chatglm3-6b-32k", + "baichuan2-13b": "baichuan-inc/Baichuan2-13B-Chat", "baichuan2-7b": "baichuan-inc/Baichuan2-7B-Chat", diff --git a/configs/prompt_config.py.example b/configs/prompt_config.py.example index 6a8a086..52ff73e 100644 --- a/configs/prompt_config.py.example +++ b/configs/prompt_config.py.example @@ -100,8 +100,8 @@ PROMPT_TEMPLATES = { Question: {input} Thought: {agent_scratchpad} """, - # ChatGLM3必须用官方的提示词,没有修改空间,参数都不会传入进去 - "ChatGLM3": + + "ChatGLM3": # ChatGLM3必须用官方的提示词,没有修改空间,目前参数都不会传入进去 """ history: {history} diff --git a/server/knowledge_base/kb_service/pg_kb_service.py b/server/knowledge_base/kb_service/pg_kb_service.py index 6337e2b..3a6bab0 100644 --- a/server/knowledge_base/kb_service/pg_kb_service.py +++ b/server/knowledge_base/kb_service/pg_kb_service.py @@ -10,6 +10,7 @@ from configs import kbs_config from server.knowledge_base.kb_service.base import SupportedVSType, KBService, EmbeddingsFunAdapter, \ score_threshold_process from server.knowledge_base.utils import KnowledgeFile +import shutil class PGKBService(KBService): @@ -50,6 +51,7 @@ class PGKBService(KBService): DELETE FROM langchain_pg_collection WHERE name = '{self.kb_name}'; ''')) connect.commit() + shutil.rmtree(self.kb_path) def do_search(self, query: str, top_k: int, score_threshold: float): self._load_pg_vector() diff --git a/server/utils.py b/server/utils.py index df4ee03..9368c58 100644 --- a/server/utils.py +++ b/server/utils.py @@ -623,7 +623,8 @@ def get_httpx_client( }) for host in os.environ.get("no_proxy", "").split(","): if host := host.strip(): - default_proxies.update({host: None}) + # default_proxies.update({host: None}) # Origin code + default_proxies.update({'all://' + host: None}) # PR 1838 fix, if not add 'all://', httpx will raise error # merge default proxies with user provided proxies if isinstance(proxies, str):