11#!/usr/bin/env python
2- # -*- coding: utf-8; -*-
32
43# Copyright (c) 2022, 2024 Oracle and/or its affiliates.
54# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
65
76import logging
8- import time
97from functools import wraps
108from io import BytesIO
119from typing import Callable , Dict , List , Optional
1210
1311import oci .data_science
14- from ads .common import utils
15- from ads .common .object_storage_details import ObjectStorageDetails
16- from ads .common .oci_datascience import OCIDataScienceMixin
17- from ads .common .oci_mixin import OCIWorkRequestMixin
18- from ads .common .oci_resource import SEARCH_TYPE , OCIResource
19- from ads .common .utils import extract_region
20- from ads .common .work_request import DataScienceWorkRequest
21- from ads .model .deployment import ModelDeployment
2212from oci .data_science .models import (
2313 ArtifactExportDetailsObjectStorage ,
2414 ArtifactImportDetailsObjectStorage ,
2515 CreateModelDetails ,
2616 ExportModelArtifactDetails ,
2717 ImportModelArtifactDetails ,
2818 UpdateModelDetails ,
29- WorkRequest ,
3019)
3120from oci .exceptions import ServiceError
3221
22+ from ads .common .object_storage_details import ObjectStorageDetails
23+ from ads .common .oci_datascience import OCIDataScienceMixin
24+ from ads .common .oci_mixin import OCIWorkRequestMixin
25+ from ads .common .oci_resource import SEARCH_TYPE , OCIResource
26+ from ads .common .utils import extract_region
27+ from ads .common .work_request import DataScienceWorkRequest
28+ from ads .model .deployment import ModelDeployment
29+
3330logger = logging .getLogger (__name__ )
3431
3532_REQUEST_INTERVAL_IN_SEC = 3
@@ -282,7 +279,7 @@ def get_artifact_info(self) -> Dict:
282279 msg = "Model needs to be restored before the archived artifact content can be accessed."
283280 )
284281 def restore_archived_model_artifact (
285- self , restore_model_for_hours_specified : Optional [int ] = None
282+ self , restore_model_for_hours_specified : Optional [int ] = None
286283 ) -> None :
287284 """Restores the archived model artifact.
288285
@@ -304,7 +301,8 @@ def restore_archived_model_artifact(
304301 """
305302 return self .client .restore_archived_model_artifact (
306303 model_id = self .id ,
307- restore_model_for_hours_specified = restore_model_for_hours_specified ).headers ["opc-work-request-id" ]
304+ restore_model_for_hours_specified = restore_model_for_hours_specified ,
305+ ).headers ["opc-work-request-id" ]
308306
309307 @check_for_model_id (
310308 msg = "Model needs to be saved to the Model Catalog before the artifact content can be read."
@@ -581,7 +579,7 @@ def from_id(cls, ocid: str) -> "OCIDataScienceModel":
581579 raise ValueError ("Model OCID not provided." )
582580 return super ().from_ocid (ocid )
583581
584- def is_model_by_reference (self ):
582+ def _is_model_by_reference (self ):
585583 """Checks if model is created by reference
586584 Returns
587585 -------
0 commit comments