请在 下方输入 要搜索的题目:

请你利用transformers这个库,加载chatglm2这个预训练模型的tokenizer和模型 模型位置存放在/root/chatglm2-6b-int4

请你利用transformers这个库,加载chatglm2这个预训练模型的tokenizer和模型 模型位置存放在/root/chatglm2-6b-int4

发布时间:2025-06-19 17:05:51
推荐参考答案 ( 由 快搜搜题库 官方老师解答 )
联系客服
答案:from transformers import AutoModel, AutoTokenizer tokenizer = AutoTokenizer.from_pretrained(/root/chatglm2-6b-int4, trust_remote_code=True) model = AutoModel.from_pretrained(/root/chatglm2-6b-int4, trust_remote_code=True).cuda()
专业技术学习
专业技术学习
搜搜题库系统