From 84fc8647f7254e5866e562f7e2dfc0cec2067391 Mon Sep 17 00:00:00 2001 From: fuqingxu <505030475@qq.com> Date: Mon, 8 May 2023 20:06:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3moss=E5=92=8Cchatglm=E7=9A=84?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/GithubAction+ChatGLM+Moss | 9 ++------- request_llm/bridge_chatglm.py | 3 ++- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/docs/GithubAction+ChatGLM+Moss b/docs/GithubAction+ChatGLM+Moss index 85888e2a75..ece19d64b0 100644 --- a/docs/GithubAction+ChatGLM+Moss +++ b/docs/GithubAction+ChatGLM+Moss @@ -3,7 +3,7 @@ FROM nvidia/cuda:11.3.1-runtime-ubuntu20.04 ARG useProxyNetwork='' RUN apt-get update -RUN apt-get install -y curl proxychains curl +RUN apt-get install -y curl proxychains curl gcc RUN apt-get install -y git python python3 python-dev python3-dev --fix-missing @@ -21,12 +21,7 @@ RUN python3 -m pip install -r request_llm/requirements_moss.txt RUN python3 -m pip install -r request_llm/requirements_chatglm.txt RUN python3 -m pip install -r request_llm/requirements_newbing.txt -# # 预热CHATGLM参数(非必要 可选步骤) -# RUN echo ' \n\ -# from transformers import AutoModel, AutoTokenizer \n\ -# chatglm_tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True) \n\ -# chatglm_model = AutoModel.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True).float() ' >> warm_up_chatglm.py -# RUN python3 -u warm_up_chatglm.py + # 预热Tiktoken模块 RUN python3 -c 'from check_proxy import warm_up_modules; warm_up_modules()' diff --git a/request_llm/bridge_chatglm.py b/request_llm/bridge_chatglm.py index 3300286b17..100783d248 100644 --- a/request_llm/bridge_chatglm.py +++ b/request_llm/bridge_chatglm.py @@ -68,7 +68,8 @@ def run(self): # command = self.child.recv() # if command == '[Terminate]': break except: - self.child.send('[Local Message] Call ChatGLM fail.') + from toolbox import trimmed_format_exc + self.child.send('[Local Message] Call ChatGLM fail.' + '\n```\n' + trimmed_format_exc() + '\n```\n') # 请求处理结束,开始下一个循环 self.child.send('[Finish]')