huggingface / swift-transformers

Swift Package to implement a transformers-like API in Swift
Apache License 2.0
718 stars 80 forks source link

authorizationRequired error when calling AutoTokenizer.from #36

Open hassanzadeh opened 10 months ago

hassanzadeh commented 10 months ago

Hey Guys, I'm trying to load a tokenizer whose files are stored in Application Support directory, but I get this exception: authorizationRequired when calling: let tokenizer = try await AutoTokenizer.from(pretrained: modelPath)

What am I missing?

pcuenca commented 10 months ago

Hi @hassanzadeh! What does modelPath contain? Is it a private or gated repo?

hassanzadeh commented 10 months ago

Hi @pcuenca Thanks for your response it’s the local path on my macOS where model is downloaded.

pcuenca commented 10 months ago

This is a bug then, will take a look soon! Thanks for reporting! 🙌

xcphantomxc commented 1 month ago

I also encountered this problem, but I solved it by hardcoding my hf account Token on the hfToken attribute of the HubApi file.