Installing Hugging Face on an M2 macOS Machine

Sophia Parafina - Dec 18 '23 - - Dev Community

If you are installing Hugging Face transformers on a M2 macOS machine, you might run into this error

Ɨ Getting requirements to build wheel did not run successfully.
ā”‚ exit code: 1
ā•°ā”€> [5 lines of output]
Package sentencepiece was not found in the pkg-config search path.
Perhaps you should add the directory containing 'sentencepiece.pc'
to the PKG_CONFIG_PATH environment variable
No package 'sentencepiece' found
Failed to find sentencepiece pkgconfig
[end of output]

If you're installing with pip, do the following before starting the install:

pip install --upgrade pip
pip install 'transformers[tf-cpu]'
brew install sentencepiece
pip install sentencpiece

This will resolve the error when installing sentencepiece.

. . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player