|
11 | 11 |
|
12 | 12 | from ads.aqua import ODSC_MODEL_COMPARTMENT_OCID |
13 | 13 | from ads.aqua.app import AquaApp |
14 | | -from ads.aqua.common.enums import Tags |
| 14 | +from ads.aqua.common.enums import Tags, InferenceContainerTypeFamily |
15 | 15 | from ads.aqua.common.errors import AquaRuntimeError |
16 | 16 | from ads.aqua.common.utils import ( |
17 | | - copy_model_config, |
18 | 17 | create_word_icon, |
19 | 18 | get_artifact_path, |
20 | | - load_config, |
21 | 19 | read_file, |
| 20 | + copy_model_config, |
| 21 | + load_config, |
22 | 22 | ) |
23 | 23 | from ads.aqua.constants import ( |
24 | | - AQUA_MODEL_ARTIFACT_CONFIG, |
25 | | - AQUA_MODEL_ARTIFACT_CONFIG_MODEL_NAME, |
26 | | - AQUA_MODEL_ARTIFACT_CONFIG_MODEL_TYPE, |
27 | | - AQUA_MODEL_TYPE_CUSTOM, |
28 | 24 | LICENSE_TXT, |
29 | 25 | MODEL_BY_REFERENCE_OSS_PATH_KEY, |
30 | 26 | README, |
|
36 | 32 | UNKNOWN, |
37 | 33 | VALIDATION_METRICS, |
38 | 34 | VALIDATION_METRICS_FINAL, |
| 35 | + AQUA_MODEL_ARTIFACT_CONFIG, |
| 36 | + AQUA_MODEL_ARTIFACT_CONFIG_MODEL_NAME, |
| 37 | + AQUA_MODEL_ARTIFACT_CONFIG_MODEL_TYPE, |
| 38 | + AQUA_MODEL_TYPE_CUSTOM, ARM_CPU, NVIDIA_GPU, |
39 | 39 | ) |
40 | 40 | from ads.aqua.model.constants import * |
41 | 41 | from ads.aqua.model.entities import * |
@@ -235,7 +235,7 @@ def get(self, model_id: str, load_model_card: Optional[bool] = True) -> "AquaMod |
235 | 235 | try: |
236 | 236 | jobrun_ocid = ds_model.provenance_metadata.training_id |
237 | 237 | jobrun = self.ds_client.get_job_run(jobrun_ocid).data |
238 | | - except Exception: |
| 238 | + except Exception as e: |
239 | 239 | logger.debug( |
240 | 240 | f"Missing jobrun information in the provenance metadata of the given model {model_id}." |
241 | 241 | ) |
@@ -580,16 +580,15 @@ def _create_model_catalog_entry( |
580 | 580 | { |
581 | 581 | **verified_model.freeform_tags, |
582 | 582 | Tags.AQUA_SERVICE_MODEL_TAG: verified_model.id, |
583 | | - Tags.PLATFORM: "cpu" if is_gguf_model else "gpu", |
584 | 583 | } |
585 | 584 | if verified_model |
586 | 585 | else { |
587 | 586 | Tags.AQUA_TAG: "active", |
588 | 587 | Tags.BASE_MODEL_CUSTOM: "true", |
589 | | - Tags.PLATFORM: "cpu" if is_gguf_model else "gpu", |
590 | 588 | } |
591 | 589 | ) |
592 | 590 | tags.update({Tags.BASE_MODEL_CUSTOM: "true"}) |
| 591 | + tags.update({Tags.PLATFORM: ARM_CPU if is_gguf_model else NVIDIA_GPU}) |
593 | 592 |
|
594 | 593 | # Remove `ready_to_import` tag that might get copied from service model. |
595 | 594 | tags.pop(Tags.READY_TO_IMPORT, None) |
@@ -700,7 +699,8 @@ def register( |
700 | 699 | model_config = None |
701 | 700 | if not import_model_details: |
702 | 701 | import_model_details = ImportModelDetails(**kwargs) |
703 | | - is_gguf_model = import_model_details.inference_container == "odsc-llama-cpp" |
| 702 | + is_gguf_model = import_model_details.inference_container == InferenceContainerTypeFamily.AQUA_LLAMA_CPP_CONTAINER_FAMILY |
| 703 | + platform = ARM_CPU if is_gguf_model else NVIDIA_GPU |
704 | 704 | if not is_gguf_model: |
705 | 705 | try: |
706 | 706 | model_config = load_config( |
@@ -792,7 +792,6 @@ def register( |
792 | 792 | except: |
793 | 793 | finetuning_container = None |
794 | 794 |
|
795 | | - platform = "cpu" if is_gguf_model else "gpu" |
796 | 795 | aqua_model_attributes = dict( |
797 | 796 | **self._process_model(ds_model, self.region), |
798 | 797 | project_id=ds_model.project_id, |
|
0 commit comments