下载chatglm2-6b
print('开始加载分词器tokenizer...')
tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm2-6b", trust_remote_code=True)
print('开始加载语言模型model...')
model = AutoModel.from_pretrained("THUDM/chatglm2-6b", trust_remote_code=True).cuda()
默认保存到~/.cache/huggingface/hub/models--THUDM--chatglm2-6b
url地址: https://huggingface.co/THUDM/chatglm2-6b/tree/main
共18个文件
标签:6b,code,tokenizer,ChatGLM2,THUDM,trust,chatglm2 From: https://www.cnblogs.com/xuehuiping/p/17736291.html