Merge pull request #678 from gwj12345/master

补充了"不能正常加载ChatGLM的参数"的解决方法
This commit is contained in:
binary-husky 2023-05-04 22:59:31 +08:00 committed by GitHub
commit f6da72c9eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,7 +20,7 @@ If you like this project, please give it a Star. If you've come up with more use
> 3.本项目兼容并鼓励尝试国产大语言模型chatglm等。已支持OpenAI和API2D的api-key共存可在配置文件中填写如`API_KEY="openai-key1,openai-key2,api2d-key3"`。需要临时更换`API_KEY`时,在输入区输入临时的`API_KEY`然后回车键提交后即可生效。
<div align="center">
功能 | 描述
--- | ---
一键润色 | 支持一键润色、一键查找论文语法错误
@ -112,6 +112,10 @@ python -m pip install -r requirements.txt
如果需要支持清华ChatGLM后端需要额外安装更多依赖前提条件熟悉python + 电脑配置够强):
```sh
python -m pip install -r request_llm/requirements_chatglm.txt
# 备注:如果遇到"Call ChatGLM fail 不能正常加载ChatGLM的参数" 错误,参考如下:
# 1以上默认安装的为torch+cpu版使用cuda需要卸载torch重新安装torch+cuda
# 2如因本机配置不够无法加载模型可以修改request_llm/bridge_chatglm.py中的模型精度, 将 AutoTokenizer.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True) 都修改为 AutoTokenizer.from_pretrained("THUDM/chatglm-6b-int4", trust_remote_code=True)
```
4. 运行