Skip to content

Commit

Permalink
Set timeout to 60 instead of 30 when downloading files (#1523)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wauplin authored Jun 21, 2023
1 parent 92028da commit c368177
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 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: Optional[float] = 30.0,
timeout: Optional[float] = 60.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 `30`):
timeout (`float`, *optional*, defaults to `60`):
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 @@ -467,7 +467,7 @@ def http_get(
proxies=None,
resume_size: float = 0,
headers: Optional[Dict[str, str]] = None,
timeout: Optional[float] = 30.0,
timeout: Optional[float] = 60.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: Optional[float] = 30.0,
timeout: Optional[float] = 60.0,
) -> HfFileMetadata:
"""Fetch metadata of a file versioned on the Hub for a given url.
Expand Down

0 comments on commit c368177

Please sign in to comment.