huggingface-hub 1.0.0rc5__py3-none-any.whl → 1.0.0rc7__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 +12 -1
- huggingface_hub/_commit_api.py +1 -5
- huggingface_hub/_jobs_api.py +1 -1
- huggingface_hub/_login.py +3 -3
- huggingface_hub/_snapshot_download.py +4 -3
- huggingface_hub/_upload_large_folder.py +2 -15
- huggingface_hub/_webhooks_server.py +1 -1
- huggingface_hub/cli/_cli_utils.py +1 -1
- huggingface_hub/cli/auth.py +0 -20
- huggingface_hub/cli/cache.py +561 -304
- huggingface_hub/cli/download.py +2 -2
- huggingface_hub/cli/repo.py +0 -7
- huggingface_hub/cli/upload.py +0 -8
- huggingface_hub/community.py +16 -8
- huggingface_hub/constants.py +10 -11
- huggingface_hub/file_download.py +9 -61
- huggingface_hub/hf_api.py +170 -126
- huggingface_hub/hf_file_system.py +31 -6
- huggingface_hub/inference/_client.py +1 -1
- huggingface_hub/inference/_generated/_async_client.py +1 -1
- huggingface_hub/inference/_providers/__init__.py +15 -2
- huggingface_hub/inference/_providers/_common.py +39 -0
- huggingface_hub/inference/_providers/clarifai.py +13 -0
- huggingface_hub/lfs.py +3 -65
- huggingface_hub/serialization/_torch.py +1 -1
- huggingface_hub/utils/__init__.py +0 -2
- huggingface_hub/utils/_cache_manager.py +17 -42
- huggingface_hub/utils/_http.py +25 -3
- huggingface_hub/utils/_parsing.py +98 -0
- huggingface_hub/utils/_runtime.py +1 -14
- {huggingface_hub-1.0.0rc5.dist-info → huggingface_hub-1.0.0rc7.dist-info}/METADATA +4 -14
- {huggingface_hub-1.0.0rc5.dist-info → huggingface_hub-1.0.0rc7.dist-info}/RECORD +36 -34
- {huggingface_hub-1.0.0rc5.dist-info → huggingface_hub-1.0.0rc7.dist-info}/LICENSE +0 -0
- {huggingface_hub-1.0.0rc5.dist-info → huggingface_hub-1.0.0rc7.dist-info}/WHEEL +0 -0
- {huggingface_hub-1.0.0rc5.dist-info → huggingface_hub-1.0.0rc7.dist-info}/entry_points.txt +0 -0
- {huggingface_hub-1.0.0rc5.dist-info → huggingface_hub-1.0.0rc7.dist-info}/top_level.txt +0 -0
huggingface_hub/hf_api.py
CHANGED
|
@@ -145,7 +145,6 @@ ExpandModelProperty_T = Literal[
|
|
|
145
145
|
"trendingScore",
|
|
146
146
|
"usedStorage",
|
|
147
147
|
"widgetData",
|
|
148
|
-
"xetEnabled",
|
|
149
148
|
]
|
|
150
149
|
|
|
151
150
|
ExpandDatasetProperty_T = Literal[
|
|
@@ -168,7 +167,6 @@ ExpandDatasetProperty_T = Literal[
|
|
|
168
167
|
"tags",
|
|
169
168
|
"trendingScore",
|
|
170
169
|
"usedStorage",
|
|
171
|
-
"xetEnabled",
|
|
172
170
|
]
|
|
173
171
|
|
|
174
172
|
ExpandSpaceProperty_T = Literal[
|
|
@@ -190,7 +188,6 @@ ExpandSpaceProperty_T = Literal[
|
|
|
190
188
|
"tags",
|
|
191
189
|
"trendingScore",
|
|
192
190
|
"usedStorage",
|
|
193
|
-
"xetEnabled",
|
|
194
191
|
]
|
|
195
192
|
|
|
196
193
|
USERNAME_PLACEHOLDER = "hf_user"
|
|
@@ -801,7 +798,6 @@ class ModelInfo:
|
|
|
801
798
|
spaces: Optional[list[str]]
|
|
802
799
|
safetensors: Optional[SafeTensorsInfo]
|
|
803
800
|
security_repo_status: Optional[dict]
|
|
804
|
-
xet_enabled: Optional[bool]
|
|
805
801
|
|
|
806
802
|
def __init__(self, **kwargs):
|
|
807
803
|
self.id = kwargs.pop("id")
|
|
@@ -889,7 +885,6 @@ class ModelInfo:
|
|
|
889
885
|
else None
|
|
890
886
|
)
|
|
891
887
|
self.security_repo_status = kwargs.pop("securityRepoStatus", None)
|
|
892
|
-
self.xet_enabled = kwargs.pop("xetEnabled", None)
|
|
893
888
|
# backwards compatibility
|
|
894
889
|
self.lastModified = self.last_modified
|
|
895
890
|
self.cardData = self.card_data
|
|
@@ -960,7 +955,6 @@ class DatasetInfo:
|
|
|
960
955
|
trending_score: Optional[int]
|
|
961
956
|
card_data: Optional[DatasetCardData]
|
|
962
957
|
siblings: Optional[list[RepoSibling]]
|
|
963
|
-
xet_enabled: Optional[bool]
|
|
964
958
|
|
|
965
959
|
def __init__(self, **kwargs):
|
|
966
960
|
self.id = kwargs.pop("id")
|
|
@@ -1006,7 +1000,6 @@ class DatasetInfo:
|
|
|
1006
1000
|
if siblings is not None
|
|
1007
1001
|
else None
|
|
1008
1002
|
)
|
|
1009
|
-
self.xet_enabled = kwargs.pop("xetEnabled", None)
|
|
1010
1003
|
# backwards compatibility
|
|
1011
1004
|
self.lastModified = self.last_modified
|
|
1012
1005
|
self.cardData = self.card_data
|
|
@@ -1085,7 +1078,6 @@ class SpaceInfo:
|
|
|
1085
1078
|
runtime: Optional[SpaceRuntime]
|
|
1086
1079
|
models: Optional[list[str]]
|
|
1087
1080
|
datasets: Optional[list[str]]
|
|
1088
|
-
xet_enabled: Optional[bool]
|
|
1089
1081
|
|
|
1090
1082
|
def __init__(self, **kwargs):
|
|
1091
1083
|
self.id = kwargs.pop("id")
|
|
@@ -1134,7 +1126,6 @@ class SpaceInfo:
|
|
|
1134
1126
|
self.runtime = SpaceRuntime(runtime) if runtime else None
|
|
1135
1127
|
self.models = kwargs.pop("models", None)
|
|
1136
1128
|
self.datasets = kwargs.pop("datasets", None)
|
|
1137
|
-
self.xet_enabled = kwargs.pop("xetEnabled", None)
|
|
1138
1129
|
# backwards compatibility
|
|
1139
1130
|
self.lastModified = self.last_modified
|
|
1140
1131
|
self.cardData = self.card_data
|
|
@@ -1367,16 +1358,48 @@ class Organization:
|
|
|
1367
1358
|
Name of the organization on the Hub (unique).
|
|
1368
1359
|
fullname (`str`):
|
|
1369
1360
|
Organization's full name.
|
|
1361
|
+
details (`str`, *optional*):
|
|
1362
|
+
Organization's description.
|
|
1363
|
+
is_verified (`bool`, *optional*):
|
|
1364
|
+
Whether the organization is verified.
|
|
1365
|
+
is_following (`bool`, *optional*):
|
|
1366
|
+
Whether the authenticated user follows this organization.
|
|
1367
|
+
num_users (`int`, *optional*):
|
|
1368
|
+
Number of members in the organization.
|
|
1369
|
+
num_models (`int`, *optional*):
|
|
1370
|
+
Number of models owned by the organization.
|
|
1371
|
+
num_spaces (`int`, *optional*):
|
|
1372
|
+
Number of Spaces owned by the organization.
|
|
1373
|
+
num_datasets (`int`, *optional*):
|
|
1374
|
+
Number of datasets owned by the organization.
|
|
1375
|
+
num_followers (`int`, *optional*):
|
|
1376
|
+
Number of followers of the organization.
|
|
1370
1377
|
"""
|
|
1371
1378
|
|
|
1372
1379
|
avatar_url: str
|
|
1373
1380
|
name: str
|
|
1374
1381
|
fullname: str
|
|
1382
|
+
details: Optional[str] = None
|
|
1383
|
+
is_verified: Optional[bool] = None
|
|
1384
|
+
is_following: Optional[bool] = None
|
|
1385
|
+
num_users: Optional[int] = None
|
|
1386
|
+
num_models: Optional[int] = None
|
|
1387
|
+
num_spaces: Optional[int] = None
|
|
1388
|
+
num_datasets: Optional[int] = None
|
|
1389
|
+
num_followers: Optional[int] = None
|
|
1375
1390
|
|
|
1376
1391
|
def __init__(self, **kwargs) -> None:
|
|
1377
1392
|
self.avatar_url = kwargs.pop("avatarUrl", "")
|
|
1378
1393
|
self.name = kwargs.pop("name", "")
|
|
1379
1394
|
self.fullname = kwargs.pop("fullname", "")
|
|
1395
|
+
self.details = kwargs.pop("details", None)
|
|
1396
|
+
self.is_verified = kwargs.pop("isVerified", None)
|
|
1397
|
+
self.is_following = kwargs.pop("isFollowing", None)
|
|
1398
|
+
self.num_users = kwargs.pop("numUsers", None)
|
|
1399
|
+
self.num_models = kwargs.pop("numModels", None)
|
|
1400
|
+
self.num_spaces = kwargs.pop("numSpaces", None)
|
|
1401
|
+
self.num_datasets = kwargs.pop("numDatasets", None)
|
|
1402
|
+
self.num_followers = kwargs.pop("numFollowers", None)
|
|
1380
1403
|
|
|
1381
1404
|
# forward compatibility
|
|
1382
1405
|
self.__dict__.update(**kwargs)
|
|
@@ -1633,7 +1656,7 @@ class HfApi:
|
|
|
1633
1656
|
Args:
|
|
1634
1657
|
endpoint (`str`, *optional*):
|
|
1635
1658
|
Endpoint of the Hub. Defaults to <https://huggingface.co>.
|
|
1636
|
-
token (
|
|
1659
|
+
token (`bool` or `str`, *optional*):
|
|
1637
1660
|
A valid user access token (string). Defaults to the locally saved
|
|
1638
1661
|
token, which is the recommended method for authentication (see
|
|
1639
1662
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -1715,7 +1738,7 @@ class HfApi:
|
|
|
1715
1738
|
Call HF API to know "whoami".
|
|
1716
1739
|
|
|
1717
1740
|
Args:
|
|
1718
|
-
token (
|
|
1741
|
+
token (`bool` or `str`, *optional*):
|
|
1719
1742
|
A valid user access token (string). Defaults to the locally saved
|
|
1720
1743
|
token, which is the recommended method for authentication (see
|
|
1721
1744
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -1838,7 +1861,7 @@ class HfApi:
|
|
|
1838
1861
|
expand (`list[ExpandModelProperty_T]`, *optional*):
|
|
1839
1862
|
List properties to return in the response. When used, only the properties in the list will be returned.
|
|
1840
1863
|
This parameter cannot be used if `full`, `cardData` or `fetch_config` are passed.
|
|
1841
|
-
Possible values are `"author"`, `"cardData"`, `"config"`, `"createdAt"`, `"disabled"`, `"downloads"`, `"downloadsAllTime"`, `"gated"`, `"gguf"`, `"inference"`, `"inferenceProviderMapping"`, `"lastModified"`, `"library_name"`, `"likes"`, `"mask_token"`, `"model-index"`, `"pipeline_tag"`, `"private"`, `"safetensors"`, `"sha"`, `"siblings"`, `"spaces"`, `"tags"`, `"transformersInfo"`, `"trendingScore"`, `"widgetData"`,
|
|
1864
|
+
Possible values are `"author"`, `"cardData"`, `"config"`, `"createdAt"`, `"disabled"`, `"downloads"`, `"downloadsAllTime"`, `"gated"`, `"gguf"`, `"inference"`, `"inferenceProviderMapping"`, `"lastModified"`, `"library_name"`, `"likes"`, `"mask_token"`, `"model-index"`, `"pipeline_tag"`, `"private"`, `"safetensors"`, `"sha"`, `"siblings"`, `"spaces"`, `"tags"`, `"transformersInfo"`, `"trendingScore"`, `"widgetData"`, and `"resourceGroup"`.
|
|
1842
1865
|
full (`bool`, *optional*):
|
|
1843
1866
|
Whether to fetch all model data, including the `last_modified`,
|
|
1844
1867
|
the `sha`, the files and the `tags`. This is set to `True` by
|
|
@@ -1850,7 +1873,7 @@ class HfApi:
|
|
|
1850
1873
|
fetch_config (`bool`, *optional*):
|
|
1851
1874
|
Whether to fetch the model configs as well. This is not included
|
|
1852
1875
|
in `full` due to its size.
|
|
1853
|
-
token (
|
|
1876
|
+
token (`bool` or `str`, *optional*):
|
|
1854
1877
|
A valid user access token (string). Defaults to the locally saved
|
|
1855
1878
|
token, which is the recommended method for authentication (see
|
|
1856
1879
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -2049,12 +2072,12 @@ class HfApi:
|
|
|
2049
2072
|
expand (`list[ExpandDatasetProperty_T]`, *optional*):
|
|
2050
2073
|
List properties to return in the response. When used, only the properties in the list will be returned.
|
|
2051
2074
|
This parameter cannot be used if `full` is passed.
|
|
2052
|
-
Possible values are `"author"`, `"cardData"`, `"citation"`, `"createdAt"`, `"disabled"`, `"description"`, `"downloads"`, `"downloadsAllTime"`, `"gated"`, `"lastModified"`, `"likes"`, `"paperswithcode_id"`, `"private"`, `"siblings"`, `"sha"`, `"tags"`, `"trendingScore"`, `"usedStorage"`,
|
|
2075
|
+
Possible values are `"author"`, `"cardData"`, `"citation"`, `"createdAt"`, `"disabled"`, `"description"`, `"downloads"`, `"downloadsAllTime"`, `"gated"`, `"lastModified"`, `"likes"`, `"paperswithcode_id"`, `"private"`, `"siblings"`, `"sha"`, `"tags"`, `"trendingScore"`, `"usedStorage"`, and `"resourceGroup"`.
|
|
2053
2076
|
full (`bool`, *optional*):
|
|
2054
2077
|
Whether to fetch all dataset data, including the `last_modified`,
|
|
2055
2078
|
the `card_data` and the files. Can contain useful information such as the
|
|
2056
2079
|
PapersWithCode ID.
|
|
2057
|
-
token (
|
|
2080
|
+
token (`bool` or `str`, *optional*):
|
|
2058
2081
|
A valid user access token (string). Defaults to the locally saved
|
|
2059
2082
|
token, which is the recommended method for authentication (see
|
|
2060
2083
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -2227,11 +2250,11 @@ class HfApi:
|
|
|
2227
2250
|
expand (`list[ExpandSpaceProperty_T]`, *optional*):
|
|
2228
2251
|
List properties to return in the response. When used, only the properties in the list will be returned.
|
|
2229
2252
|
This parameter cannot be used if `full` is passed.
|
|
2230
|
-
Possible values are `"author"`, `"cardData"`, `"datasets"`, `"disabled"`, `"lastModified"`, `"createdAt"`, `"likes"`, `"models"`, `"private"`, `"runtime"`, `"sdk"`, `"siblings"`, `"sha"`, `"subdomain"`, `"tags"`, `"trendingScore"`, `"usedStorage"`,
|
|
2253
|
+
Possible values are `"author"`, `"cardData"`, `"datasets"`, `"disabled"`, `"lastModified"`, `"createdAt"`, `"likes"`, `"models"`, `"private"`, `"runtime"`, `"sdk"`, `"siblings"`, `"sha"`, `"subdomain"`, `"tags"`, `"trendingScore"`, `"usedStorage"`, and `"resourceGroup"`.
|
|
2231
2254
|
full (`bool`, *optional*):
|
|
2232
2255
|
Whether to fetch all Spaces data, including the `last_modified`, `siblings`
|
|
2233
2256
|
and `card_data` fields.
|
|
2234
|
-
token (
|
|
2257
|
+
token (`bool` or `str`, *optional*):
|
|
2235
2258
|
A valid user access token (string). Defaults to the locally saved
|
|
2236
2259
|
token, which is the recommended method for authentication (see
|
|
2237
2260
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -2306,7 +2329,7 @@ class HfApi:
|
|
|
2306
2329
|
repo_id (`str`):
|
|
2307
2330
|
The repository to unlike. Example: `"user/my-cool-model"`.
|
|
2308
2331
|
|
|
2309
|
-
token (
|
|
2332
|
+
token (`bool` or `str`, *optional*):
|
|
2310
2333
|
A valid user access token (string). Defaults to the locally saved
|
|
2311
2334
|
token, which is the recommended method for authentication (see
|
|
2312
2335
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -2356,7 +2379,7 @@ class HfApi:
|
|
|
2356
2379
|
Args:
|
|
2357
2380
|
user (`str`, *optional*):
|
|
2358
2381
|
Name of the user for which you want to fetch the likes.
|
|
2359
|
-
token (
|
|
2382
|
+
token (`bool` or `str`, *optional*):
|
|
2360
2383
|
A valid user access token (string). Defaults to the locally saved
|
|
2361
2384
|
token, which is the recommended method for authentication (see
|
|
2362
2385
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -2431,7 +2454,7 @@ class HfApi:
|
|
|
2431
2454
|
repo_id (`str`):
|
|
2432
2455
|
The repository to retrieve . Example: `"user/my-cool-model"`.
|
|
2433
2456
|
|
|
2434
|
-
token (
|
|
2457
|
+
token (`bool` or `str`, *optional*):
|
|
2435
2458
|
A valid user access token (string). Defaults to the locally saved
|
|
2436
2459
|
token, which is the recommended method for authentication (see
|
|
2437
2460
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -2488,8 +2511,8 @@ class HfApi:
|
|
|
2488
2511
|
expand (`list[ExpandModelProperty_T]`, *optional*):
|
|
2489
2512
|
List properties to return in the response. When used, only the properties in the list will be returned.
|
|
2490
2513
|
This parameter cannot be used if `securityStatus` or `files_metadata` are passed.
|
|
2491
|
-
Possible values are `"author"`, `"baseModels"`, `"cardData"`, `"childrenModelCount"`, `"config"`, `"createdAt"`, `"disabled"`, `"downloads"`, `"downloadsAllTime"`, `"gated"`, `"gguf"`, `"inference"`, `"inferenceProviderMapping"`, `"lastModified"`, `"library_name"`, `"likes"`, `"mask_token"`, `"model-index"`, `"pipeline_tag"`, `"private"`, `"safetensors"`, `"sha"`, `"siblings"`, `"spaces"`, `"tags"`, `"transformersInfo"`, `"trendingScore"`, `"widgetData"`, `"usedStorage"`,
|
|
2492
|
-
token (
|
|
2514
|
+
Possible values are `"author"`, `"baseModels"`, `"cardData"`, `"childrenModelCount"`, `"config"`, `"createdAt"`, `"disabled"`, `"downloads"`, `"downloadsAllTime"`, `"gated"`, `"gguf"`, `"inference"`, `"inferenceProviderMapping"`, `"lastModified"`, `"library_name"`, `"likes"`, `"mask_token"`, `"model-index"`, `"pipeline_tag"`, `"private"`, `"safetensors"`, `"sha"`, `"siblings"`, `"spaces"`, `"tags"`, `"transformersInfo"`, `"trendingScore"`, `"widgetData"`, `"usedStorage"`, and `"resourceGroup"`.
|
|
2515
|
+
token (`bool` or `str`, *optional*):
|
|
2493
2516
|
A valid user access token (string). Defaults to the locally saved
|
|
2494
2517
|
token, which is the recommended method for authentication (see
|
|
2495
2518
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -2559,8 +2582,8 @@ class HfApi:
|
|
|
2559
2582
|
expand (`list[ExpandDatasetProperty_T]`, *optional*):
|
|
2560
2583
|
List properties to return in the response. When used, only the properties in the list will be returned.
|
|
2561
2584
|
This parameter cannot be used if `files_metadata` is passed.
|
|
2562
|
-
Possible values are `"author"`, `"cardData"`, `"citation"`, `"createdAt"`, `"disabled"`, `"description"`, `"downloads"`, `"downloadsAllTime"`, `"gated"`, `"lastModified"`, `"likes"`, `"paperswithcode_id"`, `"private"`, `"siblings"`, `"sha"`, `"tags"`, `"trendingScore"`,`"usedStorage"`,
|
|
2563
|
-
token (
|
|
2585
|
+
Possible values are `"author"`, `"cardData"`, `"citation"`, `"createdAt"`, `"disabled"`, `"description"`, `"downloads"`, `"downloadsAllTime"`, `"gated"`, `"lastModified"`, `"likes"`, `"paperswithcode_id"`, `"private"`, `"siblings"`, `"sha"`, `"tags"`, `"trendingScore"`,`"usedStorage"`, and `"resourceGroup"`.
|
|
2586
|
+
token (`bool` or `str`, *optional*):
|
|
2564
2587
|
A valid user access token (string). Defaults to the locally saved
|
|
2565
2588
|
token, which is the recommended method for authentication (see
|
|
2566
2589
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -2629,8 +2652,8 @@ class HfApi:
|
|
|
2629
2652
|
expand (`list[ExpandSpaceProperty_T]`, *optional*):
|
|
2630
2653
|
List properties to return in the response. When used, only the properties in the list will be returned.
|
|
2631
2654
|
This parameter cannot be used if `full` is passed.
|
|
2632
|
-
Possible values are `"author"`, `"cardData"`, `"createdAt"`, `"datasets"`, `"disabled"`, `"lastModified"`, `"likes"`, `"models"`, `"private"`, `"runtime"`, `"sdk"`, `"siblings"`, `"sha"`, `"subdomain"`, `"tags"`, `"trendingScore"`, `"usedStorage"`,
|
|
2633
|
-
token (
|
|
2655
|
+
Possible values are `"author"`, `"cardData"`, `"createdAt"`, `"datasets"`, `"disabled"`, `"lastModified"`, `"likes"`, `"models"`, `"private"`, `"runtime"`, `"sdk"`, `"siblings"`, `"sha"`, `"subdomain"`, `"tags"`, `"trendingScore"`, `"usedStorage"`, and `"resourceGroup"`.
|
|
2656
|
+
token (`bool` or `str`, *optional*):
|
|
2634
2657
|
A valid user access token (string). Defaults to the locally saved
|
|
2635
2658
|
token, which is the recommended method for authentication (see
|
|
2636
2659
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -2702,7 +2725,7 @@ class HfApi:
|
|
|
2702
2725
|
files_metadata (`bool`, *optional*):
|
|
2703
2726
|
Whether or not to retrieve metadata for files in the repository
|
|
2704
2727
|
(size, LFS metadata, etc). Defaults to `False`.
|
|
2705
|
-
token (
|
|
2728
|
+
token (`bool` or `str`, *optional*):
|
|
2706
2729
|
A valid user access token (string). Defaults to the locally saved
|
|
2707
2730
|
token, which is the recommended method for authentication (see
|
|
2708
2731
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -2757,7 +2780,7 @@ class HfApi:
|
|
|
2757
2780
|
repo_type (`str`, *optional*):
|
|
2758
2781
|
Set to `"dataset"` or `"space"` if getting repository info from a dataset or a space,
|
|
2759
2782
|
`None` or `"model"` if getting repository info from a model. Default is `None`.
|
|
2760
|
-
token (
|
|
2783
|
+
token (`bool` or `str`, *optional*):
|
|
2761
2784
|
A valid user access token (string). Defaults to the locally saved
|
|
2762
2785
|
token, which is the recommended method for authentication (see
|
|
2763
2786
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -2804,7 +2827,7 @@ class HfApi:
|
|
|
2804
2827
|
repo_type (`str`, *optional*):
|
|
2805
2828
|
Set to `"dataset"` or `"space"` if getting repository info from a dataset or a space,
|
|
2806
2829
|
`None` or `"model"` if getting repository info from a model. Default is `None`.
|
|
2807
|
-
token (
|
|
2830
|
+
token (`bool` or `str`, *optional*):
|
|
2808
2831
|
A valid user access token (string). Defaults to the locally saved
|
|
2809
2832
|
token, which is the recommended method for authentication (see
|
|
2810
2833
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -2855,7 +2878,7 @@ class HfApi:
|
|
|
2855
2878
|
`None` or `"model"` if getting repository info from a model. Default is `None`.
|
|
2856
2879
|
revision (`str`, *optional*):
|
|
2857
2880
|
The revision of the repository from which to get the information. Defaults to `"main"` branch.
|
|
2858
|
-
token (
|
|
2881
|
+
token (`bool` or `str`, *optional*):
|
|
2859
2882
|
A valid user access token (string). Defaults to the locally saved
|
|
2860
2883
|
token, which is the recommended method for authentication (see
|
|
2861
2884
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -2908,7 +2931,7 @@ class HfApi:
|
|
|
2908
2931
|
repo_type (`str`, *optional*):
|
|
2909
2932
|
Set to `"dataset"` or `"space"` if uploading to a dataset or space, `None` or `"model"` if uploading to
|
|
2910
2933
|
a model. Default is `None`.
|
|
2911
|
-
token (
|
|
2934
|
+
token (`bool` or `str`, *optional*):
|
|
2912
2935
|
A valid user access token (string). Defaults to the locally saved
|
|
2913
2936
|
token, which is the recommended method for authentication (see
|
|
2914
2937
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -2958,7 +2981,7 @@ class HfApi:
|
|
|
2958
2981
|
repo_type (`str`, *optional*):
|
|
2959
2982
|
The type of the repository from which to get the tree (`"model"`, `"dataset"` or `"space"`.
|
|
2960
2983
|
Defaults to `"model"`.
|
|
2961
|
-
token (
|
|
2984
|
+
token (`bool` or `str`, *optional*):
|
|
2962
2985
|
A valid user access token (string). Defaults to the locally saved
|
|
2963
2986
|
token, which is the recommended method for authentication (see
|
|
2964
2987
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -3078,7 +3101,7 @@ class HfApi:
|
|
|
3078
3101
|
`None` or `"model"` if listing from a model. Default is `None`.
|
|
3079
3102
|
include_pull_requests (`bool`, *optional*):
|
|
3080
3103
|
Whether to include refs from pull requests in the list. Defaults to `False`.
|
|
3081
|
-
token (
|
|
3104
|
+
token (`bool` or `str`, *optional*):
|
|
3082
3105
|
A valid user access token (string). Defaults to the locally saved
|
|
3083
3106
|
token, which is the recommended method for authentication (see
|
|
3084
3107
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -3150,7 +3173,7 @@ class HfApi:
|
|
|
3150
3173
|
repo_type (`str`, *optional*):
|
|
3151
3174
|
Set to `"dataset"` or `"space"` if listing commits from a dataset or a Space, `None` or `"model"` if
|
|
3152
3175
|
listing from a model. Default is `None`.
|
|
3153
|
-
token (
|
|
3176
|
+
token (`bool` or `str`, *optional*):
|
|
3154
3177
|
A valid user access token (string). Defaults to the locally saved
|
|
3155
3178
|
token, which is the recommended method for authentication (see
|
|
3156
3179
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -3245,7 +3268,7 @@ class HfApi:
|
|
|
3245
3268
|
repo_type (`str`, *optional*):
|
|
3246
3269
|
The type of the repository from which to get the information (`"model"`, `"dataset"` or `"space"`.
|
|
3247
3270
|
Defaults to `"model"`.
|
|
3248
|
-
token (
|
|
3271
|
+
token (`bool` or `str`, *optional*):
|
|
3249
3272
|
A valid user access token (string). Defaults to the locally saved
|
|
3250
3273
|
token, which is the recommended method for authentication (see
|
|
3251
3274
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -3324,7 +3347,7 @@ class HfApi:
|
|
|
3324
3347
|
repo_type (`str`, *optional*):
|
|
3325
3348
|
Set to `"dataset"` or `"space"` if listing commits from a dataset or a Space, `None` or `"model"` if
|
|
3326
3349
|
listing from a model. Default is `None`.
|
|
3327
|
-
token (
|
|
3350
|
+
token (`bool` or `str`, *optional*):
|
|
3328
3351
|
A valid user access token (string). Defaults to the locally saved
|
|
3329
3352
|
token, which is the recommended method for authentication (see
|
|
3330
3353
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -3393,7 +3416,7 @@ class HfApi:
|
|
|
3393
3416
|
repo_type (`str`, *optional*):
|
|
3394
3417
|
Type of repository. Set to `"dataset"` or `"space"` if listing from a dataset or space, `None` or
|
|
3395
3418
|
`"model"` if listing from a model. Default is `None`.
|
|
3396
|
-
token (
|
|
3419
|
+
token (`bool` or `str`, *optional*):
|
|
3397
3420
|
A valid user access token (string). Defaults to the locally saved
|
|
3398
3421
|
token, which is the recommended method for authentication (see
|
|
3399
3422
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -3454,7 +3477,7 @@ class HfApi:
|
|
|
3454
3477
|
repo_type (`str`, *optional*):
|
|
3455
3478
|
Type of repository. Set to `"dataset"` or `"space"` if listing from a dataset or space, `None` or
|
|
3456
3479
|
`"model"` if listing from a model. Default is `None`.
|
|
3457
|
-
token (
|
|
3480
|
+
token (`bool` or `str`, *optional*):
|
|
3458
3481
|
A valid user access token (string). Defaults to the locally saved
|
|
3459
3482
|
token, which is the recommended method for authentication (see
|
|
3460
3483
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -3517,7 +3540,7 @@ class HfApi:
|
|
|
3517
3540
|
repo_id (`str`):
|
|
3518
3541
|
A namespace (user or an organization) and a repo name separated
|
|
3519
3542
|
by a `/`.
|
|
3520
|
-
token (
|
|
3543
|
+
token (`bool` or `str`, *optional*):
|
|
3521
3544
|
A valid user access token (string). Defaults to the locally saved
|
|
3522
3545
|
token, which is the recommended method for authentication (see
|
|
3523
3546
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -3659,7 +3682,7 @@ class HfApi:
|
|
|
3659
3682
|
repo_id (`str`):
|
|
3660
3683
|
A namespace (user or an organization) and a repo name separated
|
|
3661
3684
|
by a `/`.
|
|
3662
|
-
token (
|
|
3685
|
+
token (`bool` or `str`, *optional*):
|
|
3663
3686
|
A valid user access token (string). Defaults to the locally saved
|
|
3664
3687
|
token, which is the recommended method for authentication (see
|
|
3665
3688
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -3702,7 +3725,6 @@ class HfApi:
|
|
|
3702
3725
|
private: Optional[bool] = None,
|
|
3703
3726
|
token: Union[str, bool, None] = None,
|
|
3704
3727
|
repo_type: Optional[str] = None,
|
|
3705
|
-
xet_enabled: Optional[bool] = None,
|
|
3706
3728
|
) -> None:
|
|
3707
3729
|
"""
|
|
3708
3730
|
Update the settings of a repository, including gated access and visibility.
|
|
@@ -3728,8 +3750,6 @@ class HfApi:
|
|
|
3728
3750
|
repo_type (`str`, *optional*):
|
|
3729
3751
|
The type of the repository to update settings from (`"model"`, `"dataset"` or `"space"`).
|
|
3730
3752
|
Defaults to `"model"`.
|
|
3731
|
-
xet_enabled (`bool`, *optional*):
|
|
3732
|
-
Whether the repository should be enabled for Xet Storage.
|
|
3733
3753
|
Raises:
|
|
3734
3754
|
[`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError)
|
|
3735
3755
|
If gated is not one of "auto", "manual", or False.
|
|
@@ -3758,9 +3778,6 @@ class HfApi:
|
|
|
3758
3778
|
if private is not None:
|
|
3759
3779
|
payload["private"] = private
|
|
3760
3780
|
|
|
3761
|
-
if xet_enabled is not None:
|
|
3762
|
-
payload["xetEnabled"] = xet_enabled
|
|
3763
|
-
|
|
3764
3781
|
if len(payload) == 0:
|
|
3765
3782
|
raise ValueError("At least one setting must be updated.")
|
|
3766
3783
|
|
|
@@ -3800,7 +3817,7 @@ class HfApi:
|
|
|
3800
3817
|
Set to `"dataset"` or `"space"` if uploading to a dataset or
|
|
3801
3818
|
space, `None` or `"model"` if uploading to a model. Default is
|
|
3802
3819
|
`None`.
|
|
3803
|
-
token (
|
|
3820
|
+
token (`bool` or `str`, *optional*):
|
|
3804
3821
|
A valid user access token (string). Defaults to the locally saved
|
|
3805
3822
|
token, which is the recommended method for authentication (see
|
|
3806
3823
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -3924,7 +3941,7 @@ class HfApi:
|
|
|
3924
3941
|
commit_description (`str`, *optional*):
|
|
3925
3942
|
The description of the commit that will be created
|
|
3926
3943
|
|
|
3927
|
-
token (
|
|
3944
|
+
token (`bool` or `str`, *optional*):
|
|
3928
3945
|
A valid user access token (string). Defaults to the locally saved
|
|
3929
3946
|
token, which is the recommended method for authentication (see
|
|
3930
3947
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -4193,7 +4210,7 @@ class HfApi:
|
|
|
4193
4210
|
The list of files to upload. Warning: the objects in this list will be mutated to include information
|
|
4194
4211
|
relative to the upload. Do not reuse the same objects for multiple commits.
|
|
4195
4212
|
|
|
4196
|
-
token (
|
|
4213
|
+
token (`bool` or `str`, *optional*):
|
|
4197
4214
|
A valid user access token (string). Defaults to the locally saved
|
|
4198
4215
|
token, which is the recommended method for authentication (see
|
|
4199
4216
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -4377,7 +4394,7 @@ class HfApi:
|
|
|
4377
4394
|
repo_id (`str`):
|
|
4378
4395
|
The repository to which the file will be uploaded, for example:
|
|
4379
4396
|
`"username/custom_transformers"`
|
|
4380
|
-
token (
|
|
4397
|
+
token (`bool` or `str`, *optional*):
|
|
4381
4398
|
A valid user access token (string). Defaults to the locally saved
|
|
4382
4399
|
token, which is the recommended method for authentication (see
|
|
4383
4400
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -4579,7 +4596,7 @@ class HfApi:
|
|
|
4579
4596
|
path_in_repo (`str`, *optional*):
|
|
4580
4597
|
Relative path of the directory in the repo, for example:
|
|
4581
4598
|
`"checkpoints/1fec34a/results"`. Will default to the root folder of the repository.
|
|
4582
|
-
token (
|
|
4599
|
+
token (`bool` or `str`, *optional*):
|
|
4583
4600
|
A valid user access token (string). Defaults to the locally saved
|
|
4584
4601
|
token, which is the recommended method for authentication (see
|
|
4585
4602
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -4753,7 +4770,7 @@ class HfApi:
|
|
|
4753
4770
|
repo_id (`str`):
|
|
4754
4771
|
The repository from which the file will be deleted, for example:
|
|
4755
4772
|
`"username/custom_transformers"`
|
|
4756
|
-
token (
|
|
4773
|
+
token (`bool` or `str`, *optional*):
|
|
4757
4774
|
A valid user access token (string). Defaults to the locally saved
|
|
4758
4775
|
token, which is the recommended method for authentication (see
|
|
4759
4776
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -4844,7 +4861,7 @@ class HfApi:
|
|
|
4844
4861
|
List of files or folders to delete. Each string can either be
|
|
4845
4862
|
a file path, a folder path or a Unix shell-style wildcard.
|
|
4846
4863
|
E.g. `["file.txt", "folder/", "data/*.parquet"]`
|
|
4847
|
-
token (
|
|
4864
|
+
token (`bool` or `str`, *optional*):
|
|
4848
4865
|
A valid user access token (string). Defaults to the locally saved
|
|
4849
4866
|
token, which is the recommended method for authentication (see
|
|
4850
4867
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -4917,7 +4934,7 @@ class HfApi:
|
|
|
4917
4934
|
repo_id (`str`):
|
|
4918
4935
|
The repository from which the folder will be deleted, for example:
|
|
4919
4936
|
`"username/custom_transformers"`
|
|
4920
|
-
token (
|
|
4937
|
+
token (`bool` or `str`, *optional*):
|
|
4921
4938
|
A valid user access token (string). Defaults to the locally saved
|
|
4922
4939
|
token, which is the recommended method for authentication (see
|
|
4923
4940
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -5052,14 +5069,13 @@ class HfApi:
|
|
|
5052
5069
|
4. Pre-upload LFS file if at least 1 file and no worker is pre-uploading.
|
|
5053
5070
|
5. Hash file if at least 1 file and no worker is hashing.
|
|
5054
5071
|
6. Get upload mode if at least 1 file and no worker is getting upload mode.
|
|
5055
|
-
7. Pre-upload LFS file if at least 1 file
|
|
5072
|
+
7. Pre-upload LFS file if at least 1 file.
|
|
5056
5073
|
8. Hash file if at least 1 file to hash.
|
|
5057
5074
|
9. Get upload mode if at least 1 file to get upload mode.
|
|
5058
5075
|
10. Commit if at least 1 file to commit and at least 1 min since last commit attempt.
|
|
5059
5076
|
11. Commit if at least 1 file to commit and all other queues are empty.
|
|
5060
5077
|
|
|
5061
5078
|
Special rules:
|
|
5062
|
-
- If `hf_transfer` is enabled, only 1 LFS uploader at a time. Otherwise the CPU would be bloated by `hf_transfer`.
|
|
5063
5079
|
- Only one worker can commit at a time.
|
|
5064
5080
|
- If no tasks are available, the worker waits for 10 seconds before checking again.
|
|
5065
5081
|
"""
|
|
@@ -5090,7 +5106,7 @@ class HfApi:
|
|
|
5090
5106
|
Args:
|
|
5091
5107
|
url (`str`):
|
|
5092
5108
|
File url, for example returned by [`hf_hub_url`].
|
|
5093
|
-
token (
|
|
5109
|
+
token (`bool` or `str`, *optional*):
|
|
5094
5110
|
A valid user access token (string). Defaults to the locally saved
|
|
5095
5111
|
token, which is the recommended method for authentication (see
|
|
5096
5112
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -5226,7 +5242,7 @@ class HfApi:
|
|
|
5226
5242
|
etag_timeout (`float`, *optional*, defaults to `10`):
|
|
5227
5243
|
When fetching ETag, how many seconds to wait for the server to send
|
|
5228
5244
|
data before giving up which is passed to `httpx.request`.
|
|
5229
|
-
token (
|
|
5245
|
+
token (`bool` or `str`, *optional*):
|
|
5230
5246
|
A valid user access token (string). Defaults to the locally saved
|
|
5231
5247
|
token, which is the recommended method for authentication (see
|
|
5232
5248
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -5336,7 +5352,7 @@ class HfApi:
|
|
|
5336
5352
|
data before giving up which is passed to `httpx.request`.
|
|
5337
5353
|
force_download (`bool`, *optional*, defaults to `False`):
|
|
5338
5354
|
Whether the file should be downloaded even if it already exists in the local cache.
|
|
5339
|
-
token (
|
|
5355
|
+
token (`bool` or `str`, *optional*):
|
|
5340
5356
|
A valid user access token (string). Defaults to the locally saved
|
|
5341
5357
|
token, which is the recommended method for authentication (see
|
|
5342
5358
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -5428,7 +5444,7 @@ class HfApi:
|
|
|
5428
5444
|
revision (`str`, *optional*):
|
|
5429
5445
|
The git revision to fetch the file from. Can be a branch name, a tag, or a commit hash. Defaults to the
|
|
5430
5446
|
head of the `"main"` branch.
|
|
5431
|
-
token (
|
|
5447
|
+
token (`bool` or `str`, *optional*):
|
|
5432
5448
|
A valid user access token (string). Defaults to the locally saved
|
|
5433
5449
|
token, which is the recommended method for authentication (see
|
|
5434
5450
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -5567,7 +5583,7 @@ class HfApi:
|
|
|
5567
5583
|
revision (`str`, *optional*):
|
|
5568
5584
|
The git revision to fetch the file from. Can be a branch name, a tag, or a commit hash. Defaults to the
|
|
5569
5585
|
head of the `"main"` branch.
|
|
5570
|
-
token (
|
|
5586
|
+
token (`bool` or `str`, *optional*):
|
|
5571
5587
|
A valid user access token (string). Defaults to the locally saved
|
|
5572
5588
|
token, which is the recommended method for authentication (see
|
|
5573
5589
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -5671,7 +5687,7 @@ class HfApi:
|
|
|
5671
5687
|
the OID/SHA of a commit, as a hexadecimal string. Defaults to the head
|
|
5672
5688
|
of the `"main"` branch.
|
|
5673
5689
|
|
|
5674
|
-
token (
|
|
5690
|
+
token (`bool` or `str`, *optional*):
|
|
5675
5691
|
A valid user access token (string). Defaults to the locally saved
|
|
5676
5692
|
token, which is the recommended method for authentication (see
|
|
5677
5693
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -5743,7 +5759,7 @@ class HfApi:
|
|
|
5743
5759
|
branch (`str`):
|
|
5744
5760
|
The name of the branch to delete.
|
|
5745
5761
|
|
|
5746
|
-
token (
|
|
5762
|
+
token (`bool` or `str`, *optional*):
|
|
5747
5763
|
A valid user access token (string). Defaults to the locally saved
|
|
5748
5764
|
token, which is the recommended method for authentication (see
|
|
5749
5765
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -5806,7 +5822,7 @@ class HfApi:
|
|
|
5806
5822
|
commit, as a hexadecimal string. Shorthands (7 first characters) are
|
|
5807
5823
|
also supported. Defaults to the head of the `"main"` branch.
|
|
5808
5824
|
|
|
5809
|
-
token (
|
|
5825
|
+
token (`bool` or `str`, *optional*):
|
|
5810
5826
|
A valid user access token (string). Defaults to the locally saved
|
|
5811
5827
|
token, which is the recommended method for authentication (see
|
|
5812
5828
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -5869,7 +5885,7 @@ class HfApi:
|
|
|
5869
5885
|
tag (`str`):
|
|
5870
5886
|
The name of the tag to delete.
|
|
5871
5887
|
|
|
5872
|
-
token (
|
|
5888
|
+
token (`bool` or `str`, *optional*):
|
|
5873
5889
|
A valid user access token (string). Defaults to the locally saved
|
|
5874
5890
|
token, which is the recommended method for authentication (see
|
|
5875
5891
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -5916,7 +5932,7 @@ class HfApi:
|
|
|
5916
5932
|
organization (`str`, *optional*):
|
|
5917
5933
|
If passed, the repository name will be in the organization
|
|
5918
5934
|
namespace instead of the user namespace.
|
|
5919
|
-
token (
|
|
5935
|
+
token (`bool` or `str`, *optional*):
|
|
5920
5936
|
A valid user access token (string). Defaults to the locally saved
|
|
5921
5937
|
token, which is the recommended method for authentication (see
|
|
5922
5938
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -5970,7 +5986,7 @@ class HfApi:
|
|
|
5970
5986
|
Set to `"dataset"` or `"space"` if fetching from a dataset or
|
|
5971
5987
|
space, `None` or `"model"` if fetching from a model. Default is
|
|
5972
5988
|
`None`.
|
|
5973
|
-
token (
|
|
5989
|
+
token (`bool` or `str`, *optional*):
|
|
5974
5990
|
A valid user access token (string). Defaults to the locally saved
|
|
5975
5991
|
token, which is the recommended method for authentication (see
|
|
5976
5992
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -6065,7 +6081,7 @@ class HfApi:
|
|
|
6065
6081
|
Set to `"dataset"` or `"space"` if uploading to a dataset or
|
|
6066
6082
|
space, `None` or `"model"` if uploading to a model. Default is
|
|
6067
6083
|
`None`.
|
|
6068
|
-
token (
|
|
6084
|
+
token (`bool` or `str`, *optional*):
|
|
6069
6085
|
A valid user access token (string). Defaults to the locally saved
|
|
6070
6086
|
token, which is the recommended method for authentication (see
|
|
6071
6087
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -6145,7 +6161,7 @@ class HfApi:
|
|
|
6145
6161
|
The title of the discussion. It can be up to 200 characters long,
|
|
6146
6162
|
and must be at least 3 characters long. Leading and trailing whitespaces
|
|
6147
6163
|
will be stripped.
|
|
6148
|
-
token (
|
|
6164
|
+
token (`bool` or `str`, *optional*):
|
|
6149
6165
|
A valid user access token (string). Defaults to the locally saved
|
|
6150
6166
|
token, which is the recommended method for authentication (see
|
|
6151
6167
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -6233,7 +6249,7 @@ class HfApi:
|
|
|
6233
6249
|
The title of the discussion. It can be up to 200 characters long,
|
|
6234
6250
|
and must be at least 3 characters long. Leading and trailing whitespaces
|
|
6235
6251
|
will be stripped.
|
|
6236
|
-
token (
|
|
6252
|
+
token (`bool` or `str`, *optional*):
|
|
6237
6253
|
A valid user access token (string). Defaults to the locally saved
|
|
6238
6254
|
token, which is the recommended method for authentication (see
|
|
6239
6255
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -6317,7 +6333,7 @@ class HfApi:
|
|
|
6317
6333
|
Set to `"dataset"` or `"space"` if uploading to a dataset or
|
|
6318
6334
|
space, `None` or `"model"` if uploading to a model. Default is
|
|
6319
6335
|
`None`.
|
|
6320
|
-
token (
|
|
6336
|
+
token (`bool` or `str`, *optional*):
|
|
6321
6337
|
A valid user access token (string). Defaults to the locally saved
|
|
6322
6338
|
token, which is the recommended method for authentication (see
|
|
6323
6339
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -6393,7 +6409,7 @@ class HfApi:
|
|
|
6393
6409
|
Set to `"dataset"` or `"space"` if uploading to a dataset or
|
|
6394
6410
|
space, `None` or `"model"` if uploading to a model. Default is
|
|
6395
6411
|
`None`.
|
|
6396
|
-
token (
|
|
6412
|
+
token (`bool` or `str`, *optional*):
|
|
6397
6413
|
A valid user access token (string). Defaults to the locally saved
|
|
6398
6414
|
token, which is the recommended method for authentication (see
|
|
6399
6415
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -6463,7 +6479,7 @@ class HfApi:
|
|
|
6463
6479
|
Set to `"dataset"` or `"space"` if uploading to a dataset or
|
|
6464
6480
|
space, `None` or `"model"` if uploading to a model. Default is
|
|
6465
6481
|
`None`.
|
|
6466
|
-
token (
|
|
6482
|
+
token (`bool` or `str`, *optional*):
|
|
6467
6483
|
A valid user access token (string). Defaults to the locally saved
|
|
6468
6484
|
token, which is the recommended method for authentication (see
|
|
6469
6485
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -6535,7 +6551,7 @@ class HfApi:
|
|
|
6535
6551
|
Set to `"dataset"` or `"space"` if uploading to a dataset or
|
|
6536
6552
|
space, `None` or `"model"` if uploading to a model. Default is
|
|
6537
6553
|
`None`.
|
|
6538
|
-
token (
|
|
6554
|
+
token (`bool` or `str`, *optional*):
|
|
6539
6555
|
A valid user access token (string). Defaults to the locally saved
|
|
6540
6556
|
token, which is the recommended method for authentication (see
|
|
6541
6557
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -6591,7 +6607,7 @@ class HfApi:
|
|
|
6591
6607
|
Set to `"dataset"` or `"space"` if uploading to a dataset or
|
|
6592
6608
|
space, `None` or `"model"` if uploading to a model. Default is
|
|
6593
6609
|
`None`.
|
|
6594
|
-
token (
|
|
6610
|
+
token (`bool` or `str`, *optional*):
|
|
6595
6611
|
A valid user access token (string). Defaults to the locally saved
|
|
6596
6612
|
token, which is the recommended method for authentication (see
|
|
6597
6613
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -6648,7 +6664,7 @@ class HfApi:
|
|
|
6648
6664
|
Set to `"dataset"` or `"space"` if uploading to a dataset or
|
|
6649
6665
|
space, `None` or `"model"` if uploading to a model. Default is
|
|
6650
6666
|
`None`.
|
|
6651
|
-
token (
|
|
6667
|
+
token (`bool` or `str`, *optional*):
|
|
6652
6668
|
A valid user access token (string). Defaults to the locally saved
|
|
6653
6669
|
token, which is the recommended method for authentication (see
|
|
6654
6670
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -6705,7 +6721,7 @@ class HfApi:
|
|
|
6705
6721
|
Secret value. Example: `"your_github_api_key"`.
|
|
6706
6722
|
description (`str`, *optional*):
|
|
6707
6723
|
Secret description. Example: `"Github API key to access the Github API"`.
|
|
6708
|
-
token (
|
|
6724
|
+
token (`bool` or `str`, *optional*):
|
|
6709
6725
|
A valid user access token (string). Defaults to the locally saved
|
|
6710
6726
|
token, which is the recommended method for authentication (see
|
|
6711
6727
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -6733,7 +6749,7 @@ class HfApi:
|
|
|
6733
6749
|
ID of the repo to update. Example: `"bigcode/in-the-stack"`.
|
|
6734
6750
|
key (`str`):
|
|
6735
6751
|
Secret key. Example: `"GITHUB_API_KEY"`.
|
|
6736
|
-
token (
|
|
6752
|
+
token (`bool` or `str`, *optional*):
|
|
6737
6753
|
A valid user access token (string). Defaults to the locally saved
|
|
6738
6754
|
token, which is the recommended method for authentication (see
|
|
6739
6755
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -6757,7 +6773,7 @@ class HfApi:
|
|
|
6757
6773
|
Args:
|
|
6758
6774
|
repo_id (`str`):
|
|
6759
6775
|
ID of the repo to query. Example: `"bigcode/in-the-stack"`.
|
|
6760
|
-
token (
|
|
6776
|
+
token (`bool` or `str`, *optional*):
|
|
6761
6777
|
A valid user access token (string). Defaults to the locally saved
|
|
6762
6778
|
token, which is the recommended method for authentication (see
|
|
6763
6779
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -6794,7 +6810,7 @@ class HfApi:
|
|
|
6794
6810
|
Variable value. Example: `"the_model_repo_id"`.
|
|
6795
6811
|
description (`str`):
|
|
6796
6812
|
Description of the variable. Example: `"Model Repo ID of the implemented model"`.
|
|
6797
|
-
token (
|
|
6813
|
+
token (`bool` or `str`, *optional*):
|
|
6798
6814
|
A valid user access token (string). Defaults to the locally saved
|
|
6799
6815
|
token, which is the recommended method for authentication (see
|
|
6800
6816
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -6825,7 +6841,7 @@ class HfApi:
|
|
|
6825
6841
|
ID of the repo to update. Example: `"bigcode/in-the-stack"`.
|
|
6826
6842
|
key (`str`):
|
|
6827
6843
|
Variable key. Example: `"MODEL_REPO_ID"`
|
|
6828
|
-
token (
|
|
6844
|
+
token (`bool` or `str`, *optional*):
|
|
6829
6845
|
A valid user access token (string). Defaults to the locally saved
|
|
6830
6846
|
token, which is the recommended method for authentication (see
|
|
6831
6847
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -6847,7 +6863,7 @@ class HfApi:
|
|
|
6847
6863
|
Args:
|
|
6848
6864
|
repo_id (`str`):
|
|
6849
6865
|
ID of the repo to update. Example: `"bigcode/in-the-stack"`.
|
|
6850
|
-
token (
|
|
6866
|
+
token (`bool` or `str`, *optional*):
|
|
6851
6867
|
A valid user access token (string). Defaults to the locally saved
|
|
6852
6868
|
token, which is the recommended method for authentication (see
|
|
6853
6869
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -6877,7 +6893,7 @@ class HfApi:
|
|
|
6877
6893
|
ID of the repo to update. Example: `"bigcode/in-the-stack"`.
|
|
6878
6894
|
hardware (`str` or [`SpaceHardware`]):
|
|
6879
6895
|
Hardware on which to run the Space. Example: `"t4-medium"`.
|
|
6880
|
-
token (
|
|
6896
|
+
token (`bool` or `str`, *optional*):
|
|
6881
6897
|
A valid user access token (string). Defaults to the locally saved
|
|
6882
6898
|
token, which is the recommended method for authentication (see
|
|
6883
6899
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -6930,7 +6946,7 @@ class HfApi:
|
|
|
6930
6946
|
your Space to pause (default behavior for upgraded hardware). For free hardware, you can't configure
|
|
6931
6947
|
the sleep time (value is fixed to 48 hours of inactivity).
|
|
6932
6948
|
See https://huggingface.co/docs/hub/spaces-gpus#sleep-time for more details.
|
|
6933
|
-
token (
|
|
6949
|
+
token (`bool` or `str`, *optional*):
|
|
6934
6950
|
A valid user access token (string). Defaults to the locally saved
|
|
6935
6951
|
token, which is the recommended method for authentication (see
|
|
6936
6952
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -6972,7 +6988,7 @@ class HfApi:
|
|
|
6972
6988
|
Args:
|
|
6973
6989
|
repo_id (`str`):
|
|
6974
6990
|
ID of the Space to pause. Example: `"Salesforce/BLIP2"`.
|
|
6975
|
-
token (
|
|
6991
|
+
token (`bool` or `str`, *optional*):
|
|
6976
6992
|
A valid user access token (string). Defaults to the locally saved
|
|
6977
6993
|
token, which is the recommended method for authentication (see
|
|
6978
6994
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -7013,7 +7029,7 @@ class HfApi:
|
|
|
7013
7029
|
Args:
|
|
7014
7030
|
repo_id (`str`):
|
|
7015
7031
|
ID of the Space to restart. Example: `"Salesforce/BLIP2"`.
|
|
7016
|
-
token (
|
|
7032
|
+
token (`bool` or `str`, *optional*):
|
|
7017
7033
|
A valid user access token (string). Defaults to the locally saved
|
|
7018
7034
|
token, which is the recommended method for authentication (see
|
|
7019
7035
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -7072,7 +7088,7 @@ class HfApi:
|
|
|
7072
7088
|
name as the original Space, but in your account.
|
|
7073
7089
|
private (`bool`, *optional*):
|
|
7074
7090
|
Whether the new Space should be private or not. Defaults to the same privacy as the original Space.
|
|
7075
|
-
token (
|
|
7091
|
+
token (`bool` or `str`, *optional*):
|
|
7076
7092
|
A valid user access token (string). Defaults to the locally saved
|
|
7077
7093
|
token, which is the recommended method for authentication (see
|
|
7078
7094
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -7177,7 +7193,7 @@ class HfApi:
|
|
|
7177
7193
|
ID of the Space to update. Example: `"open-llm-leaderboard/open_llm_leaderboard"`.
|
|
7178
7194
|
storage (`str` or [`SpaceStorage`]):
|
|
7179
7195
|
Storage tier. Either 'small', 'medium', or 'large'.
|
|
7180
|
-
token (
|
|
7196
|
+
token (`bool` or `str`, *optional*):
|
|
7181
7197
|
A valid user access token (string). Defaults to the locally saved
|
|
7182
7198
|
token, which is the recommended method for authentication (see
|
|
7183
7199
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -7210,7 +7226,7 @@ class HfApi:
|
|
|
7210
7226
|
Args:
|
|
7211
7227
|
repo_id (`str`):
|
|
7212
7228
|
ID of the Space to update. Example: `"open-llm-leaderboard/open_llm_leaderboard"`.
|
|
7213
|
-
token (
|
|
7229
|
+
token (`bool` or `str`, *optional*):
|
|
7214
7230
|
A valid user access token (string). Defaults to the locally saved
|
|
7215
7231
|
token, which is the recommended method for authentication (see
|
|
7216
7232
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -7242,7 +7258,7 @@ class HfApi:
|
|
|
7242
7258
|
namespace (`str`, *optional*):
|
|
7243
7259
|
The namespace to list endpoints for. Defaults to the current user. Set to `"*"` to list all endpoints
|
|
7244
7260
|
from all namespaces (i.e. personal namespace and all orgs the user belongs to).
|
|
7245
|
-
token (
|
|
7261
|
+
token (`bool` or `str`, *optional*):
|
|
7246
7262
|
A valid user access token (string). Defaults to the locally saved
|
|
7247
7263
|
token, which is the recommended method for authentication (see
|
|
7248
7264
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -7371,7 +7387,7 @@ class HfApi:
|
|
|
7371
7387
|
A list of tags to associate with the Inference Endpoint.
|
|
7372
7388
|
namespace (`str`, *optional*):
|
|
7373
7389
|
The namespace where the Inference Endpoint will be created. Defaults to the current user's namespace.
|
|
7374
|
-
token (
|
|
7390
|
+
token (`bool` or `str`, *optional*):
|
|
7375
7391
|
A valid user access token (string). Defaults to the locally saved
|
|
7376
7392
|
token, which is the recommended method for authentication (see
|
|
7377
7393
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -7541,7 +7557,7 @@ class HfApi:
|
|
|
7541
7557
|
The ID of the model in the catalog to deploy as an Inference Endpoint.
|
|
7542
7558
|
name (`str`, *optional*):
|
|
7543
7559
|
The unique name for the new Inference Endpoint. If not provided, a random name will be generated.
|
|
7544
|
-
token (
|
|
7560
|
+
token (`bool` or `str`, *optional*):
|
|
7545
7561
|
A valid user access token (string). Defaults to the locally saved
|
|
7546
7562
|
token, which is the recommended method for authentication (see
|
|
7547
7563
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -7584,7 +7600,7 @@ class HfApi:
|
|
|
7584
7600
|
Use [`create_inference_endpoint_from_catalog`] to deploy a model from the catalog.
|
|
7585
7601
|
|
|
7586
7602
|
Args:
|
|
7587
|
-
token (
|
|
7603
|
+
token (`bool` or `str`, *optional*):
|
|
7588
7604
|
A valid user access token (string). Defaults to the locally saved
|
|
7589
7605
|
token, which is the recommended method for authentication (see
|
|
7590
7606
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -7612,7 +7628,7 @@ class HfApi:
|
|
|
7612
7628
|
The name of the Inference Endpoint to retrieve information about.
|
|
7613
7629
|
namespace (`str`, *optional*):
|
|
7614
7630
|
The namespace in which the Inference Endpoint is located. Defaults to the current user.
|
|
7615
|
-
token (
|
|
7631
|
+
token (`bool` or `str`, *optional*):
|
|
7616
7632
|
A valid user access token (string). Defaults to the locally saved
|
|
7617
7633
|
token, which is the recommended method for authentication (see
|
|
7618
7634
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -7729,7 +7745,7 @@ class HfApi:
|
|
|
7729
7745
|
|
|
7730
7746
|
namespace (`str`, *optional*):
|
|
7731
7747
|
The namespace where the Inference Endpoint will be updated. Defaults to the current user's namespace.
|
|
7732
|
-
token (
|
|
7748
|
+
token (`bool` or `str`, *optional*):
|
|
7733
7749
|
A valid user access token (string). Defaults to the locally saved
|
|
7734
7750
|
token, which is the recommended method for authentication (see
|
|
7735
7751
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -7801,7 +7817,7 @@ class HfApi:
|
|
|
7801
7817
|
The name of the Inference Endpoint to delete.
|
|
7802
7818
|
namespace (`str`, *optional*):
|
|
7803
7819
|
The namespace in which the Inference Endpoint is located. Defaults to the current user.
|
|
7804
|
-
token (
|
|
7820
|
+
token (`bool` or `str`, *optional*):
|
|
7805
7821
|
A valid user access token (string). Defaults to the locally saved
|
|
7806
7822
|
token, which is the recommended method for authentication (see
|
|
7807
7823
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -7830,7 +7846,7 @@ class HfApi:
|
|
|
7830
7846
|
The name of the Inference Endpoint to pause.
|
|
7831
7847
|
namespace (`str`, *optional*):
|
|
7832
7848
|
The namespace in which the Inference Endpoint is located. Defaults to the current user.
|
|
7833
|
-
token (
|
|
7849
|
+
token (`bool` or `str`, *optional*):
|
|
7834
7850
|
A valid user access token (string). Defaults to the locally saved
|
|
7835
7851
|
token, which is the recommended method for authentication (see
|
|
7836
7852
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -7869,7 +7885,7 @@ class HfApi:
|
|
|
7869
7885
|
running_ok (`bool`, *optional*):
|
|
7870
7886
|
If `True`, the method will not raise an error if the Inference Endpoint is already running. Defaults to
|
|
7871
7887
|
`True`.
|
|
7872
|
-
token (
|
|
7888
|
+
token (`bool` or `str`, *optional*):
|
|
7873
7889
|
A valid user access token (string). Defaults to the locally saved
|
|
7874
7890
|
token, which is the recommended method for authentication (see
|
|
7875
7891
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -7911,7 +7927,7 @@ class HfApi:
|
|
|
7911
7927
|
The name of the Inference Endpoint to scale to zero.
|
|
7912
7928
|
namespace (`str`, *optional*):
|
|
7913
7929
|
The namespace in which the Inference Endpoint is located. Defaults to the current user.
|
|
7914
|
-
token (
|
|
7930
|
+
token (`bool` or `str`, *optional*):
|
|
7915
7931
|
A valid user access token (string). Defaults to the locally saved
|
|
7916
7932
|
token, which is the recommended method for authentication (see
|
|
7917
7933
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -7969,7 +7985,7 @@ class HfApi:
|
|
|
7969
7985
|
Sort collections by last modified, trending or upvotes.
|
|
7970
7986
|
limit (`int`, *optional*):
|
|
7971
7987
|
Maximum number of collections to be returned.
|
|
7972
|
-
token (
|
|
7988
|
+
token (`bool` or `str`, *optional*):
|
|
7973
7989
|
A valid user access token (string). Defaults to the locally saved
|
|
7974
7990
|
token, which is the recommended method for authentication (see
|
|
7975
7991
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -8006,7 +8022,7 @@ class HfApi:
|
|
|
8006
8022
|
Args:
|
|
8007
8023
|
collection_slug (`str`):
|
|
8008
8024
|
Slug of the collection of the Hub. Example: `"TheBloke/recent-models-64f9a55bb3115b4f513ec026"`.
|
|
8009
|
-
token (
|
|
8025
|
+
token (`bool` or `str`, *optional*):
|
|
8010
8026
|
A valid user access token (string). Defaults to the locally saved
|
|
8011
8027
|
token, which is the recommended method for authentication (see
|
|
8012
8028
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -8062,7 +8078,7 @@ class HfApi:
|
|
|
8062
8078
|
Whether the collection should be private or not. Defaults to `False` (i.e. public collection).
|
|
8063
8079
|
exists_ok (`bool`, *optional*):
|
|
8064
8080
|
If `True`, do not raise an error if collection already exists.
|
|
8065
|
-
token (
|
|
8081
|
+
token (`bool` or `str`, *optional*):
|
|
8066
8082
|
A valid user access token (string). Defaults to the locally saved
|
|
8067
8083
|
token, which is the recommended method for authentication (see
|
|
8068
8084
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -8135,7 +8151,7 @@ class HfApi:
|
|
|
8135
8151
|
Whether the collection should be private or not.
|
|
8136
8152
|
theme (`str`, *optional*):
|
|
8137
8153
|
Theme of the collection on the Hub.
|
|
8138
|
-
token (
|
|
8154
|
+
token (`bool` or `str`, *optional*):
|
|
8139
8155
|
A valid user access token (string). Defaults to the locally saved
|
|
8140
8156
|
token, which is the recommended method for authentication (see
|
|
8141
8157
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -8185,7 +8201,7 @@ class HfApi:
|
|
|
8185
8201
|
Slug of the collection to delete. Example: `"TheBloke/recent-models-64f9a55bb3115b4f513ec026"`.
|
|
8186
8202
|
missing_ok (`bool`, *optional*):
|
|
8187
8203
|
If `True`, do not raise an error if collection doesn't exists.
|
|
8188
|
-
token (
|
|
8204
|
+
token (`bool` or `str`, *optional*):
|
|
8189
8205
|
A valid user access token (string). Defaults to the locally saved
|
|
8190
8206
|
token, which is the recommended method for authentication (see
|
|
8191
8207
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -8237,7 +8253,7 @@ class HfApi:
|
|
|
8237
8253
|
A note to attach to the item in the collection. The maximum size for a note is 500 characters.
|
|
8238
8254
|
exists_ok (`bool`, *optional*):
|
|
8239
8255
|
If `True`, do not raise an error if item already exists.
|
|
8240
|
-
token (
|
|
8256
|
+
token (`bool` or `str`, *optional*):
|
|
8241
8257
|
A valid user access token (string). Defaults to the locally saved
|
|
8242
8258
|
token, which is the recommended method for authentication (see
|
|
8243
8259
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -8316,7 +8332,7 @@ class HfApi:
|
|
|
8316
8332
|
A note to attach to the item in the collection. The maximum size for a note is 500 characters.
|
|
8317
8333
|
position (`int`, *optional*):
|
|
8318
8334
|
New position of the item in the collection.
|
|
8319
|
-
token (
|
|
8335
|
+
token (`bool` or `str`, *optional*):
|
|
8320
8336
|
A valid user access token (string). Defaults to the locally saved
|
|
8321
8337
|
token, which is the recommended method for authentication (see
|
|
8322
8338
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -8366,7 +8382,7 @@ class HfApi:
|
|
|
8366
8382
|
It must be retrieved from a [`CollectionItem`] object. Example: `collection.items[0].item_object_id`.
|
|
8367
8383
|
missing_ok (`bool`, *optional*):
|
|
8368
8384
|
If `True`, do not raise an error if item doesn't exists.
|
|
8369
|
-
token (
|
|
8385
|
+
token (`bool` or `str`, *optional*):
|
|
8370
8386
|
A valid user access token (string). Defaults to the locally saved
|
|
8371
8387
|
token, which is the recommended method for authentication (see
|
|
8372
8388
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -8423,7 +8439,7 @@ class HfApi:
|
|
|
8423
8439
|
repo_type (`str`, *optional*):
|
|
8424
8440
|
The type of the repo to get access requests for. Must be one of `model`, `dataset` or `space`.
|
|
8425
8441
|
Defaults to `model`.
|
|
8426
|
-
token (
|
|
8442
|
+
token (`bool` or `str`, *optional*):
|
|
8427
8443
|
A valid user access token (string). Defaults to the locally saved
|
|
8428
8444
|
token, which is the recommended method for authentication (see
|
|
8429
8445
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -8489,7 +8505,7 @@ class HfApi:
|
|
|
8489
8505
|
repo_type (`str`, *optional*):
|
|
8490
8506
|
The type of the repo to get access requests for. Must be one of `model`, `dataset` or `space`.
|
|
8491
8507
|
Defaults to `model`.
|
|
8492
|
-
token (
|
|
8508
|
+
token (`bool` or `str`, *optional*):
|
|
8493
8509
|
A valid user access token (string). Defaults to the locally saved
|
|
8494
8510
|
token, which is the recommended method for authentication (see
|
|
8495
8511
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -8551,7 +8567,7 @@ class HfApi:
|
|
|
8551
8567
|
repo_type (`str`, *optional*):
|
|
8552
8568
|
The type of the repo to get access requests for. Must be one of `model`, `dataset` or `space`.
|
|
8553
8569
|
Defaults to `model`.
|
|
8554
|
-
token (
|
|
8570
|
+
token (`bool` or `str`, *optional*):
|
|
8555
8571
|
A valid user access token (string). Defaults to the locally saved
|
|
8556
8572
|
token, which is the recommended method for authentication (see
|
|
8557
8573
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -8640,7 +8656,7 @@ class HfApi:
|
|
|
8640
8656
|
repo_type (`str`, *optional*):
|
|
8641
8657
|
The type of the repo to cancel access request for. Must be one of `model`, `dataset` or `space`.
|
|
8642
8658
|
Defaults to `model`.
|
|
8643
|
-
token (
|
|
8659
|
+
token (`bool` or `str`, *optional*):
|
|
8644
8660
|
A valid user access token (string). Defaults to the locally saved
|
|
8645
8661
|
token, which is the recommended method for authentication (see
|
|
8646
8662
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -8682,7 +8698,7 @@ class HfApi:
|
|
|
8682
8698
|
repo_type (`str`, *optional*):
|
|
8683
8699
|
The type of the repo to accept access request for. Must be one of `model`, `dataset` or `space`.
|
|
8684
8700
|
Defaults to `model`.
|
|
8685
|
-
token (
|
|
8701
|
+
token (`bool` or `str`, *optional*):
|
|
8686
8702
|
A valid user access token (string). Defaults to the locally saved
|
|
8687
8703
|
token, which is the recommended method for authentication (see
|
|
8688
8704
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -8732,7 +8748,7 @@ class HfApi:
|
|
|
8732
8748
|
Defaults to `model`.
|
|
8733
8749
|
rejection_reason (`str`, *optional*):
|
|
8734
8750
|
Optional rejection reason that will be visible to the user (max 200 characters).
|
|
8735
|
-
token (
|
|
8751
|
+
token (`bool` or `str`, *optional*):
|
|
8736
8752
|
A valid user access token (string). Defaults to the locally saved
|
|
8737
8753
|
token, which is the recommended method for authentication (see
|
|
8738
8754
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -8805,7 +8821,7 @@ class HfApi:
|
|
|
8805
8821
|
repo_type (`str`, *optional*):
|
|
8806
8822
|
The type of the repo to grant access to. Must be one of `model`, `dataset` or `space`.
|
|
8807
8823
|
Defaults to `model`.
|
|
8808
|
-
token (
|
|
8824
|
+
token (`bool` or `str`, *optional*):
|
|
8809
8825
|
A valid user access token (string). Defaults to the locally saved
|
|
8810
8826
|
token, which is the recommended method for authentication (see
|
|
8811
8827
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -8846,7 +8862,7 @@ class HfApi:
|
|
|
8846
8862
|
Args:
|
|
8847
8863
|
webhook_id (`str`):
|
|
8848
8864
|
The unique identifier of the webhook to get.
|
|
8849
|
-
token (
|
|
8865
|
+
token (`bool` or `str`, *optional*):
|
|
8850
8866
|
A valid user access token (string). Defaults to the locally saved token, which is the recommended
|
|
8851
8867
|
method for authentication (see https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
8852
8868
|
To disable authentication, pass `False`.
|
|
@@ -8897,7 +8913,7 @@ class HfApi:
|
|
|
8897
8913
|
"""List all configured webhooks.
|
|
8898
8914
|
|
|
8899
8915
|
Args:
|
|
8900
|
-
token (
|
|
8916
|
+
token (`bool` or `str`, *optional*):
|
|
8901
8917
|
A valid user access token (string). Defaults to the locally saved token, which is the recommended
|
|
8902
8918
|
method for authentication (see https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
8903
8919
|
To disable authentication, pass `False`.
|
|
@@ -8972,7 +8988,7 @@ class HfApi:
|
|
|
8972
8988
|
List of domains to watch. It can be "repo", "discussion" or both.
|
|
8973
8989
|
secret (`str`, optional):
|
|
8974
8990
|
A secret to sign the payload with.
|
|
8975
|
-
token (
|
|
8991
|
+
token (`bool` or `str`, *optional*):
|
|
8976
8992
|
A valid user access token (string). Defaults to the locally saved token, which is the recommended
|
|
8977
8993
|
method for authentication (see https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
8978
8994
|
To disable authentication, pass `False`.
|
|
@@ -9098,7 +9114,7 @@ class HfApi:
|
|
|
9098
9114
|
The domains to watch. This can include "repo", "discussion", or both.
|
|
9099
9115
|
secret (`str`, optional):
|
|
9100
9116
|
A secret to sign the payload with, providing an additional layer of security.
|
|
9101
|
-
token (
|
|
9117
|
+
token (`bool` or `str`, *optional*):
|
|
9102
9118
|
A valid user access token (string). Defaults to the locally saved token, which is the recommended
|
|
9103
9119
|
method for authentication (see https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
9104
9120
|
To disable authentication, pass `False`.
|
|
@@ -9161,7 +9177,7 @@ class HfApi:
|
|
|
9161
9177
|
Args:
|
|
9162
9178
|
webhook_id (`str`):
|
|
9163
9179
|
The unique identifier of the webhook to enable.
|
|
9164
|
-
token (
|
|
9180
|
+
token (`bool` or `str`, *optional*):
|
|
9165
9181
|
A valid user access token (string). Defaults to the locally saved token, which is the recommended
|
|
9166
9182
|
method for authentication (see https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
9167
9183
|
To disable authentication, pass `False`.
|
|
@@ -9214,7 +9230,7 @@ class HfApi:
|
|
|
9214
9230
|
Args:
|
|
9215
9231
|
webhook_id (`str`):
|
|
9216
9232
|
The unique identifier of the webhook to disable.
|
|
9217
|
-
token (
|
|
9233
|
+
token (`bool` or `str`, *optional*):
|
|
9218
9234
|
A valid user access token (string). Defaults to the locally saved token, which is the recommended
|
|
9219
9235
|
method for authentication (see https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
9220
9236
|
To disable authentication, pass `False`.
|
|
@@ -9267,7 +9283,7 @@ class HfApi:
|
|
|
9267
9283
|
Args:
|
|
9268
9284
|
webhook_id (`str`):
|
|
9269
9285
|
The unique identifier of the webhook to delete.
|
|
9270
|
-
token (
|
|
9286
|
+
token (`bool` or `str`, *optional*):
|
|
9271
9287
|
A valid user access token (string). Defaults to the locally saved token, which is the recommended
|
|
9272
9288
|
method for authentication (see https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
9273
9289
|
To disable authentication, pass `False`.
|
|
@@ -9427,7 +9443,7 @@ class HfApi:
|
|
|
9427
9443
|
repo_type (`str`, *optional*):
|
|
9428
9444
|
The type of the repo to grant access to. Must be one of `model`, `dataset` or `space`.
|
|
9429
9445
|
Defaults to `model`.
|
|
9430
|
-
token (
|
|
9446
|
+
token (`bool` or `str`, *optional*):
|
|
9431
9447
|
A valid user access token (string). Defaults to the locally saved
|
|
9432
9448
|
token, which is the recommended method for authentication (see
|
|
9433
9449
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -9466,7 +9482,7 @@ class HfApi:
|
|
|
9466
9482
|
Args:
|
|
9467
9483
|
username (`str`):
|
|
9468
9484
|
Username of the user to get an overview of.
|
|
9469
|
-
token (
|
|
9485
|
+
token (`bool` or `str`, *optional*):
|
|
9470
9486
|
A valid user access token (string). Defaults to the locally saved
|
|
9471
9487
|
token, which is the recommended method for authentication (see
|
|
9472
9488
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -9485,6 +9501,33 @@ class HfApi:
|
|
|
9485
9501
|
hf_raise_for_status(r)
|
|
9486
9502
|
return User(**r.json())
|
|
9487
9503
|
|
|
9504
|
+
@validate_hf_hub_args
|
|
9505
|
+
def get_organization_overview(self, organization: str, token: Union[bool, str, None] = None) -> Organization:
|
|
9506
|
+
"""
|
|
9507
|
+
Get an overview of an organization on the Hub.
|
|
9508
|
+
|
|
9509
|
+
Args:
|
|
9510
|
+
organization (`str`):
|
|
9511
|
+
Name of the organization to get an overview of.
|
|
9512
|
+
token (`bool` or `str`, *optional*):
|
|
9513
|
+
A valid user access token (string). Defaults to the locally saved token, which is the recommended method
|
|
9514
|
+
for authentication (see https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
9515
|
+
To disable authentication, pass `False`.
|
|
9516
|
+
|
|
9517
|
+
Returns:
|
|
9518
|
+
`Organization`: An [`Organization`] object with the organization's overview.
|
|
9519
|
+
|
|
9520
|
+
Raises:
|
|
9521
|
+
[`HTTPError`](https://requests.readthedocs.io/en/latest/api/#requests.HTTPError):
|
|
9522
|
+
HTTP 404 If the organization does not exist on the Hub.
|
|
9523
|
+
"""
|
|
9524
|
+
r = get_session().get(
|
|
9525
|
+
f"{constants.ENDPOINT}/api/organizations/{organization}/overview",
|
|
9526
|
+
headers=self._build_hf_headers(token=token),
|
|
9527
|
+
)
|
|
9528
|
+
hf_raise_for_status(r)
|
|
9529
|
+
return Organization(**r.json())
|
|
9530
|
+
|
|
9488
9531
|
def list_organization_members(self, organization: str, token: Union[bool, str, None] = None) -> Iterable[User]:
|
|
9489
9532
|
"""
|
|
9490
9533
|
List of members of an organization on the Hub.
|
|
@@ -9492,7 +9535,7 @@ class HfApi:
|
|
|
9492
9535
|
Args:
|
|
9493
9536
|
organization (`str`):
|
|
9494
9537
|
Name of the organization to get the members of.
|
|
9495
|
-
token (
|
|
9538
|
+
token (`bool` or `str`, *optional*):
|
|
9496
9539
|
A valid user access token (string). Defaults to the locally saved
|
|
9497
9540
|
token, which is the recommended method for authentication (see
|
|
9498
9541
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -9520,7 +9563,7 @@ class HfApi:
|
|
|
9520
9563
|
Args:
|
|
9521
9564
|
username (`str`):
|
|
9522
9565
|
Username of the user to get the followers of.
|
|
9523
|
-
token (
|
|
9566
|
+
token (`bool` or `str`, *optional*):
|
|
9524
9567
|
A valid user access token (string). Defaults to the locally saved
|
|
9525
9568
|
token, which is the recommended method for authentication (see
|
|
9526
9569
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -9548,7 +9591,7 @@ class HfApi:
|
|
|
9548
9591
|
Args:
|
|
9549
9592
|
username (`str`):
|
|
9550
9593
|
Username of the user to get the users followed by.
|
|
9551
|
-
token (
|
|
9594
|
+
token (`bool` or `str`, *optional*):
|
|
9552
9595
|
A valid user access token (string). Defaults to the locally saved
|
|
9553
9596
|
token, which is the recommended method for authentication (see
|
|
9554
9597
|
https://huggingface.co/docs/huggingface_hub/quick-start#authentication).
|
|
@@ -10775,6 +10818,7 @@ update_webhook = api.update_webhook
|
|
|
10775
10818
|
|
|
10776
10819
|
# User API
|
|
10777
10820
|
get_user_overview = api.get_user_overview
|
|
10821
|
+
get_organization_overview = api.get_organization_overview
|
|
10778
10822
|
list_organization_members = api.list_organization_members
|
|
10779
10823
|
list_user_followers = api.list_user_followers
|
|
10780
10824
|
list_user_following = api.list_user_following
|