Skip to content

Commit

Permalink
[HfApi] update list of repository properties following server side up…
Browse files Browse the repository at this point in the history
…dates (#2728)

* update dataset expand properties

* update model and space expand properties as well

* typo
  • Loading branch information
hanouticelina authored Jan 6, 2025
1 parent 3618a38 commit 126aded
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/huggingface_hub/hf_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@
"transformersInfo",
"trendingScore",
"widgetData",
"usedStorage",
"resourceGroup",
]

ExpandDatasetProperty_T = Literal[
Expand All @@ -178,6 +180,8 @@
"sha",
"trendingScore",
"tags",
"usedStorage",
"resourceGroup",
]

ExpandSpaceProperty_T = Literal[
Expand All @@ -197,6 +201,8 @@
"subdomain",
"tags",
"trendingScore",
"usedStorage",
"resourceGroup",
]

USERNAME_PLACEHOLDER = "hf_user"
Expand Down Expand Up @@ -1782,7 +1788,7 @@ def list_models(
expand (`List[ExpandModelProperty_T]`, *optional*):
List properties to return in the response. When used, only the properties in the list will be returned.
This parameter cannot be used if `full`, `cardData` or `fetch_config` are passed.
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"`.
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"`.
full (`bool`, *optional*):
Whether to fetch all model data, including the `last_modified`,
the `sha`, the files and the `tags`. This is set to `True` by
Expand Down Expand Up @@ -2002,7 +2008,7 @@ def list_datasets(
expand (`List[ExpandDatasetProperty_T]`, *optional*):
List properties to return in the response. When used, only the properties in the list will be returned.
This parameter cannot be used if `full` is passed.
Possible values are `"author"`, `"cardData"`, `"citation"`, `"createdAt"`, `"disabled"`, `"description"`, `"downloads"`, `"downloadsAllTime"`, `"gated"`, `"lastModified"`, `"likes"`, `"paperswithcode_id"`, `"private"`, `"siblings"`, `"sha"`, `"tags"` and `"trendingScore"`.
Possible values are `"author"`, `"cardData"`, `"citation"`, `"createdAt"`, `"disabled"`, `"description"`, `"downloads"`, `"downloadsAllTime"`, `"gated"`, `"lastModified"`, `"likes"`, `"paperswithcode_id"`, `"private"`, `"siblings"`, `"sha"`, `"tags"`, `"trendingScore"`, `"usedStorage"` and `"resourceGroup"`.
full (`bool`, *optional*):
Whether to fetch all dataset data, including the `last_modified`,
the `card_data` and the files. Can contain useful information such as the
Expand Down Expand Up @@ -2180,7 +2186,7 @@ def list_spaces(
expand (`List[ExpandSpaceProperty_T]`, *optional*):
List properties to return in the response. When used, only the properties in the list will be returned.
This parameter cannot be used if `full` is passed.
Possible values are `"author"`, `"cardData"`, `"datasets"`, `"disabled"`, `"lastModified"`, `"createdAt"`, `"likes"`, `"models"`, `"private"`, `"runtime"`, `"sdk"`, `"siblings"`, `"sha"`, `"subdomain"`, `"tags"` and `"trendingScore"`.
Possible values are `"author"`, `"cardData"`, `"datasets"`, `"disabled"`, `"lastModified"`, `"createdAt"`, `"likes"`, `"models"`, `"private"`, `"runtime"`, `"sdk"`, `"siblings"`, `"sha"`, `"subdomain"`, `"tags"`, `"trendingScore"`, `"usedStorage"` and `"resourceGroup"`.
full (`bool`, *optional*):
Whether to fetch all Spaces data, including the `last_modified`, `siblings`
and `card_data` fields.
Expand Down Expand Up @@ -2491,7 +2497,7 @@ def model_info(
expand (`List[ExpandModelProperty_T]`, *optional*):
List properties to return in the response. When used, only the properties in the list will be returned.
This parameter cannot be used if `securityStatus` or `files_metadata` are passed.
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"`.
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"`.
token (Union[bool, str, None], optional):
A valid user access token (string). Defaults to the locally saved
token, which is the recommended method for authentication (see
Expand Down Expand Up @@ -2565,7 +2571,7 @@ def dataset_info(
expand (`List[ExpandDatasetProperty_T]`, *optional*):
List properties to return in the response. When used, only the properties in the list will be returned.
This parameter cannot be used if `files_metadata` is passed.
Possible values are `"author"`, `"cardData"`, `"citation"`, `"createdAt"`, `"disabled"`, `"description"`, `"downloads"`, `"downloadsAllTime"`, `"gated"`, `"lastModified"`, `"likes"`, `"paperswithcode_id"`, `"private"`, `"siblings"`, `"sha"`, `"tags"` and `"trendingScore"`.
Possible values are `"author"`, `"cardData"`, `"citation"`, `"createdAt"`, `"disabled"`, `"description"`, `"downloads"`, `"downloadsAllTime"`, `"gated"`, `"lastModified"`, `"likes"`, `"paperswithcode_id"`, `"private"`, `"siblings"`, `"sha"`, `"tags"`, `"trendingScore"`,`"usedStorage"` and `"resourceGroup"`.
token (Union[bool, str, None], optional):
A valid user access token (string). Defaults to the locally saved
token, which is the recommended method for authentication (see
Expand Down Expand Up @@ -2615,7 +2621,7 @@ def space_info(
revision: Optional[str] = None,
timeout: Optional[float] = None,
files_metadata: bool = False,
expand: Optional[List[ExpandModelProperty_T]] = None,
expand: Optional[List[ExpandSpaceProperty_T]] = None,
token: Union[bool, str, None] = None,
) -> SpaceInfo:
"""
Expand All @@ -2638,7 +2644,7 @@ def space_info(
expand (`List[ExpandSpaceProperty_T]`, *optional*):
List properties to return in the response. When used, only the properties in the list will be returned.
This parameter cannot be used if `full` is passed.
Possible values are `"author"`, `"cardData"`, `"createdAt"`, `"datasets"`, `"disabled"`, `"lastModified"`, `"likes"`, `"models"`, `"private"`, `"runtime"`, `"sdk"`, `"siblings"`, `"sha"`, `"subdomain"`, `"tags"` and `"trendingScore"`.
Possible values are `"author"`, `"cardData"`, `"createdAt"`, `"datasets"`, `"disabled"`, `"lastModified"`, `"likes"`, `"models"`, `"private"`, `"runtime"`, `"sdk"`, `"siblings"`, `"sha"`, `"subdomain"`, `"tags"`, `"trendingScore"`, `"usedStorage"` and `"resourceGroup"`.
token (Union[bool, str, None], optional):
A valid user access token (string). Defaults to the locally saved
token, which is the recommended method for authentication (see
Expand Down

0 comments on commit 126aded

Please sign in to comment.