Update web_demo.py

pull/9/head
duzx16 2023-03-13 23:38:20 +08:00
parent fe48cdec6a
commit a2f8bec32b
1 changed files with 1 additions and 2 deletions

View File

@ -2,8 +2,7 @@ from transformers import AutoModel, AutoTokenizer
import gradio as gr
tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True)
model = AutoModel.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True)
model = model.half().cuda()
model = AutoModel.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True).half().cuda()
model = model.eval()
MAX_TURNS = 20