@@ -718,13 +718,17 @@ class ModelInfo:
718
718
Is the repo private.
719
719
disabled (`bool`, *optional*):
720
720
Is the repo disabled.
721
- gated (`Literal["auto", "manual", False]`, *optional*):
722
- Is the repo gated.
723
- If so, whether there is manual or automatic approval.
724
721
downloads (`int`):
725
722
Number of downloads of the model over the last 30 days.
726
723
downloads_all_time (`int`):
727
724
Cumulated number of downloads of the model since its creation.
725
+ gated (`Literal["auto", "manual", False]`, *optional*):
726
+ Is the repo gated.
727
+ If so, whether there is manual or automatic approval.
728
+ inference (`Literal["cold", "frozen", "warm"]`, *optional*):
729
+ Status of the model on the inference API.
730
+ Warm models are available for immediate use. Cold models will be loaded on first inference call.
731
+ Frozen models are not available in Inference API.
728
732
likes (`int`):
729
733
Number of likes of the model.
730
734
library_name (`str`, *optional*):
@@ -760,10 +764,11 @@ class ModelInfo:
760
764
created_at : Optional [datetime ]
761
765
last_modified : Optional [datetime ]
762
766
private : Optional [bool ]
763
- gated : Optional [Literal ["auto" , "manual" , False ]]
764
767
disabled : Optional [bool ]
765
768
downloads : Optional [int ]
766
769
downloads_all_time : Optional [int ]
770
+ gated : Optional [Literal ["auto" , "manual" , False ]]
771
+ inference : Optional [Literal ["warm" , "cold" , "frozen" ]]
767
772
likes : Optional [int ]
768
773
library_name : Optional [str ]
769
774
tags : Optional [List [str ]]
@@ -793,6 +798,7 @@ def __init__(self, **kwargs):
793
798
self .downloads_all_time = kwargs .pop ("downloadsAllTime" , None )
794
799
self .likes = kwargs .pop ("likes" , None )
795
800
self .library_name = kwargs .pop ("library_name" , None )
801
+ self .inference = kwargs .pop ("inference" , None )
796
802
self .tags = kwargs .pop ("tags" , None )
797
803
self .pipeline_tag = kwargs .pop ("pipeline_tag" , None )
798
804
self .mask_token = kwargs .pop ("mask_token" , None )
@@ -1611,6 +1617,7 @@ def list_models(
1611
1617
filter : Union [str , Iterable [str ], None ] = None ,
1612
1618
author : Optional [str ] = None ,
1613
1619
gated : Optional [bool ] = None ,
1620
+ inference : Optional [Literal ["cold" , "frozen" , "warm" ]] = None ,
1614
1621
library : Optional [Union [str , List [str ]]] = None ,
1615
1622
language : Optional [Union [str , List [str ]]] = None ,
1616
1623
model_name : Optional [str ] = None ,
@@ -1639,11 +1646,15 @@ def list_models(
1639
1646
A string or list of string to filter models on the Hub.
1640
1647
author (`str`, *optional*):
1641
1648
A string which identify the author (user or organization) of the
1642
- returned models
1649
+ returned models.
1643
1650
gated (`bool`, *optional*):
1644
1651
A boolean to filter models on the Hub that are gated or not. By default, all models are returned.
1645
1652
If `gated=True` is passed, only gated models are returned.
1646
1653
If `gated=False` is passed, only non-gated models are returned.
1654
+ inference (`Literal["cold", "frozen", "warm"]`, *optional*):
1655
+ A string to filter models on the Hub by their state on the Inference API.
1656
+ Warm models are available for immediate use. Cold models will be loaded on first inference call.
1657
+ Frozen models are not available in Inference API.
1647
1658
library (`str` or `List`, *optional*):
1648
1659
A string or list of strings of foundational libraries models were
1649
1660
originally trained from, such as pytorch, tensorflow, or allennlp.
@@ -1771,6 +1782,8 @@ def list_models(
1771
1782
params ["author" ] = author
1772
1783
if gated is not None :
1773
1784
params ["gated" ] = gated
1785
+ if inference is not None :
1786
+ params ["inference" ] = inference
1774
1787
if pipeline_tag :
1775
1788
params ["pipeline_tag" ] = pipeline_tag
1776
1789
search_list = []
0 commit comments