Skip to content

Commit 48b975c

Browse files
update config and cache delete method
1 parent 9e8e5d7 commit 48b975c

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

ads/aqua/config/evaluation/evaluation_service_config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ def search_shapes(
224224

225225
class Config:
226226
extra = "ignore"
227+
protected_namespaces = ()
227228

228229

229230
class EvaluationServiceConfig(Serializable):

ads/aqua/extension/model_handler.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def read(self, model_id):
6868
return self.finish(AquaModelApp().get(model_id))
6969

7070
@handle_exceptions
71-
def delete(self):
71+
def delete(self, id=""):
7272
"""Handles DELETE request for clearing cache"""
7373
url_parse = urlparse(self.request.path)
7474
paths = url_parse.path.strip("/")
@@ -177,10 +177,8 @@ def _find_matching_aqua_model(model_id: str) -> Optional[AquaModelSummary]:
177177

178178
return None
179179

180-
181-
182180
@handle_exceptions
183-
def get(self,*args, **kwargs):
181+
def get(self, *args, **kwargs):
184182
"""
185183
Finds a list of matching models from hugging face based on query string provided from users.
186184
@@ -194,13 +192,11 @@ def get(self,*args, **kwargs):
194192
Returns the matching model ids string
195193
"""
196194

197-
query=self.get_argument("query",default=None)
195+
query = self.get_argument("query", default=None)
198196
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})
204200

205201
@handle_exceptions
206202
def post(self, *args, **kwargs):

0 commit comments

Comments
 (0)