Skip to content

Commit d2ececf

Browse files
add xetEnabled as an expand property (#2907)
* add xetEnabled expand property * expose xet_enabled in repo info
1 parent 428505c commit d2ececf

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

src/huggingface_hub/hf_api.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@
163163
"trendingScore",
164164
"usedStorage",
165165
"widgetData",
166+
"xetEnabled",
166167
]
167168

168169
ExpandDatasetProperty_T = Literal[
@@ -185,6 +186,7 @@
185186
"tags",
186187
"trendingScore",
187188
"usedStorage",
189+
"xetEnabled",
188190
]
189191

190192
ExpandSpaceProperty_T = Literal[
@@ -206,6 +208,7 @@
206208
"tags",
207209
"trendingScore",
208210
"usedStorage",
211+
"xetEnabled",
209212
]
210213

211214
USERNAME_PLACEHOLDER = "hf_user"
@@ -816,6 +819,7 @@ class ModelInfo:
816819
spaces: Optional[List[str]]
817820
safetensors: Optional[SafeTensorsInfo]
818821
security_repo_status: Optional[Dict]
822+
xet_enabled: Optional[bool]
819823

820824
def __init__(self, **kwargs):
821825
self.id = kwargs.pop("id")
@@ -890,6 +894,7 @@ def __init__(self, **kwargs):
890894
else None
891895
)
892896
self.security_repo_status = kwargs.pop("securityRepoStatus", None)
897+
self.xet_enabled = kwargs.pop("xetEnabled", None)
893898
# backwards compatibility
894899
self.lastModified = self.last_modified
895900
self.cardData = self.card_data
@@ -963,6 +968,7 @@ class DatasetInfo:
963968
trending_score: Optional[int]
964969
card_data: Optional[DatasetCardData]
965970
siblings: Optional[List[RepoSibling]]
971+
xet_enabled: Optional[bool]
966972

967973
def __init__(self, **kwargs):
968974
self.id = kwargs.pop("id")
@@ -1008,7 +1014,7 @@ def __init__(self, **kwargs):
10081014
if siblings is not None
10091015
else None
10101016
)
1011-
1017+
self.xet_enabled = kwargs.pop("xetEnabled", None)
10121018
# backwards compatibility
10131019
self.lastModified = self.last_modified
10141020
self.cardData = self.card_data
@@ -1090,6 +1096,7 @@ class SpaceInfo:
10901096
runtime: Optional[SpaceRuntime]
10911097
models: Optional[List[str]]
10921098
datasets: Optional[List[str]]
1099+
xet_enabled: Optional[bool]
10931100

