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 get_hf_file_metadata to fetch metadata from the Hub #1058

Merged
merged 7 commits into from
Sep 20, 2022

Conversation

Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Sep 16, 2022

Fix #1028.

By using the officially supported get_hf_file_metadata, transformers can stop using _request_for_retry and _normalize_etag private methods (cc @sgugger @LysandreJik).

Edit: reverted back to Draft PR as the tests are not implemented.

@Wauplin Wauplin marked this pull request as draft September 16, 2022 11:27
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Sep 16, 2022

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

@codecov
Copy link

codecov bot commented Sep 16, 2022

Codecov Report

Merging #1058 (53e0ed8) into main (4ebc605) will increase coverage by 0.02%.
The diff coverage is 92.85%.

@@            Coverage Diff             @@
##             main    #1058      +/-   ##
==========================================
+ Coverage   83.97%   83.99%   +0.02%     
==========================================
  Files          38       38              
  Lines        4099     4117      +18     
==========================================
+ Hits         3442     3458      +16     
- Misses        657      659       +2     
Impacted Files Coverage Δ
src/huggingface_hub/__init__.py 75.75% <ø> (ø)
src/huggingface_hub/file_download.py 86.82% <92.85%> (+0.10%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@Wauplin Wauplin marked this pull request as ready for review September 16, 2022 12:07
Copy link
Contributor

@sgugger sgugger left a comment

Choose a reason for hiding this comment

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

Looks great, thanks for working on this! Just left some small nits on docstrings.

src/huggingface_hub/file_download.py Outdated Show resolved Hide resolved
src/huggingface_hub/file_download.py Outdated Show resolved Hide resolved
Wauplin and others added 2 commits September 16, 2022 15:35
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
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.

Looks good, thank you @Wauplin!

@Wauplin
Copy link
Contributor Author

Wauplin commented Sep 20, 2022

Thanks both for the review, I'm merging :)

@Wauplin Wauplin merged commit 300b792 into main Sep 20, 2022
@Wauplin Wauplin deleted the 1028-make-an-official-get-hub-metadata-helper branch September 20, 2022 06:52
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.

User-facing APIs for _request_for_retry and _normalize_etag
4 participants