swiftxcodemacoshuggingface-transformershuggingface

Xcode Can't Find swift-transformers Package


I'm trying to implement Speech-to-Text transcription in my Swift app using Hugging Face's swift-transformers package to run Whisper models locally. I've added the package to my Xcode project, but when I try to import it, I get the error:

No module found 'Transformers'

What I've tried:

Added the package via File → Add Package Dependencies using the GitHub URL The package appears in my Package Dependencies in the project navigator Cleaned and rebuilt the project

enter image description here

enter image description here

https://github.com/huggingface/swift-transformers Its showing in the Frameworks as well, however still module not found?


Solution

  • Transformers is not a module, so you cannot import it. (It's the name of a library.) Modules you can import are Hub, Tokenizers, Generation, and Models.