10941101
def __init__(self, **kwargs):
10951102
self.id = kwargs.pop("id")
@@ -1138,7 +1145,7 @@ def __init__(self, **kwargs):
11381145
self.runtime = SpaceRuntime(runtime) if runtime else None
11391146
self.models = kwargs.pop("models", None)
11401147
self.datasets = kwargs.pop("datasets", None)
1141-
1148+
self.xet_enabled = kwargs.pop("xetEnabled", None)
11421149
# backwards compatibility
11431150
self.lastModified = self.last_modified
11441151
self.cardData = self.card_data
@@ -1818,7 +1825,7 @@ def list_models(
18181825
expand (`List[ExpandModelProperty_T]`, *optional*):
18191826
List properties to return in the response. When used, only the properties in the list will be returned.
18201827
This parameter cannot be used if `full`, `cardData` or `fetch_config` are passed.
1821-
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"`.
1828+
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"`, `"resourceGroup"` and `"xetEnabled"`.
18221829
full (`bool`, *optional*):
18231830
Whether to fetch all model data, including the `last_modified`,
18241831
the `sha`, the files and the `tags`. This is set to `True` by
@@ -2038,7 +2045,7 @@ def list_datasets(
20382045
expand (`List[ExpandDatasetProperty_T]`, *optional*):
20392046
List properties to return in the response. When used, only the properties in the list will be returned.
20402047
This parameter cannot be used if `full` is passed.
2041-
Possible values are `"author"`, `"cardData"`, `"citation"`, `"createdAt"`, `"disabled"`, `"description"`, `"downloads"`, `"downloadsAllTime"`, `"gated"`, `"lastModified"`, `"likes"`, `"paperswithcode_id"`, `"private"`, `"siblings"`, `"sha"`, `"tags"`, `"trendingScore"`, `"usedStorage"` and `"resourceGroup"`.
2048+
Possible values are `"author"`, `"cardData"`, `"citation"`, `"createdAt"`, `"disabled"`, `"description"`, `"downloads"`, `"downloadsAllTime"`, `"gated"`, `"lastModified"`, `"likes"`, `"paperswithcode_id"`, `"private"`, `"siblings"`, `"sha"`, `"tags"`, `"trendingScore"`, `"usedStorage"`, `"resourceGroup"` and `"xetEnabled"`.
20422049
full (`bool`, *optional*):
20432050
Whether to fetch all dataset data, including the `last_modified`,
20442051
the `card_data` and the files. Can contain useful information such as the
@@ -2216,7 +2223,7 @@ def list_spaces(
22162223
expand (`List[ExpandSpaceProperty_T]`, *optional*):
22172224
List properties to return in the response. When used, only the properties in the list will be returned.
22182225
This parameter cannot be used if `full` is passed.
2219-
Possible values are `"author"`, `"cardData"`, `"datasets"`, `"disabled"`, `"lastModified"`, `"createdAt"`, `"likes"`, `"models"`, `"private"`, `"runtime"`, `"sdk"`, `"siblings"`, `"sha"`, `"subdomain"`, `"tags"`, `"trendingScore"`, `"usedStorage"` and `"resourceGroup"`.
2226+
Possible values are `"author"`, `"cardData"`, `"datasets"`, `"disabled"`, `"lastModified"`, `"createdAt"`, `"likes"`, `"models"`, `"private"`, `"runtime"`, `"sdk"`, `"siblings"`, `"sha"`, `"subdomain"`, `"tags"`, `"trendingScore"`, `"usedStorage"`, `"resourceGroup"` and `"xetEnabled"`.
22202227
full (`bool`, *optional*):
22212228
Whether to fetch all Spaces data, including the `last_modified`, `siblings`
22222229
and `card_data` fields.
@@ -2477,7 +2484,7 @@ def model_info(
24772484
expand (`List[ExpandModelProperty_T]`, *optional*):
24782485
List properties to return in the response. When used, only the properties in the list will be returned.
24792486
This parameter cannot be used if `securityStatus` or `files_metadata` are passed.
2480-
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"`.
2487+
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"`, `"resourceGroup"` and `"xetEnabled"`.
24812488
token (Union[bool, str, None], optional):
24822489
A valid user access token (string). Defaults to the locally saved
24832490
token, which is the recommended method for authentication (see
@@ -2551,7 +2558,7 @@ def dataset_info(
25512558
expand (`List[ExpandDatasetProperty_T]`, *optional*):
25522559
List properties to return in the response. When used, only the properties in the list will be returned.
25532560
This parameter cannot be used if `files_metadata` is passed.
2554-
Possible values are `"author"`, `"cardData"`, `"citation"`, `"createdAt"`, `"disabled"`, `"description"`, `"downloads"`, `"downloadsAllTime"`, `"gated"`, `"lastModified"`, `"likes"`, `"paperswithcode_id"`, `"private"`, `"siblings"`, `"sha"`, `"tags"`, `"trendingScore"`,`"usedStorage"` and `"resourceGroup"`.
2561+
Possible values are `"author"`, `"cardData"`, `"citation"`, `"createdAt"`, `"disabled"`, `"description"`, `"downloads"`, `"downloadsAllTime"`, `"gated"`, `"lastModified"`, `"likes"`, `"paperswithcode_id"`, `"private"`, `"siblings"`, `"sha"`, `"tags"`, `"trendingScore"`,`"usedStorage"`, `"resourceGroup"` and `"xetEnabled"`.
25552562
token (Union[bool, str, None], optional):
25562563
A valid user access token (string). Defaults to the locally saved
25572564
token, which is the recommended method for authentication (see
@@ -2624,7 +2631,7 @@ def space_info(
26242631
expand (`List[ExpandSpaceProperty_T]`, *optional*):
26252632
List properties to return in the response. When used, only the properties in the list will be returned.
26262633
This parameter cannot be used if `full` is passed.
2627-
Possible values are `"author"`, `"cardData"`, `"createdAt"`, `"datasets"`, `"disabled"`, `"lastModified"`, `"likes"`, `"models"`, `"private"`, `"runtime"`, `"sdk"`, `"siblings"`, `"sha"`, `"subdomain"`, `"tags"`, `"trendingScore"`, `"usedStorage"` and `"resourceGroup"`.
2634+
Possible values are `"author"`, `"cardData"`, `"createdAt"`, `"datasets"`, `"disabled"`, `"lastModified"`, `"likes"`, `"models"`, `"private"`, `"runtime"`, `"sdk"`, `"siblings"`, `"sha"`, `"subdomain"`, `"tags"`, `"trendingScore"`, `"usedStorage"`, `"resourceGroup"` and `"xetEnabled"`.
26282635
token (Union[bool, str, None], optional):
26292636
A valid user access token (string). Defaults to the locally saved
26302637
token, which is the recommended method for authentication (see

0 commit comments

Comments
 (0)