Skip to content

Commit 6008077

Browse files
committed
Updated pr.
1 parent c798570 commit 6008077

File tree

5 files changed

+18
-21
lines changed

5 files changed

+18
-21
lines changed

ads/model/deployment/model_deployer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def __init__(self, config: dict = None, ds_client: DataScienceClient = None):
106106
"""
107107
if config:
108108
warnings.warn(
109-
"`config` will be removed in 3.0.0 and will be ignored now. Please use `ads.set_auth()` to config the auth information."
109+
"`config` will be deprecated in 3.0.0 and will be ignored now. Please use `ads.set_auth()` to config the auth information."
110110
)
111111

112112
self.ds_client = None

ads/model/deployment/model_deployment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ def update(
701701
"""
702702
if properties:
703703
warnings.warn(
704-
"Parameter `properties` will be removed from ModelDeployment update() in 3.0.0. Please use the builder pattern to update model deployment instance."
704+
"Parameter `properties` will be removed from ModelDeployment `update()` in 3.0.0. Please use the builder pattern or kwargs to update model deployment instance."
705705
)
706706

707707
updated_properties = properties

ads/model/generic_model.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -299,12 +299,12 @@ class GenericModel(MetadataMixin, Introspectable, EvaluatorMixin):
299299
>>> model.deploy()
300300
>>> # Update access log id, freeform tags and description for the model deployment
301301
>>> model.update_deployment(
302-
>>> properties=ModelDeploymentProperties(
303-
>>> access_log_id=<log_ocid>,
304-
>>> description="Description for Custom Model",
305-
>>> freeform_tags={"key": "value"},
306-
>>> )
307-
>>> )
302+
... access_log={
303+
... log_id=<log_ocid>
304+
... },
305+
... description="Description for Custom Model",
306+
... freeform_tags={"key": "value"},
307+
... )
308308
>>> model.predict(2)
309309
>>> # Uncomment the line below to delete the model and the associated model deployment
310310
>>> # model.delete(delete_associated_model_deployment = True)
@@ -1615,8 +1615,7 @@ def update_deployment(
16151615
16161616
Examples
16171617
--------
1618-
>>> # Update access log id, freeform tags and description for the model deployment
1619-
>>> # Deprecated
1618+
>>> # Deprecated way to update access log id, freeform tags and description for the model deployment
16201619
>>> model.update_deployment(
16211620
>>> properties=ModelDeploymentProperties(
16221621
>>> access_log_id=<log_ocid>,

ads/model/service/oci_datascience_model.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from ads.common.oci_mixin import OCIWorkRequestMixin
1818
from ads.common.oci_resource import SEARCH_TYPE, OCIResource
1919
from ads.common.utils import extract_region
20-
from ads.model.deployment.model_deployer import ModelDeployer
20+
from ads.model.deployment import ModelDeployment
2121
from oci.data_science.models import (
2222
ArtifactExportDetailsObjectStorage,
2323
ArtifactImportDetailsObjectStorage,
@@ -469,9 +469,7 @@ def delete(
469469
logger.info(
470470
f"Deleting model deployment `{oci_model_deployment.identifier}`."
471471
)
472-
ModelDeployer(ds_client=self.client).delete(
473-
model_deployment_id=oci_model_deployment.identifier
474-
)
472+
ModelDeployment.from_id(oci_model_deployment.identifier).delete()
475473

476474
logger.info(f"Deleting model `{self.id}`.")
477475
self.client.delete_model(self.id)

docs/source/user_guide/model_registration/model_deploy.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ You can update the existing Model Deployment by using ``.update_deployment()`` m
106106
.. code-block:: python3
107107
108108
lightgbm_model.update_deployment(
109-
properties=ModelDeploymentProperties(
110-
access_log_id="ocid1.log.oc1.xxx.xxxxx",
111-
description="Description for Custom Model",
112-
freeform_tags={"key": "value"},
113-
)
114-
wait_for_completion = True,
115-
)
109+
wait_for_completion = True,
110+
access_log={
111+
log_id="ocid1.log.oc1.xxx.xxxxx",
112+
},
113+
description="Description for Custom Model",
114+
freeform_tags={"key": "value"},
115+
)

0 commit comments

Comments
 (0)