【已解决】cannot import name ‘Cache‘ from ‘transformers‘_cannot import name 'encoderdecodercache' from 'tra-CSDN博客

尝试上述版本安装后

卸载其他无效包

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
llmtuner 0.3.1 requires gradio<4.0.0,>=3.38.0, but you have gradio 5.31.0 which is incompatible.
llmtuner 0.3.1 requires transformers<4.35.0,>=4.31.0, but you have transformers 4.52.4 which is incompatible.
Successfully installed gradio-5.31.0 gradio-client-1.10.1 llamafactory-0.9.4.dev0 peft-0.15.2 tokenizers-0.21.1 transformers-4.52.4
pip uninstall llmtuner

重新安装依赖

pip install -e ".[torch,metrics]" --no-build-isolation

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