huggingface / swift-transformers

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

Propagate HubApi configuration #62

Closed jkrukowski closed 3 months ago

jkrukowski commented 3 months ago

Propagating the HubApi configuration will allow the user to specify the download folder when using e.g. AutoTokenizer.from method.

Detailed description of the issue:

I'm trying to create a homebrew formula for WhisperKit CLI (PR is here: https://github.com/Homebrew/homebrew-core/pull/165912). As a part of the acceptance criteria, homebrew CI runs the tests on the formula in the sandbox environment. The tests are failing because the whisperkit cli is trying to download the tokenizer configuration to the destination to which it doesn't have access and this results in error:

Error: You don’t have permission to save the file “whisper-tiny” in the folder “openai”.

cc @ZachNagengast

jkrukowski commented 3 months ago

Thank you! Do you need this merged ASAP? Otherwise I'd wait for @ZachNagengast in case he sees a problem with it (tests pass on my end).

sure, let's wait for @ZachNagengast

ZachNagengast commented 3 months ago

Brilliant, this will help a ton with the AutoTokenizer downloads since normal model downloads allow the same feature.

jkrukowski commented 3 months ago

@pcuenca would it be possible to tag a new release after this one is merged?