@@ -136,7 +136,7 @@ class DataScienceModelType(str, metaclass=ExtendedEnumMeta):
136
136
MODEL = "datasciencemodel"
137
137
138
138
139
- class NotActiveDeploymentError (Exception ): # pragma: no cover
139
+ class NotActiveDeploymentError (Exception ): # pragma: no cover
140
140
def __init__ (self , state : str ):
141
141
msg = (
142
142
"To perform a prediction the deployed model needs to be in an active state. "
@@ -145,15 +145,15 @@ def __init__(self, state: str):
145
145
super ().__init__ (msg )
146
146
147
147
148
- class SerializeModelNotImplementedError (NotImplementedError ): # pragma: no cover
148
+ class SerializeModelNotImplementedError (NotImplementedError ): # pragma: no cover
149
149
pass
150
150
151
151
152
- class SerializeInputNotImplementedError (NotImplementedError ): # pragma: no cover
152
+ class SerializeInputNotImplementedError (NotImplementedError ): # pragma: no cover
153
153
pass
154
154
155
155
156
- class RuntimeInfoInconsistencyError (Exception ): # pragma: no cover
156
+ class RuntimeInfoInconsistencyError (Exception ): # pragma: no cover
157
157
pass
158
158
159
159
@@ -1327,7 +1327,7 @@ def from_model_artifact(
1327
1327
If `model_file_name` not provided.
1328
1328
"""
1329
1329
if (
1330
- cls ._PREFIX is not "spark"
1330
+ cls ._PREFIX != "spark"
1331
1331
and artifact_dir
1332
1332
and ObjectStorageDetails .is_oci_path (artifact_dir )
1333
1333
):
@@ -1434,7 +1434,7 @@ def from_model_catalog(
1434
1434
An instance of GenericModel class.
1435
1435
"""
1436
1436
if (
1437
- cls ._PREFIX is not "spark"
1437
+ cls ._PREFIX != "spark"
1438
1438
and artifact_dir
1439
1439
and ObjectStorageDetails .is_oci_path (artifact_dir )
1440
1440
):
@@ -1556,7 +1556,7 @@ def from_model_deployment(
1556
1556
An instance of GenericModel class.
1557
1557
"""
1558
1558
if (
1559
- cls ._PREFIX is not "spark"
1559
+ cls ._PREFIX != "spark"
1560
1560
and artifact_dir
1561
1561
and ObjectStorageDetails .is_oci_path (artifact_dir )
1562
1562
):
@@ -1653,7 +1653,7 @@ def update_deployment(
1653
1653
Model deployment freeform tags
1654
1654
defined_tags: (dict)
1655
1655
Model deployment defined tags
1656
-
1656
+
1657
1657
Additional kwargs arguments.
1658
1658
Can be any attribute that `ads.model.deployment.ModelDeploymentCondaRuntime`, `ads.model.deployment.ModelDeploymentContainerRuntime`
1659
1659
and `ads.model.deployment.ModelDeploymentInfrastructure` accepts.
@@ -2116,45 +2116,44 @@ def deploy(
2116
2116
existing_infrastructure = self .model_deployment .infrastructure
2117
2117
existing_runtime = self .model_deployment .runtime
2118
2118
property_dict = ModelProperties (
2119
- compartment_id = existing_infrastructure .compartment_id
2119
+ compartment_id = existing_infrastructure .compartment_id
2120
2120
or self .properties .compartment_id
2121
2121
or _COMPARTMENT_OCID ,
2122
- project_id = existing_infrastructure .project_id
2122
+ project_id = existing_infrastructure .project_id
2123
2123
or self .properties .project_id
2124
2124
or PROJECT_OCID ,
2125
- deployment_instance_shape = existing_infrastructure .shape_name
2125
+ deployment_instance_shape = existing_infrastructure .shape_name
2126
2126
or self .properties .deployment_instance_shape
2127
2127
or MODEL_DEPLOYMENT_INSTANCE_SHAPE ,
2128
- deployment_instance_count = existing_infrastructure .replica
2128
+ deployment_instance_count = existing_infrastructure .replica
2129
2129
or self .properties .deployment_instance_count
2130
2130
or MODEL_DEPLOYMENT_INSTANCE_COUNT ,
2131
- deployment_bandwidth_mbps = existing_infrastructure .bandwidth_mbps
2131
+ deployment_bandwidth_mbps = existing_infrastructure .bandwidth_mbps
2132
2132
or self .properties .deployment_bandwidth_mbps
2133
2133
or MODEL_DEPLOYMENT_BANDWIDTH_MBPS ,
2134
- deployment_ocpus = existing_infrastructure .shape_config_details .get (
2134
+ deployment_ocpus = existing_infrastructure .shape_config_details .get (
2135
2135
"ocpus" , None
2136
2136
)
2137
2137
or self .properties .deployment_ocpus
2138
2138
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 (
2140
2140
"memoryInGBs" , None
2141
2141
)
2142
2142
or self .properties .deployment_memory_in_gbs
2143
2143
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
2145
2145
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 (
2147
2147
"log_id" , None
2148
2148
)
2149
2149
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 (
2151
2151
"log_id" , None
2152
2152
)
2153
2153
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 ,
2158
2157
).to_dict ()
2159
2158
2160
2159
property_dict .update (override_properties )
0 commit comments