gpt4 book ai didi

python-3.x - 无法在 Mac M1 中安装分词器

转载 作者:行者123 更新时间:2023-12-05 09:01:46 26 4
gpt4 key购买 nike

我在 Macbook Pro M1 Max 中安装了变形金刚

在此之后,我安装了分词器

pip install tokenizers

显示

Collecting tokenizers
Using cached tokenizers-0.12.1-cp39-cp39-macosx_12_0_arm64.whl
Successfully installed tokenizers-0.12.1

它似乎为 whl 文件使用了正确的体系结构

当我导入它时,我得到了

'/Users/myname/miniforge3/envs/tf/lib/python3.9/site-packages/tokenizers/tokenizers.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))

我看到这个问题曾经发生在其他人身上。关于如何解决这个问题有什么想法吗?

最佳答案

James Briggs 方法有效但会产生以下错误

note: This error originates from a subprocess, and is likely not a problem with pip.
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

问题

安装 Rust 和 Cargo 后,我们必须获取环境文件。这是上一个答案中缺少的步骤。

解决方案

解决此问题的方法是在安装 Rust 后立即在终端中键入以下内容:

source "$HOME/.cargo/env"

然后,您可以使用以下代码片段安装转换器:

pip install transformers 

关于python-3.x - 无法在 Mac M1 中安装分词器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72639615/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com