huggingface / optimum-neuron

Easy, fast and very cheap training and inference on AWS Trainium and Inferentia chips.
Apache License 2.0
176 stars 51 forks source link

Allow download subfolder for caching models with subfolder #566

Closed JingyaHuang closed 2 months ago

JingyaHuang commented 2 months ago

What does this PR do?

The stable diffusion cache actually doesn't work when they have subfolder structure. This PR fixes this.

Before submitting

HuggingFaceDocBuilderDev commented 2 months ago

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

JingyaHuang commented 2 months ago

Hey @dacorvo and @michaelbenayoun, thanks for the comments, I just adjust a bit the solution but not using snapshot_download, it will just list all repo files in the subfolder(list_repo_tree(..., recursive=True)) and download.