Skip to content

Commit

Permalink
Set timeout to 10s (#1530)
Browse files Browse the repository at this point in the history
* timeout 10s

* timeout 10s

---------

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
  • Loading branch information
ydshieh and ydshieh authored Jun 27, 2023
1 parent 909fbd6 commit e4a419b
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] = 60.0,
timeout: Optional[float] = 10.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 `60`):
timeout (`float`, *optional*, defaults to `10`):
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] = 60.0,
timeout: Optional[float] = 10.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] = 60.0,
timeout: Optional[float] = 10.0,
) -> HfFileMetadata:
"""Fetch metadata of a file versioned on the Hub for a given url.
Expand Down

0 comments on commit e4a419b

Please sign in to comment.