Skip to content

Commit c6a5553

Browse files
use default_signer
1 parent a185a3e commit c6a5553

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

ads/aqua/model/model.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def get(self, model_id: str, load_model_card: Optional[bool] = True) -> "AquaMod
195195
if is_verified_type
196196
else f"{artifact_path.rstrip('/')}/{README}"
197197
),
198-
auth=self._auth,
198+
auth=default_signer(),
199199
)
200200
)
201201

@@ -641,7 +641,7 @@ def _create_model_catalog_entry(
641641
# todo: implement generic copy_folder method
642642
# copy model config from artifact path to user bucket
643643
copy_model_config(
644-
artifact_path=artifact_path, os_path=os_path, auth=self._auth
644+
artifact_path=artifact_path, os_path=os_path, auth=default_signer()
645645
)
646646

647647
except:
@@ -761,7 +761,7 @@ def register(
761761
if verified_model_details
762762
else f"{import_model_details.os_path.rstrip('/')}/{README}"
763763
),
764-
auth=self._auth,
764+
auth=default_signer(),
765765
)
766766
),
767767
inference_container=inference_container,

tests/unitary/with_extras/aqua/test_model.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ def test_get_foundation_models(
255255
mock_from_id,
256256
mock_read_file,
257257
foundation_model_type,
258+
mock_auth,
258259
):
259260
ds_model = MagicMock()
260261
ds_model.id = "test_id"
@@ -313,12 +314,12 @@ def test_get_foundation_models(
313314
if foundation_model_type == "verified":
314315
mock_read_file.assert_called_with(
315316
file_path="oci://bucket@namespace/prefix/config/README.md",
316-
auth=self.app._auth,
317+
auth=mock_auth(),
317318
)
318319
else:
319320
mock_read_file.assert_called_with(
320321
file_path="oci://bucket@namespace/prefix/README.md",
321-
auth=self.app._auth,
322+
auth=mock_auth(),
322323
)
323324

324325
assert asdict(aqua_model) == {
@@ -358,7 +359,12 @@ def test_get_foundation_models(
358359
return_value="oci://bucket@namespace/prefix",
359360
)
360361
def test_get_model_fine_tuned(
361-
self, mock_get_artifact_path, mock_from_id, mock_read_file, mock_query_resource
362+
self,
363+
mock_get_artifact_path,
364+
mock_from_id,
365+
mock_read_file,
366+
mock_query_resource,
367+
mock_auth,
362368
):
363369
ds_model = MagicMock()
364370
ds_model.id = "test_id"
@@ -453,7 +459,7 @@ def test_get_model_fine_tuned(
453459
mock_from_id.assert_called_with("test_model_id")
454460
mock_read_file.assert_called_with(
455461
file_path="oci://bucket@namespace/prefix/README.md",
456-
auth=self.app._auth,
462+
auth=mock_auth(),
457463
)
458464
mock_query_resource.assert_called()
459465

0 commit comments

Comments
 (0)