Skip to content

Commit 126aded

Browse files
[HfApi] update list of repository properties following server side updates (#2728)
* update dataset expand properties * update model and space expand properties as well * typo
1 parent 3618a38 commit 126aded

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

src/huggingface_hub/hf_api.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@
158158
"transformersInfo",
159159
"trendingScore",
160160
"widgetData",
161+
"usedStorage",
162+
"resourceGroup",
161163
]
162164

163165
ExpandDatasetProperty_T = Literal[
@@ -178,6 +180,8 @@
178180
"sha",
179181
"trendingScore",
180182
"tags",
183+
"usedStorage",
184+
"resourceGroup",
181185
]
182186

183187
ExpandSpaceProperty_T = Literal[
@@ -197,6 +201,8 @@
197201
"subdomain",
198202
"tags",
199203
"trendingScore",
204+
"usedStorage",
205+
"resourceGroup",
200206
]
201207

202208
USERNAME_PLACEHOLDER = "hf_user"
@@ -1782,7 +1788,7 @@ def list_models(
17821788
expand (`List[ExpandModelProperty_T]`, *optional*):
17831789
List properties to return in the response. When used, only the properties in the list will be returned.
17841790
This parameter cannot be used if `full`, `cardData` or `fetch_config` are passed.
1785-
Possible values are `"author"`, `"baseModels"`, `"cardData"`, `"childrenModelCount"`, `"config"`, `"createdAt"`, `"disabled"`, `"downloads"`, `"downloadsAllTime"`, `"gated"`, `"gguf"`, `"inference"`, `"lastModified"`, `"library_name"`, `"likes"`, `"mask_token"`, `"model-index"`, `"pipeline_tag"`, `"private"`, `"safetensors"`, `"sha"`, `"siblings"`, `"spaces"`, `"tags"`, `"transformersInfo"`, `"trendingScore"` and `"widgetData"`.
1791+
Possible values are `"author"`, `"baseModels"`, `"cardData"`, `"childrenModelCount"`, `"config"`, `"createdAt"`, `"disabled"`, `"downloads"`, `"downloadsAllTime"`, `"gated"`, `"gguf"`, `"inference"`, `"lastModified"`, `"library_name"`, `"likes"`, `"mask_token"`, `"model-index"`, `"pipeline_tag"`, `"private"`, `"safetensors"`, `"sha"`, `"siblings"`, `"spaces"`, `"tags"`, `"transformersInfo"`, `"trendingScore"`, `"widgetData"`, `"usedStorage"` and `"resourceGroup"`.
17861792
full (`bool`, *optional*):
17871793
Whether to fetch all model data, including the `last_modified`,
17881794
the `sha`, the files and the `tags`. This is set to `True` by
@@ -2002,7 +2008,7 @@ def list_datasets(
20022008
expand (`List[ExpandDatasetProperty_T]`, *optional*):
20032009
List properties to return in the response. When used, only the properties in the list will be returned.
20042010
This parameter cannot be used if `full` is passed.
2005-
Possible values are `"author"`, `"cardData"`, `"citation"`, `"createdAt"`, `"disabled"`, `"description"`, `"downloads"`, `"downloadsAllTime"`, `"gated"`, `"lastModified"`, `"likes"`, `"paperswithcode_id"`, `"private"`, `"siblings"`, `"sha"`, `"tags"` and `"trendingScore"`.
2011+
Possible values are `"author"`, `"cardData"`, `"citation"`, `"createdAt"`, `"disabled"`, `"description"`, `"downloads"`, `"downloadsAllTime"`, `"gated"`, `"lastModified"`, `"likes"`, `"paperswithcode_id"`, `"private"`, `"siblings"`, `"sha"`, `"tags"`, `"trendingScore"`, `"usedStorage"` and `"resourceGroup"`.
20062012
full (`bool`, *optional*):
20072013
Whether to fetch all dataset data, including the `last_modified`,
20082014
the `card_data` and the files. Can contain useful information such as the
@@ -2180,7 +2186,7 @@ def list_spaces(
21802186
expand (`List[ExpandSpaceProperty_T]`, *optional*):
21812187
List properties to return in the response. When used, only the properties in the list will be returned.
21822188
This parameter cannot be used if `full` is passed.
2183-
Possible values are `"author"`, `"cardData"`, `"datasets"`, `"disabled"`, `"lastModified"`, `"createdAt"`, `"likes"`, `"models"`, `"private"`, `"runtime"`, `"sdk"`, `"siblings"`, `"sha"`, `"subdomain"`, `"tags"` and `"trendingScore"`.
2189+
Possible values are `"author"`, `"cardData"`, `"datasets"`, `"disabled"`, `"lastModified"`, `"createdAt"`, `"likes"`, `"models"`, `"private"`, `"runtime"`, `"sdk"`, `"siblings"`, `"sha"`, `"subdomain"`, `"tags"`, `"trendingScore"`, `"usedStorage"` and `"resourceGroup"`.
21842190
full (`bool`, *optional*):
21852191
Whether to fetch all Spaces data, including the `last_modified`, `siblings`
21862192
and `card_data` fields.
@@ -2491,7 +2497,7 @@ def model_info(
24912497
expand (`List[ExpandModelProperty_T]`, *optional*):
24922498
List properties to return in the response. When used, only the properties in the list will be returned.
24932499
This parameter cannot be used if `securityStatus` or `files_metadata` are passed.
2494-
Possible values are `"author"`, `"baseModels"`, `"cardData"`, `"childrenModelCount"`, `"config"`, `"createdAt"`, `"disabled"`, `"downloads"`, `"downloadsAllTime"`, `"gated"`, `"gguf"`, `"inference"`, `"lastModified"`, `"library_name"`, `"likes"`, `"mask_token"`, `"model-index"`, `"pipeline_tag"`, `"private"`, `"safetensors"`, `"sha"`, `"siblings"`, `"spaces"`, `"tags"`, `"transformersInfo"`, `"trendingScore"` and `"widgetData"`.
2500+
Possible values are `"author"`, `"baseModels"`, `"cardData"`, `"childrenModelCount"`, `"config"`, `"createdAt"`, `"disabled"`, `"downloads"`, `"downloadsAllTime"`, `"gated"`, `"gguf"`, `"inference"`, `"lastModified"`, `"library_name"`, `"likes"`, `"mask_token"`, `"model-index"`, `"pipeline_tag"`, `"private"`, `"safetensors"`, `"sha"`, `"siblings"`, `"spaces"`, `"tags"`, `"transformersInfo"`, `"trendingScore"`, `"widgetData"`, `"usedStorage"` and `"resourceGroup"`.
24952501
token (Union[bool, str, None], optional):
24962502
A valid user access token (string). Defaults to the locally saved
24972503
token, which is the recommended method for authentication (see
@@ -2565,7 +2571,7 @@ def dataset_info(
25652571
expand (`List[ExpandDatasetProperty_T]`, *optional*):
25662572
List properties to return in the response. When used, only the properties in the list will be returned.
25672573
This parameter cannot be used if `files_metadata` is passed.
2568-
Possible values are `"author"`, `"cardData"`, `"citation"`, `"createdAt"`, `"disabled"`, `"description"`, `"downloads"`, `"downloadsAllTime"`, `"gated"`, `"lastModified"`, `"likes"`, `"paperswithcode_id"`, `"private"`, `"siblings"`, `"sha"`, `"tags"` and `"trendingScore"`.
2574+
Possible values are `"author"`, `"cardData"`, `"citation"`, `"createdAt"`, `"disabled"`, `"description"`, `"downloads"`, `"downloadsAllTime"`, `"gated"`, `"lastModified"`, `"likes"`, `"paperswithcode_id"`, `"private"`, `"siblings"`, `"sha"`, `"tags"`, `"trendingScore"`,`"usedStorage"` and `"resourceGroup"`.
25692575
token (Union[bool, str, None], optional):
25702576
A valid user access token (string). Defaults to the locally saved
25712577
token, which is the recommended method for authentication (see
@@ -2615,7 +2621,7 @@ def space_info(
26152621
revision: Optional[str] = None,
26162622
timeout: Optional[float] = None,
26172623
files_metadata: bool = False,
2618-
expand: Optional[List[ExpandModelProperty_T]] = None,
2624+
expand: Optional[List[ExpandSpaceProperty_T]] = None,
26192625
token: Union[bool, str, None] = None,
26202626
) -> SpaceInfo:
26212627
"""
@@ -2638,7 +2644,7 @@ def space_info(
26382644
expand (`List[ExpandSpaceProperty_T]`, *optional*):
26392645
List properties to return in the response. When used, only the properties in the list will be returned.
26402646
This parameter cannot be used if `full` is passed.
2641-
Possible values are `"author"`, `"cardData"`, `"createdAt"`, `"datasets"`, `"disabled"`, `"lastModified"`, `"likes"`, `"models"`, `"private"`, `"runtime"`, `"sdk"`, `"siblings"`, `"sha"`, `"subdomain"`, `"tags"` and `"trendingScore"`.
2647+
Possible values are `"author"`, `"cardData"`, `"createdAt"`, `"datasets"`, `"disabled"`, `"lastModified"`, `"likes"`, `"models"`, `"private"`, `"runtime"`, `"sdk"`, `"siblings"`, `"sha"`, `"subdomain"`, `"tags"`, `"trendingScore"`, `"usedStorage"` and `"resourceGroup"`.
26422648
token (Union[bool, str, None], optional):
26432649
A valid user access token (string). Defaults to the locally saved
26442650
token, which is the recommended method for authentication (see

0 commit comments

Comments
 (0)