huggingface-hub 0.35.0rc1__py3-none-any.whl → 0.35.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of huggingface-hub might be problematic. Click here for more details.
- huggingface_hub/__init__.py +1 -1
- huggingface_hub/dataclasses.py +3 -0
- huggingface_hub/file_download.py +2 -2
- huggingface_hub/hf_file_system.py +1 -9
- huggingface_hub/lfs.py +2 -4
- huggingface_hub/utils/_http.py +3 -5
- {huggingface_hub-0.35.0rc1.dist-info → huggingface_hub-0.35.1.dist-info}/METADATA +1 -1
- {huggingface_hub-0.35.0rc1.dist-info → huggingface_hub-0.35.1.dist-info}/RECORD +12 -12
- {huggingface_hub-0.35.0rc1.dist-info → huggingface_hub-0.35.1.dist-info}/LICENSE +0 -0
- {huggingface_hub-0.35.0rc1.dist-info → huggingface_hub-0.35.1.dist-info}/WHEEL +0 -0
- {huggingface_hub-0.35.0rc1.dist-info → huggingface_hub-0.35.1.dist-info}/entry_points.txt +0 -0
- {huggingface_hub-0.35.0rc1.dist-info → huggingface_hub-0.35.1.dist-info}/top_level.txt +0 -0
huggingface_hub/__init__.py
CHANGED
huggingface_hub/dataclasses.py
CHANGED
|
@@ -5,6 +5,7 @@ from typing import (
|
|
|
5
5
|
Any,
|
|
6
6
|
Callable,
|
|
7
7
|
Dict,
|
|
8
|
+
ForwardRef,
|
|
8
9
|
List,
|
|
9
10
|
Literal,
|
|
10
11
|
Optional,
|
|
@@ -325,6 +326,8 @@ def type_validator(name: str, value: Any, expected_type: Any) -> None:
|
|
|
325
326
|
validator(name, value, args)
|
|
326
327
|
elif isinstance(expected_type, type): # simple types
|
|
327
328
|
_validate_simple_type(name, value, expected_type)
|
|
329
|
+
elif isinstance(expected_type, ForwardRef) or isinstance(expected_type, str):
|
|
330
|
+
return
|
|
328
331
|
else:
|
|
329
332
|
raise TypeError(f"Unsupported type for field '{name}': {expected_type}")
|
|
330
333
|
|
huggingface_hub/file_download.py
CHANGED
|
@@ -267,7 +267,7 @@ def _request_wrapper(
|
|
|
267
267
|
"""Wrapper around requests methods to follow relative redirects if `follow_relative_redirects=True` even when
|
|
268
268
|
`allow_redirection=False`.
|
|
269
269
|
|
|
270
|
-
A backoff mechanism retries the HTTP call on
|
|
270
|
+
A backoff mechanism retries the HTTP call on 5xx errors and network errors.
|
|
271
271
|
|
|
272
272
|
Args:
|
|
273
273
|
method (`str`):
|
|
@@ -306,7 +306,7 @@ def _request_wrapper(
|
|
|
306
306
|
return response
|
|
307
307
|
|
|
308
308
|
# Perform request and return if status_code is not in the retry list.
|
|
309
|
-
response = http_backoff(method=method, url=url, **params
|
|
309
|
+
response = http_backoff(method=method, url=url, **params)
|
|
310
310
|
hf_raise_for_status(response)
|
|
311
311
|
return response
|
|
312
312
|
|
|
@@ -958,13 +958,7 @@ class HfFileSystemFile(fsspec.spec.AbstractBufferedFile):
|
|
|
958
958
|
repo_type=self.resolved_path.repo_type,
|
|
959
959
|
endpoint=self.fs.endpoint,
|
|
960
960
|
)
|
|
961
|
-
r = http_backoff(
|
|
962
|
-
"GET",
|
|
963
|
-
url,
|
|
964
|
-
headers=headers,
|
|
965
|
-
retry_on_status_codes=(500, 502, 503, 504),
|
|
966
|
-
timeout=constants.HF_HUB_DOWNLOAD_TIMEOUT,
|
|
967
|
-
)
|
|
961
|
+
r = http_backoff("GET", url, headers=headers, timeout=constants.HF_HUB_DOWNLOAD_TIMEOUT)
|
|
968
962
|
hf_raise_for_status(r)
|
|
969
963
|
return r.content
|
|
970
964
|
|
|
@@ -1063,7 +1057,6 @@ class HfFileSystemStreamFile(fsspec.spec.AbstractBufferedFile):
|
|
|
1063
1057
|
"GET",
|
|
1064
1058
|
url,
|
|
1065
1059
|
headers=self.fs._api._build_hf_headers(),
|
|
1066
|
-
retry_on_status_codes=(500, 502, 503, 504),
|
|
1067
1060
|
stream=True,
|
|
1068
1061
|
timeout=constants.HF_HUB_DOWNLOAD_TIMEOUT,
|
|
1069
1062
|
)
|
|
@@ -1086,7 +1079,6 @@ class HfFileSystemStreamFile(fsspec.spec.AbstractBufferedFile):
|
|
|
1086
1079
|
"GET",
|
|
1087
1080
|
url,
|
|
1088
1081
|
headers={"Range": "bytes=%d-" % self.loc, **self.fs._api._build_hf_headers()},
|
|
1089
|
-
retry_on_status_codes=(500, 502, 503, 504),
|
|
1090
1082
|
stream=True,
|
|
1091
1083
|
timeout=constants.HF_HUB_DOWNLOAD_TIMEOUT,
|
|
1092
1084
|
)
|
huggingface_hub/lfs.py
CHANGED
|
@@ -316,7 +316,7 @@ def _upload_single_part(operation: "CommitOperationAdd", upload_url: str) -> Non
|
|
|
316
316
|
"""
|
|
317
317
|
with operation.as_file(with_tqdm=True) as fileobj:
|
|
318
318
|
# S3 might raise a transient 500 error -> let's retry if that happens
|
|
319
|
-
response = http_backoff("PUT", upload_url, data=fileobj
|
|
319
|
+
response = http_backoff("PUT", upload_url, data=fileobj)
|
|
320
320
|
hf_raise_for_status(response)
|
|
321
321
|
|
|
322
322
|
|
|
@@ -400,9 +400,7 @@ def _upload_parts_iteratively(
|
|
|
400
400
|
read_limit=chunk_size,
|
|
401
401
|
) as fileobj_slice:
|
|
402
402
|
# S3 might raise a transient 500 error -> let's retry if that happens
|
|
403
|
-
part_upload_res = http_backoff(
|
|
404
|
-
"PUT", part_upload_url, data=fileobj_slice, retry_on_status_codes=(500, 502, 503, 504)
|
|
405
|
-
)
|
|
403
|
+
part_upload_res = http_backoff("PUT", part_upload_url, data=fileobj_slice)
|
|
406
404
|
hf_raise_for_status(part_upload_res)
|
|
407
405
|
headers.append(part_upload_res.headers)
|
|
408
406
|
return headers # type: ignore
|
huggingface_hub/utils/_http.py
CHANGED
|
@@ -21,7 +21,6 @@ import threading
|
|
|
21
21
|
import time
|
|
22
22
|
import uuid
|
|
23
23
|
from functools import lru_cache
|
|
24
|
-
from http import HTTPStatus
|
|
25
24
|
from shlex import quote
|
|
26
25
|
from typing import Any, Callable, List, Optional, Tuple, Type, Union
|
|
27
26
|
|
|
@@ -221,7 +220,7 @@ def http_backoff(
|
|
|
221
220
|
requests.Timeout,
|
|
222
221
|
requests.ConnectionError,
|
|
223
222
|
),
|
|
224
|
-
retry_on_status_codes: Union[int, Tuple[int, ...]] =
|
|
223
|
+
retry_on_status_codes: Union[int, Tuple[int, ...]] = (500, 502, 503, 504),
|
|
225
224
|
**kwargs,
|
|
226
225
|
) -> Response:
|
|
227
226
|
"""Wrapper around requests to retry calls on an endpoint, with exponential backoff.
|
|
@@ -250,9 +249,8 @@ def http_backoff(
|
|
|
250
249
|
retry_on_exceptions (`Type[Exception]` or `Tuple[Type[Exception]]`, *optional*):
|
|
251
250
|
Define which exceptions must be caught to retry the request. Can be a single type or a tuple of types.
|
|
252
251
|
By default, retry on `requests.Timeout` and `requests.ConnectionError`.
|
|
253
|
-
retry_on_status_codes (`int` or `Tuple[int]`, *optional*, defaults to `503`):
|
|
254
|
-
Define on which status codes the request must be retried. By default,
|
|
255
|
-
HTTP 503 Service Unavailable is retried.
|
|
252
|
+
retry_on_status_codes (`int` or `Tuple[int]`, *optional*, defaults to `(500, 502, 503, 504)`):
|
|
253
|
+
Define on which status codes the request must be retried. By default, 5xx errors are retried.
|
|
256
254
|
**kwargs (`dict`, *optional*):
|
|
257
255
|
kwargs to pass to `requests.request`.
|
|
258
256
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: huggingface-hub
|
|
3
|
-
Version: 0.35.
|
|
3
|
+
Version: 0.35.1
|
|
4
4
|
Summary: Client library to download and publish models, datasets and other repos on the huggingface.co hub
|
|
5
5
|
Home-page: https://github.com/huggingface/huggingface_hub
|
|
6
6
|
Author: Hugging Face, Inc.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
huggingface_hub/__init__.py,sha256=
|
|
1
|
+
huggingface_hub/__init__.py,sha256=WwTfh8zb0XfDNzSuZD_Zb2C-UHx2jEidwqNNmB3QwcY,52476
|
|
2
2
|
huggingface_hub/_commit_api.py,sha256=68HxFnJE2s-QmGZRHQav5kOMTseYV_ZQi04ADaQmZUk,38979
|
|
3
3
|
huggingface_hub/_commit_scheduler.py,sha256=tfIoO1xWHjTJ6qy6VS6HIoymDycFPg0d6pBSZprrU2U,14679
|
|
4
4
|
huggingface_hub/_inference_endpoints.py,sha256=ahmbPcEXsJ_JcMb9TDgdkD8Z2z9uytkFG3_1o6dTm8g,17598
|
|
@@ -14,16 +14,16 @@ huggingface_hub/_webhooks_payload.py,sha256=Xm3KaK7tCOGBlXkuZvbym6zjHXrT1XCrbUFW
|
|
|
14
14
|
huggingface_hub/_webhooks_server.py,sha256=5J63wk9MUGKBNJVsOD9i60mJ-VMp0YYmlf87vQsl-L8,15767
|
|
15
15
|
huggingface_hub/community.py,sha256=4MtcoxEI9_0lmmilBEnvUEi8_O1Ivfa8p6eKxYU5-ts,12198
|
|
16
16
|
huggingface_hub/constants.py,sha256=nILseAp4rqLu_KQTZDpPGOhepVAPanD7azbomAvovj0,10313
|
|
17
|
-
huggingface_hub/dataclasses.py,sha256=
|
|
17
|
+
huggingface_hub/dataclasses.py,sha256=rjQfuX9MeTXZQrCQC8JvkjpARDehOiSluE7Kz1L7Ueg,17337
|
|
18
18
|
huggingface_hub/errors.py,sha256=D7Lw0Jjrf8vfmD0B26LEvg-JWkU8Zq0KDPJOzFY4QLw,11201
|
|
19
19
|
huggingface_hub/fastai_utils.py,sha256=DpeH9d-6ut2k_nCAAwglM51XmRmgfbRe2SPifpVL5Yk,16745
|
|
20
|
-
huggingface_hub/file_download.py,sha256=
|
|
20
|
+
huggingface_hub/file_download.py,sha256=ohaAp9WR4PghMew2KEFlnRVhrvCiBYxs5I5wKOSw0e0,78926
|
|
21
21
|
huggingface_hub/hf_api.py,sha256=Y0rA53vl0pz8SvRMBDKGuaM3ehUVfyCAa9m5ByNE830,483625
|
|
22
|
-
huggingface_hub/hf_file_system.py,sha256=
|
|
22
|
+
huggingface_hub/hf_file_system.py,sha256=h-ZN-JGtdXfZiQXaNQWEWIkFtKtSKHdndIp_Lh72JdA,46798
|
|
23
23
|
huggingface_hub/hub_mixin.py,sha256=Ii3w9o7XgGbj6UNPnieW5IDfaCd8OEKpIH1hRkncRDQ,38208
|
|
24
24
|
huggingface_hub/inference_api.py,sha256=b4-NhPSn9b44nYKV8tDKXodmE4JVdEymMWL4CVGkzlE,8323
|
|
25
25
|
huggingface_hub/keras_mixin.py,sha256=WGNQZROdw6yjJ1DGTPZPwKAxf1UbkzAx1dRidkeb2fk,19553
|
|
26
|
-
huggingface_hub/lfs.py,sha256=
|
|
26
|
+
huggingface_hub/lfs.py,sha256=iSwoSDMN1AtiLP9DWz_ht8gx6ZDt2PbSC_0Yd166DF4,16523
|
|
27
27
|
huggingface_hub/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
28
28
|
huggingface_hub/repocard.py,sha256=1gask5OzfyJDvnXBMRm49VT0SCiIspCYUukSOGNafHE,34857
|
|
29
29
|
huggingface_hub/repocard_data.py,sha256=hr4ReFpEQMNdh_9Dx-L-IJoI1ElHyk-h-8ZRqwVYYOE,34082
|
|
@@ -143,7 +143,7 @@ huggingface_hub/utils/_fixes.py,sha256=xQV1QkUn2WpLqLjtXNiyn9gh-454K6AF-Q3kwkYAQ
|
|
|
143
143
|
huggingface_hub/utils/_git_credential.py,sha256=ao9rq-rVHn8lghSVZEjDAX4kIkNi7bayY361TDSgSpg,4619
|
|
144
144
|
huggingface_hub/utils/_headers.py,sha256=w4ayq4hLGaZ3B7nwdEi5Zu23SmmDuOwv58It78wkakk,8868
|
|
145
145
|
huggingface_hub/utils/_hf_folder.py,sha256=WNjTnu0Q7tqcSS9EsP4ssCJrrJMcCvAt8P_-LEtmOU8,2487
|
|
146
|
-
huggingface_hub/utils/_http.py,sha256=
|
|
146
|
+
huggingface_hub/utils/_http.py,sha256=nPgPzM0ujKjl9v3g8XZ0zGMC_B9eqWvf2Zsr3t7X1jA,25476
|
|
147
147
|
huggingface_hub/utils/_lfs.py,sha256=EC0Oz6Wiwl8foRNkUOzrETXzAWlbgpnpxo5a410ovFY,3957
|
|
148
148
|
huggingface_hub/utils/_pagination.py,sha256=EX5tRasSuQDaKbXuGYbInBK2odnSWNHgzw2tSgqeBRI,1906
|
|
149
149
|
huggingface_hub/utils/_paths.py,sha256=w1ZhFmmD5ykWjp_hAvhjtOoa2ZUcOXJrF4a6O3QpAWo,5042
|
|
@@ -160,9 +160,9 @@ huggingface_hub/utils/insecure_hashlib.py,sha256=iAaepavFZ5Dhfa5n8KozRfQprKmvcjS
|
|
|
160
160
|
huggingface_hub/utils/logging.py,sha256=0A8fF1yh3L9Ka_bCDX2ml4U5Ht0tY8Dr3JcbRvWFuwo,4909
|
|
161
161
|
huggingface_hub/utils/sha.py,sha256=OFnNGCba0sNcT2gUwaVCJnldxlltrHHe0DS_PCpV3C4,2134
|
|
162
162
|
huggingface_hub/utils/tqdm.py,sha256=xAKcyfnNHsZ7L09WuEM5Ew5-MDhiahLACbbN2zMmcLs,10671
|
|
163
|
-
huggingface_hub-0.35.
|
|
164
|
-
huggingface_hub-0.35.
|
|
165
|
-
huggingface_hub-0.35.
|
|
166
|
-
huggingface_hub-0.35.
|
|
167
|
-
huggingface_hub-0.35.
|
|
168
|
-
huggingface_hub-0.35.
|
|
163
|
+
huggingface_hub-0.35.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
164
|
+
huggingface_hub-0.35.1.dist-info/METADATA,sha256=DIJWsqgWnRM2pgGuMUEjfzUS6xBnEasjwIvUakgD-gE,14820
|
|
165
|
+
huggingface_hub-0.35.1.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
166
|
+
huggingface_hub-0.35.1.dist-info/entry_points.txt,sha256=HIzLhjwPTO7U_ncpW4AkmzAuaadr1ajmYagW5mdb5TM,217
|
|
167
|
+
huggingface_hub-0.35.1.dist-info/top_level.txt,sha256=8KzlQJAY4miUvjAssOAJodqKOw3harNzuiwGQ9qLSSk,16
|
|
168
|
+
huggingface_hub-0.35.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|