Skip to content

Commit 37a46a8

Browse files
authored
skip prompt when file is already uploaded to os (#861)
1 parent 2502185 commit 37a46a8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ads/aqua/common/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ def upload_folder(os_path: str, local_dir: str, model_name: str) -> str:
739739
raise ValueError(f"Version is not enabled at object storage location {os_path}")
740740
auth_state = AuthState()
741741
object_path = os_details.filepath.rstrip("/") + "/" + model_name + "/"
742-
command = f"oci os object bulk-upload --src-dir {local_dir} --prefix {object_path} -bn {os_details.bucket} -ns {os_details.namespace} --auth {auth_state.oci_iam_type} --profile {auth_state.oci_key_profile}"
742+
command = f"oci os object bulk-upload --src-dir {local_dir} --prefix {object_path} -bn {os_details.bucket} -ns {os_details.namespace} --auth {auth_state.oci_iam_type} --profile {auth_state.oci_key_profile} --no-overwrite"
743743
try:
744744
logger.info(f"Running: {command}")
745745
subprocess.check_call(shlex.split(command))

tests/unitary/with_extras/aqua/test_model.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ def test_import_verified_model(
613613
mock_copy_file.assert_called()
614614
mock_subprocess.assert_called_with(
615615
shlex.split(
616-
f"oci os object bulk-upload --src-dir {str(tmpdir)}/{hf_model} --prefix prefix/path/{hf_model}/ -bn aqua-bkt -ns aqua-ns --auth api_key --profile DEFAULT"
616+
f"oci os object bulk-upload --src-dir {str(tmpdir)}/{hf_model} --prefix prefix/path/{hf_model}/ -bn aqua-bkt -ns aqua-ns --auth api_key --profile DEFAULT --no-overwrite"
617617
)
618618
)
619619
ds_freeform_tags.pop(
@@ -818,7 +818,7 @@ def test_import_any_hf_model_custom_container(
818818
)
819819
mock_subprocess.assert_called_with(
820820
shlex.split(
821-
f"oci os object bulk-upload --src-dir {str(tmpdir)}/{hf_model} --prefix prefix/path/{hf_model}/ -bn aqua-bkt -ns aqua-ns --auth api_key --profile DEFAULT"
821+
f"oci os object bulk-upload --src-dir {str(tmpdir)}/{hf_model} --prefix prefix/path/{hf_model}/ -bn aqua-bkt -ns aqua-ns --auth api_key --profile DEFAULT --no-overwrite"
822822
)
823823
)
824824
assert model.freeform_tags == {
@@ -934,7 +934,7 @@ def test_import_any_hf_model_smc_container(
934934
)
935935
mock_subprocess.assert_called_with(
936936
shlex.split(
937-
f"oci os object bulk-upload --src-dir {str(tmpdir)}/{hf_model} --prefix prefix/path/{hf_model}/ -bn aqua-bkt -ns aqua-ns --auth api_key --profile DEFAULT"
937+
f"oci os object bulk-upload --src-dir {str(tmpdir)}/{hf_model} --prefix prefix/path/{hf_model}/ -bn aqua-bkt -ns aqua-ns --auth api_key --profile DEFAULT --no-overwrite"
938938
)
939939
)
940940
assert model.freeform_tags == {

0 commit comments

Comments
 (0)