量化CodeGeeX2报错AttributeError: ‘ChatGLMTokenizer‘ object has no attribute ‘tokenizer‘. Did you mean: ‘

模型和环境准备

从https://hf-mirror.com/THUDM/codegeex2-6b上下载模型(国内可用),要下载所有文件
下载chatglm-cpp,用于模型量化,
git clone --recursive https://github.com/li-plus/chatglm.cpp.git 根据README.md中的指导完成环境搭建。
我使用的是python3.11.8 最好使用conda创建虚拟环境,以免造成一些问题(比如安装torch时默认安装cpu版,这时可能会自动卸载gpu版torch。另外,还可能出现包冲突而导致pip install某个包时一直报错)

报错解决

如果报AttributeError: ‘ChatGLMTokenizer’ object has no attribute ‘tokenizer’. Did you mean: ‘tokenize’?
从chatglm3-6b中把tokenization_chatglm.py拷贝到模型目录中替换掉原tokenization_chatglm.py。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值