ImportError: cannot import name ‘Cache‘ from ‘transformers‘ (/usr/local/lib/python3.11/dist-packages
【代码】ImportError: cannot import name ‘Cache‘ from ‘transformers‘ (/usr/local/lib/python3.11/dist-packages。
·
尝试上述版本安装后
卸载其他无效包
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
更多推荐
所有评论(0)