Skip to content

Commit

Permalink
更新 ChatGLM3 离线包 (#49)
Browse files Browse the repository at this point in the history
* Update download_model.py

* Update download_model.py

* Update test_models.py

* Update requirements.txt

* Update download_model.py

* Update requirements.txt

* Update app_fastapi.py

* Update README.md

* Update README.md

* Update download_model.py

* Update README.md
  • Loading branch information
ypwhs authored Apr 7, 2024
1 parent 02fe5f2 commit 9f30f51
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 23 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,22 @@

| 名称 | 大小 | 百度网盘 | 备注 |
| ---- |---------| ---- | ---- |
| **小显存离线包** | 5.3 GB | [点击下载](https://pan.baidu.com/s/1NgY-i2CXh50vAEhr9N-1EQ?pwd=cglm) | 使用 ChatGLM-6B-int4 权重的离线包,显存需求 8GB |
| 大显存离线包 | 11.8 GB | [点击下载](https://pan.baidu.com/s/19Sx8pBm-BesSQMPd9Zymug?pwd=cglm) | 使用 ChatGLM-6B 权重的离线包,显存需求 16GB |
| 环境离线包 | 2.6 GB | [点击下载](https://pan.baidu.com/s/1Es-Sr8tpc17q69W_RkrlsA?pwd=cglm) | 不带权重的离线包,启动之后可以自动下载模型,默认自动下载 ChatGLM-6B 权重。 |
| **小显存离线包** | 5.3 GB | [点击下载](https://pan.baidu.com/s/1fI1JWBE7KP7cJsoD-dL38g?pwd=cglm) | chatglm2-6b-int4 离线包,显存需求 8GB |
| 大显存离线包 | 11.5 GB | [点击下载](https://pan.baidu.com/s/10oUwW2DUMDFk3RuIkaqGbA?pwd=cglm) | chatglm3-6b 离线包,显存需求 16GB |
| 长文本离线包 | 11.5 GB | [点击下载](https://pan.baidu.com/s/1kbeTdPcUmYd16IE0stXnTA?pwd=cglm) | chatglm3-6b-128k 离线包,显存需求 16GB |
| 环境离线包 | 2.6 GB | [点击下载](https://pan.baidu.com/s/1Kt9eZlgXJ03bVwIM22IR6w?pwd=cglm) | 不带权重的环境包,启动之后自动下载 chatglm2-6b-int4 权重。 |

除了这些离线一键环境之外,你还可以在下面下载一些模型的权重,包括 `THUDM/chatglm-6b` 系列、`silver/chatglm-6b-slim` 系列、`BelleGroup/BELLE` 系列
除了这些一键环境包之外,你还可以在下面下载更多模型的权重

* 百度网盘链接:[https://pan.baidu.com/s/1pnIEj66scZOswHm8oivXmw?pwd=cglm](https://pan.baidu.com/s/1pnIEj66scZOswHm8oivXmw?pwd=cglm)

下载好环境包之后,解压,然后运行 `start_offline.bat` 脚本,即可启动服务:

<img width="734" alt="企业微信截图_16822982234979" src="https://user-images.githubusercontent.com/10473170/229680404-0b28dfd4-382e-4cfc-9392-997f134c0242.png">
![Snipaste_2024-04-07_16-14-54](https://github.com/ypwhs/CreativeChatGLM/assets/10473170/7ab0c0e8-9ada-43ad-b237-ba0f2008bdac)

如果你想使用 API 的形式来调用,可以运行 `start_offline_api.bat` 启动 API 服务:

<img width="734" alt="企业微信截图_16822982234979" src="https://user-images.githubusercontent.com/10473170/233877877-1a0a1daf-2cf1-41d1-9cd8-7f2ad8cb2427.png">
![Snipaste_2024-04-07_16-16-01](https://github.com/ypwhs/CreativeChatGLM/assets/10473170/959c1742-da2e-4b37-b40f-6fb96c53ab89)

## 虚拟环境

Expand Down
2 changes: 1 addition & 1 deletion app_fastapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

# 加载模型
# model_name = 'THUDM/chatglm-6b'
model_name = 'THUDM/chatglm-6b-int4'
model_name = 'THUDM/chatglm3-6b'

if 'chatglm' in model_name.lower():
from predictors.chatglm_predictor import ChatGLM
Expand Down
12 changes: 1 addition & 11 deletions download_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,11 @@
'THUDM/chatglm2-6b-int4',

'THUDM/chatglm3-6b',

# 'BelleGroup/BELLE-LLAMA-7B-2M-gptq',
# 'BelleGroup/BELLE-7B-gptq',
# 'BelleGroup/BELLE-LLAMA-7B-2M',
# 'BelleGroup/BELLE-7B-2M',
'THUDM/chatglm3-6b-128k',

# 'silver/chatglm-6b-slim',
# 'silver/chatglm-6b-int4-slim',
# 'silver/chatglm-6b-int4-qe-slim',

# 'fnlp/moss-moon-003-base',
# 'fnlp/moss-moon-003-sft',
# 'fnlp/moss-moon-003-sft-plugin',
# 'fnlp/moss-moon-003-sft-int4',
# 'fnlp/moss-moon-003-sft-plugin-int4'
]

for model_name in model_name_list:
Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
protobuf~=3.20.0
transformers~=4.35.2
transformers~=4.36.2
icetk~=0.0.4
cpm_kernels~=1.0.11
torch>=1.10
gradio~=4.8.0
gradio~=4.25.0
numpy~=1.23.0
accelerate~=0.25.0
accelerate~=0.29.1
mdtex2html~=1.2.0
sentencepiece~=0.1.97
uvicorn~=0.19.0
fastapi~=0.85.2
fastapi~=0.110.1
requests~=2.27.1
2 changes: 1 addition & 1 deletion test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ def test_model(model_name):

def main():
model_list = [
'THUDM/chatglm2-6b',
'THUDM/chatglm2-6b-int4',
'THUDM/chatglm3-6b',
'THUDM/chatglm3-6b-128k',
]
for model_name in model_list:
print(f'Testing {model_name}')
Expand Down

0 comments on commit 9f30f51

Please sign in to comment.