From 6ec61b3f0ef8d317673a23acd5c2135851eee639 Mon Sep 17 00:00:00 2001 From: Vipul Date: Tue, 11 Jun 2024 13:25:51 -0700 Subject: [PATCH] update artifact location metadata --- ads/aqua/finetuning/finetuning.py | 1 + ads/aqua/model/model.py | 18 +++++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ads/aqua/finetuning/finetuning.py b/ads/aqua/finetuning/finetuning.py index edba3d66e..89eb07f6d 100644 --- a/ads/aqua/finetuning/finetuning.py +++ b/ads/aqua/finetuning/finetuning.py @@ -366,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)