Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update web_demo.py #477

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions web_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
# 多显卡支持,使用下面两行代替上面一行,将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"""
Expand Down