RuntimeError: Failed to import transformers.trainer_seq2seq because of the following error (look up to see its traceback):
cannot import name 'is_npu_available' from 'accelerate.utils' (/usr/local/lib/python3.10/dist-packages/accelerate/utils/__init__.py)

参考:https://github.com/huggingface/transformers/issues/23340

需要升级accelerate包

pip install -U accelerate

执行即可。

Logo

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

更多推荐