Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ads/aqua/extension/model_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def post(self, *args, **kwargs): # noqa: ARG002
)
local_dir = input_data.get("local_dir")
cleanup_model_cache = (
str(input_data.get("cleanup_model_cache", "true")).lower() == "true"
str(input_data.get("cleanup_model_cache", "false")).lower() == "true"
)
inference_container_uri = input_data.get("inference_container_uri")
allow_patterns = input_data.get("allow_patterns")
Expand Down
2 changes: 1 addition & 1 deletion ads/aqua/model/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ class ImportModelDetails(CLIBuilderMixin):
os_path: str
download_from_hf: Optional[bool] = True
local_dir: Optional[str] = None
cleanup_model_cache: Optional[bool] = True
cleanup_model_cache: Optional[bool] = False
inference_container: Optional[str] = None
finetuning_container: Optional[str] = None
compartment_id: Optional[str] = None
Expand Down
13 changes: 7 additions & 6 deletions tests/unitary/with_extras/aqua/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1228,22 +1228,22 @@ def test_import_model_with_input_tags(
"model": "oracle/oracle-1it",
"inference_container": "odsc-vllm-serving",
},
"ads aqua model register --model oracle/oracle-1it --os_path oci://aqua-bkt@aqua-ns/path --download_from_hf True --cleanup_model_cache True --inference_container odsc-vllm-serving",
"ads aqua model register --model oracle/oracle-1it --os_path oci://aqua-bkt@aqua-ns/path --download_from_hf True --cleanup_model_cache False --inference_container odsc-vllm-serving",
),
(
{
"os_path": "oci://aqua-bkt@aqua-ns/path",
"model": "ocid1.datasciencemodel.oc1.iad.<OCID>",
},
"ads aqua model register --model ocid1.datasciencemodel.oc1.iad.<OCID> --os_path oci://aqua-bkt@aqua-ns/path --download_from_hf True --cleanup_model_cache True",
"ads aqua model register --model ocid1.datasciencemodel.oc1.iad.<OCID> --os_path oci://aqua-bkt@aqua-ns/path --download_from_hf True --cleanup_model_cache False",
),
(
{
"os_path": "oci://aqua-bkt@aqua-ns/path",
"model": "oracle/oracle-1it",
"download_from_hf": False,
},
"ads aqua model register --model oracle/oracle-1it --os_path oci://aqua-bkt@aqua-ns/path --download_from_hf False --cleanup_model_cache True",
"ads aqua model register --model oracle/oracle-1it --os_path oci://aqua-bkt@aqua-ns/path --download_from_hf False --cleanup_model_cache False",
),
(
{
Expand All @@ -1252,7 +1252,7 @@ def test_import_model_with_input_tags(
"download_from_hf": True,
"model_file": "test_model_file",
},
"ads aqua model register --model oracle/oracle-1it --os_path oci://aqua-bkt@aqua-ns/path --download_from_hf True --cleanup_model_cache True --model_file test_model_file",
"ads aqua model register --model oracle/oracle-1it --os_path oci://aqua-bkt@aqua-ns/path --download_from_hf True --cleanup_model_cache False --model_file test_model_file",
),
(
{
Expand All @@ -1261,7 +1261,7 @@ def test_import_model_with_input_tags(
"inference_container": "odsc-tei-serving",
"inference_container_uri": "<region>.ocir.io/<your_tenancy>/<your_image>",
},
"ads aqua model register --model oracle/oracle-1it --os_path oci://aqua-bkt@aqua-ns/path --download_from_hf True --cleanup_model_cache True --inference_container odsc-tei-serving --inference_container_uri <region>.ocir.io/<your_tenancy>/<your_image>",
"ads aqua model register --model oracle/oracle-1it --os_path oci://aqua-bkt@aqua-ns/path --download_from_hf True --cleanup_model_cache False --inference_container odsc-tei-serving --inference_container_uri <region>.ocir.io/<your_tenancy>/<your_image>",
),
(
{
Expand All @@ -1272,7 +1272,7 @@ def test_import_model_with_input_tags(
"defined_tags": {"dtag1": "dvalue1", "dtag2": "dvalue2"},
},
"ads aqua model register --model oracle/oracle-1it --os_path oci://aqua-bkt@aqua-ns/path "
"--download_from_hf True --cleanup_model_cache True --inference_container odsc-vllm-serving --freeform_tags "
"--download_from_hf True --cleanup_model_cache False --inference_container odsc-vllm-serving --freeform_tags "
'{"ftag1": "fvalue1", "ftag2": "fvalue2"} --defined_tags {"dtag1": "dvalue1", "dtag2": "dvalue2"}',
),
(
Expand All @@ -1281,6 +1281,7 @@ def test_import_model_with_input_tags(
"model": "oracle/oracle-1it",
"inference_container": "odsc-vllm-serving",
"ignore_model_artifact_check": True,
"cleanup_model_cache": True,
},
"ads aqua model register --model oracle/oracle-1it --os_path oci://aqua-bkt@aqua-ns/path --download_from_hf True --cleanup_model_cache True --inference_container odsc-vllm-serving --ignore_model_artifact_check True",
),
Expand Down
2 changes: 1 addition & 1 deletion tests/unitary/with_extras/aqua/test_model_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def test_register(
model_file=model_file,
download_from_hf=download_from_hf,
local_dir=None,
cleanup_model_cache=True,
cleanup_model_cache=False,
inference_container_uri=inference_container_uri,
allow_patterns=allow_patterns,
ignore_patterns=ignore_patterns,
Expand Down