diff --git a/ads/aqua/common/utils.py b/ads/aqua/common/utils.py index 369b62aae..de98dc45e 100644 --- a/ads/aqua/common/utils.py +++ b/ads/aqua/common/utils.py @@ -668,23 +668,26 @@ def get_model_by_reference_paths(model_file_description: dict): fine_tune_output_path = UNKNOWN models = model_file_description["models"] - for model in models: - namespace, bucket_name, prefix = ( - model["namespace"], - model["bucketName"], - model["prefix"], + if not models: + raise AquaValueError( + f"Model path is not available in the model json artifact. " + f"Please check if the model created by reference has the correct artifact." ) - bucket_uri = f"oci://{bucket_name}@{namespace}/{prefix}".rstrip("/") - if bucket_name == AQUA_SERVICE_MODELS_BUCKET: - base_model_path = bucket_uri - else: - fine_tune_output_path = bucket_uri - if not base_model_path: - raise AquaValueError( - f"Base Model should come from the bucket {AQUA_SERVICE_MODELS_BUCKET}. " - f"Other paths are not supported by Aqua." + if len(models) > 0: + # since the model_file_description json does not have a flag to identify the base model, we consider + # the first instance to be the base model. + base_model_artifact = models[0] + base_model_path = f"oci://{base_model_artifact['bucketName']}@{base_model_artifact['namespace']}/{base_model_artifact['prefix']}".rstrip( + "/" ) + if len(models) > 1: + # second model is considered as fine-tuned model + ft_model_artifact = models[1] + fine_tune_output_path = f"oci://{ft_model_artifact['bucketName']}@{ft_model_artifact['namespace']}/{ft_model_artifact['prefix']}".rstrip( + "/" + ) + return base_model_path, fine_tune_output_path diff --git a/ads/aqua/finetuning/finetuning.py b/ads/aqua/finetuning/finetuning.py index 826d5df70..89eb07f6d 100644 --- a/ads/aqua/finetuning/finetuning.py +++ b/ads/aqua/finetuning/finetuning.py @@ -109,11 +109,13 @@ def create( ) source = self.get_source(create_fine_tuning_details.ft_source_id) - if source.compartment_id != ODSC_MODEL_COMPARTMENT_OCID: - raise AquaValueError( - f"Fine tuning is only supported for Aqua service models in {ODSC_MODEL_COMPARTMENT_OCID}. " - "Use a valid Aqua service model id instead." - ) + + # todo: revisit validation for fine tuned models + # if source.compartment_id != ODSC_MODEL_COMPARTMENT_OCID: + # raise AquaValueError( + # f"Fine tuning is only supported for Aqua service models in {ODSC_MODEL_COMPARTMENT_OCID}. " + # "Use a valid Aqua service model id instead." + # ) target_compartment = ( create_fine_tuning_details.compartment_id or COMPARTMENT_OCID @@ -364,6 +366,7 @@ def create( source_freeform_tags.pop(Tags.LICENSE, None) source_freeform_tags.update({Tags.READY_TO_FINE_TUNE: "false"}) source_freeform_tags.update({Tags.AQUA_TAG: UNKNOWN}) + source_freeform_tags.pop(Tags.BASE_MODEL_CUSTOM, None) self.update_model( model_id=ft_model.id, diff --git a/ads/aqua/model/model.py b/ads/aqua/model/model.py index d92a3ab63..a2dfe5025 100644 --- a/ads/aqua/model/model.py +++ b/ads/aqua/model/model.py @@ -648,15 +648,19 @@ def _create_model_catalog_entry( copy_model_config( artifact_path=artifact_path, os_path=os_path, auth=default_signer() ) - except: - # Add artifact from user bucket - metadata.add( - key=MODEL_BY_REFERENCE_OSS_PATH_KEY, - value=os_path, - description="artifact location", - category="Other", + logger.debug( + f"Proceeding with model registration without copying model config files at {os_path}. " + f"Default configuration will be used for deployment and fine-tuning." ) + # Set artifact location to user bucket, and replace existing key if present. + metadata.add( + key=MODEL_BY_REFERENCE_OSS_PATH_KEY, + value=os_path, + description="artifact location", + category="Other", + replace=True, + ) model = ( model.with_custom_metadata_list(metadata) diff --git a/docs/source/release_notes.rst b/docs/source/release_notes.rst index 0bb91d4d3..be4c3b6a2 100644 --- a/docs/source/release_notes.rst +++ b/docs/source/release_notes.rst @@ -2,6 +2,14 @@ Release Notes ============= +2.11.11 +------ +Release date: June 11, 2024 + +* Fixed the bug that led to timeout when loading config files during jupyterlab load. +* Fixed bugs and introduced enhancements following our recent release. + + 2.11.10 ------ Release date: June 5, 2024 diff --git a/pyproject.toml b/pyproject.toml index f999c9fac..809ef64be 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ build-backend = "flit_core.buildapi" # Required name = "oracle_ads" # the install (PyPI) name; name for local build in [tool.flit.module] section below -version = "2.11.10" +version = "2.11.11" # Optional description = "Oracle Accelerated Data Science SDK"