-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to use ~/.cache/huggingface/hub
for downloaded models
#102
Comments
~/.cache/huggingface/hub
to download models~/.cache/huggingface/hub
for downloaded models
Users of my app, which uses MLX and swift-transformers, are requesting to be able to reuse models downloaded from other apps, and the Hugging Face cache directory seems like a natural choice. https://x.com/Andreadful_/status/1813156367324057611 https://x.com/vincentbosch/status/1813131165437448646 @pcuenca, any idea how this could be approached, given that swift-transformers and the Python transformers library use a different directory structure for storing the models? |
Andreadful_ here. Of course the solution you laid out above would be the neatest, but I could live with just being able to set a directory of choice for swift-transformers' models (that is, I wouldn't mind too much if swift-transformers requires its own directory structure and downloads duplicates of the same models put into the HF cache by python-transformers). |
@terribilissimo, you can find it here. It is already possible to define a download directory: Ideally swift-transformers should be able to share models with the Python transformers library. I can imagine people will be building macOS apps with the Python and Swift implementations, and currently they use different conventions for saving the model files and so cannot share models. |
The Python transformers library downloads models to
~/.cache/huggingface/hub
. This allows reuse of previously downloaded models by multiple apps. Currently, callingHubApi.shapshot
in swift-transformers downloads the models to a specified directory, with a different directory structure than the one used by Python transformers. As more apps get built with these libraries, it would be great if swift-transformers and Python transformers could share models in the user's home directory on macOS. (If I understand correctly, this isn't possible on iOS, although apps within the same app group can save models to the app group's shared directory.)The text was updated successfully, but these errors were encountered: