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

add library_name parameter to hf_hub_download for better model tracking on the Hub. #325

Closed
wants to merge 3 commits into from

Conversation

Vaibhavs10
Copy link

@Vaibhavs10 Vaibhavs10 commented Oct 19, 2023

Hi there - hf_hub_download in the huggingface_hub package allows for better tracking for the model checkpoint usage via library_name and library_version.

This change would not impact any existing downloads, it'll only result in extra information that'll help us get more detailed stats.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 19, 2023
@@ -60,7 +60,7 @@ def _get_state_dict(
else:
assert filename is not None, "filename needs to be defined if using HF checkpoints"

file = hf_hub_download(repo_id=file_or_url_or_id, filename=filename, cache_dir=cache_dir)
file = hf_hub_download(repo_id=file_or_url_or_id, filename=filename, cache_dir=cache_dir, library_name="audiocraft", library_version="1.0.0")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can get the actual version from audiocraft.__version__ :)

@adefossez
Copy link
Contributor

I'm directly adding this into #345

@adefossez adefossez closed this Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants