yuanzhoulvpi2017 / zero_nlp

中文nlp解决方案(大模型、数据、模型、训练、推理)
MIT License
2.85k stars 355 forks source link

遇到报错 RuntimeError: self and mat2 must have the same dtype #109

Closed diaojunxian closed 1 year ago

diaojunxian commented 1 year ago

在本地执行遇到问题:

image

yuanzhoulvpi2017 commented 1 year ago

查看代码https://github.com/yuanzhoulvpi2017/zero_nlp/blob/main/simple_thu_chatglm6b/infer.ipynb的最下面。

example:


text ="为什么冰红茶和柠檬茶的味道一样?"

with torch.autocast("cuda"):
    res, history = model.chat(tokenizer=tokenizer, query=text,max_length=300)
    print(res)