Skip to content

Commit 1a0484e

Browse files
Rebasing
2 parents 6321fa8 + 7a41a71 commit 1a0484e

File tree

7 files changed

+10
-7
lines changed

7 files changed

+10
-7
lines changed

ads/model/artifact_downloader.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,10 @@ def _download(self):
170170
"""Downloads model artifacts."""
171171
self.progress.update("Importing model artifacts from catalog")
172172

173-
if self.dsc_model._is_model_by_reference() and self.model_file_description:
173+
if (
174+
self.dsc_model.is_model_created_by_reference()
175+
and self.model_file_description
176+
):
174177
self.download_from_model_file_description()
175178
self.progress.update()
176179
return

ads/model/datascience_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1793,7 +1793,7 @@ def _update_from_oci_dsc_model(
17931793
artifact_info["Content-Disposition"]
17941794
)
17951795

1796-
if self.dsc_model._is_model_by_reference():
1796+
if self.dsc_model.is_model_created_by_reference():
17971797
_, file_extension = os.path.splitext(file_name_info["filename"])
17981798
if file_extension.lower() == ".json":
17991799
bucket_uri, _ = self._download_file_description_artifact()

ads/model/service/oci_datascience_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ def from_id(cls, ocid: str) -> "OCIDataScienceModel":
605605
raise ValueError("Model OCID not provided.")
606606
return super().from_ocid(ocid)
607607

608-
def _is_model_by_reference(self):
608+
def is_model_created_by_reference(self):
609609
"""Checks if model is created by reference
610610
Returns
611611
-------

tests/unitary/default_setup/model/test_artifact_downloader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def test_download_large_artifact_from_model_file_description(self, mock_download
189189
"""Tests whether model_file_description is loaded within downloader and is parsed, and also if
190190
# download_from_model_file_description is appropriately called."""
191191

192-
self.mock_dsc_model._is_model_by_reference.return_value = True
192+
self.mock_dsc_model.is_model_created_by_reference.return_value = True
193193
self.mock_artifact_file_path = os.path.join(
194194
self.curr_dir, "test_files/model_description.json"
195195
)

tests/unitary/default_setup/model/test_datascience_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ def test__to_oci_dsc_model(self):
641641
True,
642642
],
643643
)
644-
@patch.object(OCIDataScienceModel, "_is_model_by_reference")
644+
@patch.object(OCIDataScienceModel, "is_model_created_by_reference")
645645
@patch.object(OCIDataScienceModel, "get_artifact_info")
646646
@patch.object(OCIDataScienceModel, "get_model_provenance")
647647
@patch.object(DataScienceModel, "_download_file_description_artifact")
Binary file not shown.

tests/unitary/default_setup/model/test_oci_datascience_model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ def test_is_model_by_reference(self):
476476
category="Other",
477477
)
478478
self.mock_model.custom_metadata_list = [metadata_item]
479-
assert not self.mock_model._is_model_by_reference()
479+
assert not self.mock_model.is_model_created_by_reference()
480480

481481
metadata_item = ModelCustomMetadataItem(
482482
key="modelDescription",
@@ -486,7 +486,7 @@ def test_is_model_by_reference(self):
486486
)
487487
self.mock_model.custom_metadata_list = [metadata_item]
488488

489-
assert self.mock_model._is_model_by_reference()
489+
assert self.mock_model.is_model_created_by_reference()
490490

491491
@patch.object(OCIDataScienceModel, "client")
492492
def test_create_defined_metadata_artifact(self, mock_client):

0 commit comments

Comments
 (0)