# Runtime Error Due to Mac M1 Architecture?

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fruntime-error-due-to-mac-m1-architecture%2F19824%3E%5C
**Category:** 🤗Transformers\
**Created:** [June 30, 2022, 12:58am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fruntime-error-due-to-mac-m1-architecture%2F19824 "2022-06-30T00:58:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![etan18](https://avatars.discourse-cdn.com/v4/letter/e/f04885/32.png) [@etan18](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fetan18)%5C
**Post date:** [June 30, 2022, 12:58am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fruntime-error-due-to-mac-m1-architecture%2F19824%2F1 "2022-06-30T00:58:00Z")

</div>

I am trying to use AutoModelForTokenClassification from transformers. It is importing correctly but I’m getting the following runtime error when executing  
`model = AutoModelForTokenClassification.from_pretrained("distilbert-base-uncased", num_labels=len(label_list))`

Error:  
` "name": "RuntimeError", "message": "Failed to import transformers.models.camembert.configuration_camembert because of the following error (look up to see its traceback):\ndlopen(/Users/etan/Projects/Proj1/venv/lib/python3.9/site-packages/tokenizers/tokenizers.cpython-39-darwin.so, 0x0002): tried: '/Users/etan/Projects/Proj1/venv/lib/python3.9/site-packages/tokenizers/tokenizers.cpython-39-darwin.so' (**mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')**), '/usr/local/lib/tokenizers.cpython-39-darwin.so' (no such file), '/usr/lib/tokenizers.cpython-39-darwin.so' (no such file)"`

Looks like it has something to do with the fact that I have an x86\_64 architecture, but when I execute the command `exec arch -arm64 zsh` it exits my virtual environment and applies the arch to my global env. What should I do? For reference, I have a 2021 MacBook Pro with M1 chip running MacOS Monterey (12.2.1).

---

<div class="post-metadata">

**Author:** ![BramVanroy](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/bramvanroy/32/47360_2.png) [@BramVanroy](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FBramVanroy)%5C
**Post date:** [June 30, 2022, 12:29pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fruntime-error-due-to-mac-m1-architecture%2F19824%2F2 "2022-06-30T12:29:36Z")

</div>

I think this is a relevant issue for you: [wrong architecture `tokenizers.cpython-39-darwin.so` (x86\_64) when installing on apple silicon (arm64) · Issue #712 · huggingface/tokenizers · GitHub](https://github.com/huggingface/tokenizers/issues/712)

---

<div class="post-metadata">

**Author:** ![etan18](https://avatars.discourse-cdn.com/v4/letter/e/f04885/32.png) [@etan18](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fetan18)%5C
**Post date:** [July 4, 2022, 1:11am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fruntime-error-due-to-mac-m1-architecture%2F19824%2F3 "2022-07-04T01:11:37Z")

</div>

I tried building manually by following the instructions in the post, but it’s still building for the arm64 architecture instead of x86\_64 (the .whl file it gives me is `tokenizers-0.12.1-cp39-cp39-macosx_12_0_arm64.whl`. Is there any way that I can just download the correct .whl file and build it?
