File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -171,6 +171,18 @@ def list_models(
171171
172172 >>> # List only the models from the AllenNLP library
173173 >>> api.list_models(filter="allennlp")
174+ sort (:obj:`Literal["lastModified"]` or :obj:`str`, `optional`):
175+ The key with which to sort the resulting models. Possible values are the properties of the `ModelInfo`
176+ class.
177+ direction (:obj:`Literal[-1]` or :obj:`int`, `optional`):
178+ Direction in which to sort. The value `-1` sorts by descending order while all other values
179+ sort by ascending order.
180+ limit (:obj:`int`, `optional`):
181+ The limit on the number of models fetched. Leaving this option to `None` fetches all models.
182+ full (:obj:`bool`, `optional`):
183+ Whether to fetch all model data, including the `lastModified`, the `sha`, the files and the `tags`.
184+ This is set to `True` by default when using a filter.
185+
174186 """
175187 path = "{}/api/models" .format (self .endpoint )
176188 params = {}
@@ -184,7 +196,10 @@ def list_models(
184196 if limit is not None :
185197 params .update ({"limit" : limit })
186198 if full is not None :
187- params .update ({"full" : full })
199+ if full :
200+ params .update ({"full" : True })
201+ elif "full" in params :
202+ del params ["full" ]
188203 r = requests .get (path , params = params )
189204 r .raise_for_status ()
190205 d = r .json ()
You can’t perform that action at this time.
0 commit comments