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

dev(narugo): add resume for ranged headers of http_get function #2823

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

narugo1992
Copy link

for issue #2761

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Contributor

@hanouticelina hanouticelina left a comment

Choose a reason for hiding this comment

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

Hi @narugo1992, thanks a lot for your contribution!
I left some comments and I took the initiative to push to your branch an improvement of the http get tests to use pytest instead of unittest. It's a bit out of scope of this PR, but it consolidates the tests you added.

src/huggingface_hub/file_download.py Outdated Show resolved Hide resolved
Copy link
Contributor

@hanouticelina hanouticelina left a comment

Choose a reason for hiding this comment

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

Thanks again @narugo1992 for your contribution 🤗
I pushed a simplification of the _adjust_range_header, everything looks good now! Let's wait for a final review from @Wauplin and then we should be good to merge.

Copy link
Contributor

@Wauplin Wauplin left a comment

Choose a reason for hiding this comment

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

Thanks for the ping. Maybe I'm wrong but I feel we should be more conservative on the use cases we want to support
i.e., better to raise explicit errors for now on corner cases and add them later if we think they are useful

src/huggingface_hub/utils/_http.py Outdated Show resolved Hide resolved
src/huggingface_hub/utils/_http.py Outdated Show resolved Hide resolved
src/huggingface_hub/utils/_http.py Outdated Show resolved Hide resolved
src/huggingface_hub/utils/_http.py Outdated Show resolved Hide resolved
tests/test_utils_http.py Show resolved Hide resolved
tests/test_utils_http.py Outdated Show resolved Hide resolved
tests/test_utils_http.py Outdated Show resolved Hide resolved
@narugo1992 narugo1992 requested a review from Wauplin February 6, 2025 01:47
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.

4 participants