Skip to content

Commit f59b67f

Browse files
Remove logic to copy config files to user bucket
1 parent 6150d20 commit f59b67f

File tree

2 files changed

+0
-23
lines changed

2 files changed

+0
-23
lines changed

ads/aqua/model/model.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
LifecycleStatus,
3030
_build_resource_identifier,
3131
cleanup_local_hf_model_artifact,
32-
copy_model_config,
3332
create_word_icon,
3433
generate_tei_cmd_var,
3534
get_artifact_path,
@@ -969,24 +968,6 @@ def _create_model_catalog_entry(
969968
)
970969
tags[Tags.LICENSE] = validation_result.tags.get(Tags.LICENSE, UNKNOWN)
971970

972-
try:
973-
# If verified model already has a artifact json, use that.
974-
artifact_path = metadata.get(MODEL_BY_REFERENCE_OSS_PATH_KEY).value
975-
logger.info(
976-
f"Found model artifact in the service bucket. "
977-
f"Using artifact from service bucket instead of {os_path}."
978-
)
979-
980-
# todo: implement generic copy_folder method
981-
# copy model config from artifact path to user bucket
982-
copy_model_config(
983-
artifact_path=artifact_path, os_path=os_path, auth=default_signer()
984-
)
985-
except Exception:
986-
logger.debug(
987-
f"Proceeding with model registration without copying model config files at {os_path}. "
988-
f"Default configuration will be used for deployment and fine-tuning."
989-
)
990971
# Set artifact location to user bucket, and replace existing key if present.
991972
metadata.add(
992973
key=MODEL_BY_REFERENCE_OSS_PATH_KEY,

tests/unitary/with_extras/aqua/test_model.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,6 @@ def test_get_model_fine_tuned(
665665
@patch("ads.model.datascience_model.DataScienceModel.sync")
666666
@patch("ads.model.datascience_model.DataScienceModel.upload_artifact")
667667
@patch.object(AquaModelApp, "_find_matching_aqua_model")
668-
@patch("ads.aqua.common.utils.copy_file")
669668
@patch("ads.common.object_storage_details.ObjectStorageDetails.list_objects")
670669
@patch("ads.aqua.common.utils.load_config", return_value={})
671670
@patch("huggingface_hub.snapshot_download")
@@ -676,7 +675,6 @@ def test_import_verified_model(
676675
mock_snapshot_download,
677676
mock_load_config,
678677
mock_list_objects,
679-
mock_copy_file,
680678
mock__find_matching_aqua_model,
681679
mock_upload_artifact,
682680
mock_sync,
@@ -788,8 +786,6 @@ def test_import_verified_model(
788786
mock_subprocess.assert_not_called()
789787
mock_load_config.assert_called()
790788

791-
if not artifact_location_set:
792-
mock_copy_file.assert_called()
793789
ds_freeform_tags.pop(
794790
"ready_to_import"
795791
) # The imported model should not have this tag

0 commit comments

Comments
 (0)