pull/477/merge
raxcl 2024-12-15 17:40:44 +00:00 committed by GitHub
commit 515dec7af4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions

View File

@ -8,6 +8,11 @@ model = AutoModel.from_pretrained("THUDM/chatglm2-6b", trust_remote_code=True).c
# 多显卡支持使用下面两行代替上面一行将num_gpus改为你实际的显卡数量
# from utils import load_model_on_gpus
# model = load_model_on_gpus("THUDM/chatglm2-6b", num_gpus=2)
# 量化int4模型示例 替换第八行即可 quantize 对应gpt内存大小适用于gpu不够的笔记本用户如gpu为4G采用前者gpu为8G采用后者
# model = AutoModel.from_pretrained("THUDM/chatglm2-6b", trust_remote_code=True).half().quantize(4).cuda()
# model = AutoModel.from_pretrained("THUDM/chatglm2-6b", trust_remote_code=True).half().quantize(8).cuda()
model = model.eval()
"""Override Chatbot.postprocess"""