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

Fix consistency check when downloading a file #1449

Merged
merged 7 commits into from
Apr 25, 2023

Conversation

Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Apr 25, 2023

Related to the recent release of huggingface_hub==0.14.0. See huggingface/diffusers#3213 raised in diffusers. The problem happens when downloading a script from Github. Due to compression the Content-Length header is smaller than the actual file size (hence raising an exception). Consistency check was added in #1403.

To fix it I forbid compression on the HEAD call (headers["Accept-Encoding"] = "identity") to retrieve the correct file size before making the correct GET call. Cc @julien-c @XciD this means that adding compression on the Hub will not mess with file metadata retrieval (it was the case before)

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Apr 25, 2023

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

@Wauplin Wauplin changed the title Check file consistency only for Hub files Fix consistency check when downloading a file Apr 25, 2023
Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

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

Seems like a fair workaround from my limited understanding.

@Wauplin Wauplin merged commit 66c3ff1 into main Apr 25, 2023
@Wauplin Wauplin deleted the fix-consistency-check-for-external-downloads branch April 25, 2023 14:33
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.

3 participants