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

Set 30s timeout on downloads (instead of 10s) #1514

Merged
merged 2 commits into from
Jun 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/huggingface_hub/file_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ def _request_wrapper(
max_retries: int = 0,
base_wait_time: float = 0.5,
max_wait_time: float = 2,
timeout: float = 10.0,
timeout: Optional[float] = 30.0,
follow_relative_redirects: bool = False,
**params,
) -> requests.Response:
Expand All @@ -388,7 +388,7 @@ def _request_wrapper(
`max_wait_time`.
max_wait_time (`float`, *optional*, defaults to `2`):
Maximum amount of time between two retries, in seconds.
timeout (`float`, *optional*, defaults to `10`):
timeout (`float`, *optional*, defaults to `30`):
How many seconds to wait for the server to send data before
giving up which is passed to `requests.request`.
follow_relative_redirects (`bool`, *optional*, defaults to `False`)
Expand Down Expand Up @@ -465,10 +465,10 @@ def http_get(
temp_file: BinaryIO,
*,
proxies=None,
resume_size=0,
resume_size: float = 0,
headers: Optional[Dict[str, str]] = None,
timeout=10.0,
max_retries=0,
timeout: Optional[float] = 30.0,
max_retries: int = 0,
expected_size: Optional[int] = None,
):
"""
Expand Down Expand Up @@ -1502,7 +1502,7 @@ def get_hf_file_metadata(
url: str,
token: Union[bool, str, None] = None,
proxies: Optional[Dict] = None,
timeout: float = 10,
timeout: Optional[float] = 30.0,
) -> HfFileMetadata:
"""Fetch metadata of a file versioned on the Hub for a given url.

Expand Down