当前位置:   article > 正文

Could not build wheels for tokenizers, which is required to install pyproject.toml-based projects分析

could not build wheels for tokenizers, which is required to install pyprojec

报错信息

Building wheels for collected packages: tokenizers
error: subprocess-exited-with-error

× Building wheel for tokenizers (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
Building wheel for tokenizers (pyproject.toml) … error
ERROR: Failed building wheel for tokenizers
Failed to build tokenizers
ERROR: Could not build wheels for tokenizers, which is required to install pyproject.toml-based projects

分析

我的基本环境

  • python -V 我是 python 3.10
  • transformers==4.6.0

报错原因

huggingface transformer 这个包,依赖 tokenizers包, tokenizers 使用了 Rust 多线程加速处理数据集。
这个是Rust的Bug。

解决办法

以下几种解决方案任选一种即可:

第一种:降低python版本, 比如使用 python3.8

第二种:修改源码再编译,在源码上修改依赖的 tokenizers的版本
在这里插入图片描述
然后使用 python setup.py install装包

第三种:使用最新版的 transformers包,修改咱们自己项目的代码。修改咱们项目内报错位置的代码,使其支持最新版的 transformers。

参考资料

  1. https://github.com/huggingface/transformers/issues/2831
  2. https://stackoverflow.com/questions/69595700/could-not-build-wheels-for-tokenizers-which-is-required-to-install-pyproject-to
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/煮酒与君饮/article/detail/946933
推荐阅读
相关标签
  

闽ICP备14008679号