修复AttributeError: BertTokenizerFast has no attribute pad_token

#记录工作

在windows系统上部署ChatTTS-OpenVoice这个项目时,遇到:

(.venv虚拟环境python3.11.11)

AttributeError: BertTokenizerFast has no attribute pad_token

这是由于 transformers在当前环境下不兼容导致的,尝试卸载后再安装其他版本:

#卸载当前transformers
pip uninstall transformers

 

#清理缓存
pip cache purge

 

#安装这个指定版本,或依次尝试其他版本
pip install transformers==4.42.4

 

修复AttributeError: BertTokenizerFast has no attribute pad_token_第1张图片

一般修复后能正常运行 

你可能感兴趣的:(python,windows)