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

Respect default timeouts in hf_file_system #2253

Merged
merged 2 commits into from
Apr 26, 2024

Conversation

Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Apr 26, 2024

For normal downloads (i.e. hf_hub_download and snapshot_download), we have configurable values HF_HUB_ETAG_TIMEOUT and HF_HUB_DOWNLOAD_TIMEOUT. Let's use them in the hf filesystem as well to avoid long-lasting requests (current default is to wait indefinitely, now set to 10s).

Related to huggingface/dataset-viewer#2752.

@@ -122,7 +124,7 @@ def _repo_and_revision_exist(
) -> Tuple[bool, Optional[Exception]]:
if (repo_type, repo_id, revision) not in self._repo_and_revision_exists_cache:
try:
self._api.repo_info(repo_id, revision=revision, repo_type=repo_type)
self._api.repo_info(repo_id, revision=revision, repo_type=repo_type, timeout=HF_HUB_ETAG_TIMEOUT)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not per-se a ETAG call (not a HEAD) but it is the proxy we use to confirm repo existence => serves the same purpose.

@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

@mariosasko mariosasko left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@Wauplin Wauplin merged commit b6de3f9 into main Apr 26, 2024
16 checks passed
@Wauplin Wauplin deleted the respect-default-timeout-in-hffs branch April 26, 2024 15:42
@Wauplin
Copy link
Contributor Author

Wauplin commented Apr 26, 2024

Thanks for the quick review!

@lhoestq
Copy link
Member

lhoestq commented Apr 26, 2024

thanks !

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.

None yet

4 participants