Skip to content

Avoid duplicating PyTorch + safetensors downloads.#1836

Merged
pcuenca merged 1 commit into
mainfrom
safetensors-pt-duplicated
Dec 27, 2022
Merged

Avoid duplicating PyTorch + safetensors downloads.#1836
pcuenca merged 1 commit into
mainfrom
safetensors-pt-duplicated

Conversation

@pcuenca

@pcuenca pcuenca commented Dec 26, 2022

Copy link
Copy Markdown
Member

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

HuggingFaceDocBuilderDev commented Dec 26, 2022

Copy link
Copy Markdown

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

@patil-suraj patil-suraj left a comment

Copy link
Copy Markdown
Contributor

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!

@Narsil Narsil left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM.

@camenduru

Copy link
Copy Markdown
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
Copy Markdown
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