家用电脑cpu部署运行chatglm-6b ai大模型问答笔记
本次使用的代码如下:
from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("D:\ChatGLM-6B\THUDM\chatglm-6b-int4", trust_remote_code=True) #model = AutoModel.from_pretrained("D:/ChatGLM-6B/THUDM/chatglm-6b-int4", trust_remote_code=True).half().cuda() #gpu运行方式 model = AutoModel.from_pretrained("D:\ChatGLM-6B\THUDM\chatglm-6b-int4", trust_remote_code=True).float() response, history = model.chat(tokenizer, "你好", h...
点击查看剩余70%
网友评论