@@ -177,10 +177,8 @@ def _find_matching_aqua_model(model_id: str) -> Optional[AquaModelSummary]:
177
177
178
178
return None
179
179
180
-
181
-
182
180
@handle_exceptions
183
- def get (self ,* args , ** kwargs ):
181
+ def get (self , * args , ** kwargs ):
184
182
"""
185
183
Finds a list of matching models from hugging face based on query string provided from users.
186
184
@@ -194,13 +192,11 @@ def get(self,*args, **kwargs):
194
192
Returns the matching model ids string
195
193
"""
196
194
197
- query = self .get_argument ("query" ,default = None )
195
+ query = self .get_argument ("query" , default = None )
198
196
if not query :
199
- raise HTTPError (400 ,Errors .MISSING_REQUIRED_PARAMETER .format ("query" ))
200
- models = list_hf_models (query )
201
- return self .finish ({"models" :models })
202
-
203
-
197
+ raise HTTPError (400 , Errors .MISSING_REQUIRED_PARAMETER .format ("query" ))
198
+ models = list_hf_models (query )
199
+ return self .finish ({"models" : models })
204
200
205
201
@handle_exceptions
206
202
def post (self , * args , ** kwargs ):
@@ -235,9 +231,9 @@ def post(self, *args, **kwargs):
235
231
)
236
232
237
233
# Check pipeline_tag, it should be `text-generation`
238
- if (
239
- not hf_model_info .pipeline_tag
240
- or hf_model_info .pipeline_tag .lower () != ModelTask . TEXT_GENERATION
234
+ if not (
235
+ hf_model_info .pipeline_tag
236
+ and hf_model_info .pipeline_tag .lower () in ModelTask
241
237
):
242
238
raise AquaRuntimeError (
243
239
f"Unsupported pipeline tag for the chosen model: '{ hf_model_info .pipeline_tag } '. "
0 commit comments