File size: 352 Bytes
4755e8c
 
4170ee2
 
 
 
 
 
1
2
3
4
5
6
7
8
9
import gradio as gr

from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm3-6b", trust_remote_code=True)
model = AutoModel.from_pretrained("THUDM/chatglm3-6b", trust_remote_code=True).half().cuda()
model = model.eval()
response, history = model.chat(tokenizer, "δ½ ε₯½", history=[])
print(response)