Skip to content

Commit 787c067

Browse files
adding task validation
1 parent 2702376 commit 787c067

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

ads/aqua/extension/model_handler.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,6 @@ def post(self, *args, **kwargs):
120120
os_path = input_data.get("os_path")
121121
if not os_path:
122122
raise HTTPError(400, Errors.MISSING_REQUIRED_PARAMETER.format("os_path"))
123-
task = input_data.get("task")
124-
if task not in get_valid_tasks():
125-
raise HTTPError(400, Errors.INVALID_VALUE_OF_PARAMETER.format("task"))
126123

127124
inference_container = input_data.get("inference_container")
128125
finetuning_container = input_data.get("finetuning_container")
@@ -142,7 +139,6 @@ def post(self, *args, **kwargs):
142139
compartment_id=compartment_id,
143140
project_id=project_id,
144141
model_file=model_file,
145-
task=task,
146142
)
147143
)
148144

ads/aqua/model/entities.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,6 @@ class ImportModelDetails(CLIBuilderMixin):
284284
local_dir: Optional[str] = None
285285
inference_container: Optional[str] = None
286286
finetuning_container: Optional[str] = None
287-
task: Optional[str] = None
288287
compartment_id: Optional[str] = None
289288
project_id: Optional[str] = None
290289
model_file: Optional[str] = None

ads/aqua/model/model.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
read_file,
3434
upload_folder,
3535
)
36+
from ads.aqua.config.config import get_valid_tasks
3637
from ads.aqua.constants import (
3738
AQUA_MODEL_ARTIFACT_CONFIG,
3839
AQUA_MODEL_ARTIFACT_CONFIG_MODEL_NAME,
@@ -735,7 +736,6 @@ def _create_model_catalog_entry(
735736
model_name: str,
736737
inference_container: str,
737738
finetuning_container: str,
738-
task: Optional[str],
739739
verified_model: DataScienceModel,
740740
validation_result: ModelValidationResult,
741741
compartment_id: Optional[str],
@@ -768,7 +768,7 @@ def _create_model_catalog_entry(
768768
}
769769
)
770770
tags.update({Tags.BASE_MODEL_CUSTOM: "true"})
771-
771+
logger.info(f"tags: {tags}")
772772
if validation_result and validation_result.model_formats:
773773
tags.update(
774774
{
@@ -781,7 +781,7 @@ def _create_model_catalog_entry(
781781

782782
# Remove `ready_to_import` tag that might get copied from service model.
783783
tags.pop(Tags.READY_TO_IMPORT, None)
784-
784+
logger.info(f"tags: {tags}")
785785
if verified_model:
786786
# Verified model is a model in the service catalog that either has no artifacts but contains all the necessary metadata for deploying and fine tuning.
787787
# If set, then we copy all the model metadata.
@@ -791,7 +791,6 @@ def _create_model_catalog_entry(
791791
json_dict=verified_model.model_file_description
792792
)
793793
else:
794-
tags.update({Tags.TASK: task})
795794
metadata = ModelCustomMetadata()
796795
if not inference_container:
797796
raise AquaRuntimeError(
@@ -864,6 +863,7 @@ def _create_model_catalog_entry(
864863
category="Other",
865864
replace=True,
866865
)
866+
logger.info(f"tags: {tags}")
867867
model = (
868868
model.with_custom_metadata_list(metadata)
869869
.with_compartment_id(compartment_id or COMPARTMENT_OCID)
@@ -1332,13 +1332,13 @@ def register(
13321332
else:
13331333
artifact_path = import_model_details.os_path.rstrip("/")
13341334

1335+
logger.info(f"task: {import_model_details.task}")
13351336
# Create Model catalog entry with pass by reference
13361337
ds_model = self._create_model_catalog_entry(
13371338
os_path=artifact_path,
13381339
model_name=model_name,
13391340
inference_container=import_model_details.inference_container,
13401341
finetuning_container=import_model_details.finetuning_container,
1341-
task=import_model_details.task,
13421342
verified_model=verified_model,
13431343
validation_result=validation_result,
13441344
compartment_id=import_model_details.compartment_id,

0 commit comments

Comments
 (0)