Skip to content

Commit d31c68d

Browse files
authored
use constants.HF_HUB_ETAG_TIMEOUT as timeout for get_hf_file_meta… (#3595)
* use constants.HF_HUB_DOWNLOAD_TIMEOUT as timeout for get_hf_file_metadata Signed-off-by: Roman Kayan BAZG <roman.kayan@bazg.admin.ch> * use constants.HF_HUB_ETAG_TIMEOUT as timeout for get_hf_file_metadata Signed-off-by: Roman Kayan BAZG <roman.kayan@bazg.admin.ch> --------- Signed-off-by: Roman Kayan BAZG <roman.kayan@bazg.admin.ch>
1 parent a6a23ac commit d31c68d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/huggingface_hub/file_download.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1562,7 +1562,7 @@ def try_to_load_from_cache(
15621562
def get_hf_file_metadata(
15631563
url: str,
15641564
token: Union[bool, str, None] = None,
1565-
timeout: Optional[float] = constants.DEFAULT_REQUEST_TIMEOUT,
1565+
timeout: Optional[float] = constants.HF_HUB_ETAG_TIMEOUT,
15661566
library_name: Optional[str] = None,
15671567
library_version: Optional[str] = None,
15681568
user_agent: Union[dict, str, None] = None,

src/huggingface_hub/hf_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5243,7 +5243,7 @@ def get_hf_file_metadata(
52435243
*,
52445244
url: str,
52455245
token: Union[bool, str, None] = None,
5246-
timeout: Optional[float] = constants.DEFAULT_REQUEST_TIMEOUT,
5246+
timeout: Optional[float] = constants.HF_HUB_ETAG_TIMEOUT,
52475247
) -> HfFileMetadata:
52485248
"""Fetch metadata of a file versioned on the Hub for a given url.
52495249

0 commit comments

Comments
 (0)