Views
No views yet
1import torch
2from chatglm_q.decoder import ChatGLMDecoder, chat_template
3
4device = torch.device("cuda")
5decoder = ChatGLMDecoder.from_pretrained("K024/chatglm2-6b-int8", device=device)
6
7prompt = chat_template([], "我是谁?")
8for text in decoder.generate(prompt):
9 print(text)