Skip to content

Commit 82d1ae2

Browse files
update model and deployment handlers
1 parent e203222 commit 82d1ae2

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

ads/aqua/extension/deployment_handler.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def delete(self, model_deployment_id):
5959
return self.finish(AquaDeploymentApp().delete(model_deployment_id))
6060

6161
@handle_exceptions
62-
def put(self, *args, **kwargs):
62+
def put(self, *args, **kwargs): # noqa: ARG002
6363
"""
6464
Handles put request for the activating and deactivating OCI datascience model deployments
6565
Raises
@@ -82,7 +82,7 @@ def put(self, *args, **kwargs):
8282
raise HTTPError(400, f"The request {self.request.path} is invalid.")
8383

8484
@handle_exceptions
85-
def post(self, *args, **kwargs):
85+
def post(self, *args, **kwargs): # noqa: ARG002
8686
"""
8787
Handles post request for the deployment APIs
8888
Raises
@@ -132,6 +132,8 @@ def post(self, *args, **kwargs):
132132
private_endpoint_id = input_data.get("private_endpoint_id")
133133
container_image_uri = input_data.get("container_image_uri")
134134
cmd_var = input_data.get("cmd_var")
135+
freeform_tags = input_data.get("freeform_tags")
136+
defined_tags = input_data.get("defined_tags")
135137

136138
self.finish(
137139
AquaDeploymentApp().create(
@@ -157,6 +159,8 @@ def post(self, *args, **kwargs):
157159
private_endpoint_id=private_endpoint_id,
158160
container_image_uri=container_image_uri,
159161
cmd_var=cmd_var,
162+
freeform_tags=freeform_tags,
163+
defined_tags=defined_tags,
160164
)
161165
)
162166

@@ -196,7 +200,7 @@ def validate_predict_url(endpoint):
196200
return False
197201

198202
@handle_exceptions
199-
def post(self, *args, **kwargs):
203+
def post(self, *args, **kwargs): # noqa: ARG002
200204
"""
201205
Handles inference request for the Active Model Deployments
202206
Raises
@@ -262,7 +266,7 @@ def get(self, model_id):
262266
)
263267

264268
@handle_exceptions
265-
def post(self, *args, **kwargs):
269+
def post(self, *args, **kwargs): # noqa: ARG002
266270
"""Handles post request for the deployment param handler API.
267271
268272
Raises

ads/aqua/extension/model_handler.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def list(self):
9696
)
9797

9898
@handle_exceptions
99-
def post(self, *args, **kwargs):
99+
def post(self, *args, **kwargs): # noqa: ARG002
100100
"""
101101
Handles post request for the registering any Aqua model.
102102
Raises
@@ -131,6 +131,8 @@ def post(self, *args, **kwargs):
131131
inference_container_uri = input_data.get("inference_container_uri")
132132
allow_patterns = input_data.get("allow_patterns")
133133
ignore_patterns = input_data.get("ignore_patterns")
134+
freeform_tags = input_data.get("freeform_tags")
135+
defined_tags = input_data.get("defined_tags")
134136

135137
return self.finish(
136138
AquaModelApp().register(
@@ -145,6 +147,8 @@ def post(self, *args, **kwargs):
145147
inference_container_uri=inference_container_uri,
146148
allow_patterns=allow_patterns,
147149
ignore_patterns=ignore_patterns,
150+
freeform_tags=freeform_tags,
151+
defined_tags=defined_tags,
148152
)
149153
)
150154

@@ -170,11 +174,9 @@ def put(self, id):
170174

171175
enable_finetuning = input_data.get("enable_finetuning")
172176
task = input_data.get("task")
173-
app=AquaModelApp()
177+
app = AquaModelApp()
174178
self.finish(
175-
app.edit_registered_model(
176-
id, inference_container, enable_finetuning, task
177-
)
179+
app.edit_registered_model(id, inference_container, enable_finetuning, task)
178180
)
179181
app.clear_model_details_cache(model_id=id)
180182

@@ -218,7 +220,7 @@ def _find_matching_aqua_model(model_id: str) -> Optional[AquaModelSummary]:
218220
return None
219221

220222
@handle_exceptions
221-
def get(self, *args, **kwargs):
223+
def get(self, *args, **kwargs): # noqa: ARG002
222224
"""
223225
Finds a list of matching models from hugging face based on query string provided from users.
224226
@@ -239,7 +241,7 @@ def get(self, *args, **kwargs):
239241
return self.finish({"models": models})
240242

241243
@handle_exceptions
242-
def post(self, *args, **kwargs):
244+
def post(self, *args, **kwargs): # noqa: ARG002
243245
"""Handles post request for the HF Models APIs
244246
245247
Raises

0 commit comments

Comments
 (0)