Skip to content

Commit

Permalink
修正moss和chatglm的环境依赖
Browse files Browse the repository at this point in the history
  • Loading branch information
binary-sky committed May 8, 2023
1 parent a554b7f commit 84fc864
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
9 changes: 2 additions & 7 deletions docs/GithubAction+ChatGLM+Moss
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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()'
Expand Down
3 changes: 2 additions & 1 deletion request_llm/bridge_chatglm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]')

Expand Down

0 comments on commit 84fc864

Please sign in to comment.