Skip to content
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

Enable snapshot_download for different repo types #496

Closed
nateraw opened this issue Nov 23, 2021 · 3 comments
Closed

Enable snapshot_download for different repo types #496

nateraw opened this issue Nov 23, 2021 · 3 comments

Comments

@nateraw
Copy link
Contributor

nateraw commented Nov 23, 2021

Is your feature request related to a problem? Please describe.

Currently, snapshot_download only works for model repos. It would be nice to add repo_type kwarg here and pass it along to the underlying functions to enable snapshot downloads of dataset repos.

Describe the solution you'd like

from huggingface_hub import snapshot_download

cached_repo_path = snapshot_download('nateraw/huggingpics-data-2', repo_type='dataset')

Describe alternatives you've considered

You can do this via Repository, but its more verbose. Also, a generic download_file_or_path function may be nice too...(Related to #460 )

from huggingface_hub import download_file

path = download_file('nateraw/huggingpics-data-2', 'images/')

Additional context

I was playing around with upload_to_hub and load_from_hub functions for Hugging Pics' datasets when I ran into this. Just wanted to grab the entire repo and load images from there, but realized its not possible with snapshot_download.

@osanseviero
Copy link
Contributor

I think your solution is fine and would be consistent with the other methods.

cc @LysandreJik @muellerzr

@LysandreJik
Copy link
Member

Indeed, that would be a nice addition!

@Wauplin
Copy link
Contributor

Wauplin commented Aug 16, 2022

repo_type kwarg added in #801.

@Wauplin Wauplin closed this as completed Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants