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

Avoid duplicating PyTorch + safetensors downloads. #1836

Merged
merged 1 commit into from
Dec 27, 2022

Conversation

pcuenca
Copy link
Member

@pcuenca pcuenca commented Dec 26, 2022

Duplication happens when there are safetensors versions of some files in the repo but not all.

Ideally, we should just download safetensors files when they are available, and fallback to PyTorch when they are not. This could be done by retrieving the list of files in the repo using list_repo_files (or model_info) and filtering them to keep the ones we want. A similar mechanism could be applied to download fp16 versions when they exist.

Addresses #1811.

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Dec 26, 2022

The documentation is not available anymore as the PR was closed or merged.

Copy link
Contributor

@patil-suraj patil-suraj left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks for fixing!

Copy link
Contributor

@Narsil Narsil left a comment

Choose a reason for hiding this comment

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

LGTM.

@camenduru
Copy link
Contributor

thanks @pcuenca

@pcuenca pcuenca merged commit 68e2425 into main Dec 27, 2022
@pcuenca pcuenca deleted the safetensors-pt-duplicated branch December 27, 2022 13:58
@patrickvonplaten
Copy link
Contributor

Great catch!

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

Successfully merging this pull request may close these issues.

6 participants