Commit 5534ac8e authored by zhaoying1's avatar zhaoying1
Browse files

Add new file

parent 7a88fd0a
from transformers import AutoModel, AutoTokenizer
import os
tokenizer = AutoTokenizer.from_pretrained("/zhaoy/chatglm-6b-moel", trust_remote_code=True)
model = AutoModel.from_pretrained("/zhaoy/chatglm-6b-moel", trust_remote_code=True).half().cuda()
model = model.eval()
text = "你好"
response, history = model.measure_latency(tokenizer, text, history=[])
print(response)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment