@@ -136,7 +136,7 @@ class DataScienceModelType(str, metaclass=ExtendedEnumMeta):
136136 MODEL = "datasciencemodel"
137137
138138
139- class NotActiveDeploymentError (Exception ): # pragma: no cover
139+ class NotActiveDeploymentError (Exception ): # pragma: no cover
140140 def __init__ (self , state : str ):
141141 msg = (
142142 "To perform a prediction the deployed model needs to be in an active state. "
@@ -145,15 +145,15 @@ def __init__(self, state: str):
145145 super ().__init__ (msg )
146146
147147
148- class SerializeModelNotImplementedError (NotImplementedError ): # pragma: no cover
148+ class SerializeModelNotImplementedError (NotImplementedError ): # pragma: no cover
149149 pass
150150
151151
152- class SerializeInputNotImplementedError (NotImplementedError ): # pragma: no cover
152+ class SerializeInputNotImplementedError (NotImplementedError ): # pragma: no cover
153153 pass
154154
155155
156- class RuntimeInfoInconsistencyError (Exception ): # pragma: no cover
156+ class RuntimeInfoInconsistencyError (Exception ): # pragma: no cover
157157 pass
158158
159159
@@ -1327,7 +1327,7 @@ def from_model_artifact(
13271327 If `model_file_name` not provided.
13281328 """
13291329 if (
1330- cls ._PREFIX is not "spark"
1330+ cls ._PREFIX != "spark"
13311331 and artifact_dir
13321332 and ObjectStorageDetails .is_oci_path (artifact_dir )
13331333 ):
@@ -1434,7 +1434,7 @@ def from_model_catalog(
14341434 An instance of GenericModel class.
14351435 """
14361436 if (
1437- cls ._PREFIX is not "spark"
1437+ cls ._PREFIX != "spark"
14381438 and artifact_dir
14391439 and ObjectStorageDetails .is_oci_path (artifact_dir )
14401440 ):
@@ -1556,7 +1556,7 @@ def from_model_deployment(
15561556 An instance of GenericModel class.
15571557 """
15581558 if (
1559- cls ._PREFIX is not "spark"
1559+ cls ._PREFIX != "spark"
15601560 and artifact_dir
15611561 and ObjectStorageDetails .is_oci_path (artifact_dir )
15621562 ):
@@ -1653,7 +1653,7 @@ def update_deployment(
16531653 Model deployment freeform tags
16541654 defined_tags: (dict)
16551655 Model deployment defined tags
1656-
1656+
16571657 Additional kwargs arguments.
16581658 Can be any attribute that `ads.model.deployment.ModelDeploymentCondaRuntime`, `ads.model.deployment.ModelDeploymentContainerRuntime`
16591659 and `ads.model.deployment.ModelDeploymentInfrastructure` accepts.
@@ -2116,45 +2116,44 @@ def deploy(
21162116 existing_infrastructure = self .model_deployment .infrastructure
21172117 existing_runtime = self .model_deployment .runtime
21182118 property_dict = ModelProperties (
2119- compartment_id = existing_infrastructure .compartment_id
2119+ compartment_id = existing_infrastructure .compartment_id
21202120 or self .properties .compartment_id
21212121 or _COMPARTMENT_OCID ,
2122- project_id = existing_infrastructure .project_id
2122+ project_id = existing_infrastructure .project_id
21232123 or self .properties .project_id
21242124 or PROJECT_OCID ,
2125- deployment_instance_shape = existing_infrastructure .shape_name
2125+ deployment_instance_shape = existing_infrastructure .shape_name
21262126 or self .properties .deployment_instance_shape
21272127 or MODEL_DEPLOYMENT_INSTANCE_SHAPE ,
2128- deployment_instance_count = existing_infrastructure .replica
2128+ deployment_instance_count = existing_infrastructure .replica
21292129 or self .properties .deployment_instance_count
21302130 or MODEL_DEPLOYMENT_INSTANCE_COUNT ,
2131- deployment_bandwidth_mbps = existing_infrastructure .bandwidth_mbps
2131+ deployment_bandwidth_mbps = existing_infrastructure .bandwidth_mbps
21322132 or self .properties .deployment_bandwidth_mbps
21332133 or MODEL_DEPLOYMENT_BANDWIDTH_MBPS ,
2134- deployment_ocpus = existing_infrastructure .shape_config_details .get (
2134+ deployment_ocpus = existing_infrastructure .shape_config_details .get (
21352135 "ocpus" , None
21362136 )
21372137 or self .properties .deployment_ocpus
21382138 or MODEL_DEPLOYMENT_INSTANCE_OCPUS ,
2139- deployment_memory_in_gbs = existing_infrastructure .shape_config_details .get (
2139+ deployment_memory_in_gbs = existing_infrastructure .shape_config_details .get (
21402140 "memoryInGBs" , None
21412141 )
21422142 or self .properties .deployment_memory_in_gbs
21432143 or MODEL_DEPLOYMENT_INSTANCE_MEMORY_IN_GBS ,
2144- deployment_log_group_id = existing_infrastructure .log_group_id
2144+ deployment_log_group_id = existing_infrastructure .log_group_id
21452145 or self .properties .deployment_log_group_id ,
2146- deployment_access_log_id = existing_infrastructure .access_log .get (
2146+ deployment_access_log_id = existing_infrastructure .access_log .get (
21472147 "log_id" , None
21482148 )
21492149 or self .properties .deployment_access_log_id ,
2150- deployment_predict_log_id = existing_infrastructure .predict_log .get (
2150+ deployment_predict_log_id = existing_infrastructure .predict_log .get (
21512151 "log_id" , None
21522152 )
21532153 or self .properties .deployment_predict_log_id ,
2154- deployment_image = existing_runtime .image
2155- or self .properties .deployment_image ,
2156- deployment_instance_subnet_id = existing_infrastructure .subnet_id
2157- or self .properties .deployment_instance_subnet_id
2154+ deployment_image = existing_runtime .image or self .properties .deployment_image ,
2155+ deployment_instance_subnet_id = existing_infrastructure .subnet_id
2156+ or self .properties .deployment_instance_subnet_id ,
21582157 ).to_dict ()
21592158
21602159 property_dict .update (override_properties )
0 commit comments