Skip to content

Commit 49fef55

Browse files
committed
Updated ModelDeployment docs.
1 parent f3fe3b1 commit 49fef55

File tree

10 files changed

+415
-216
lines changed

10 files changed

+415
-216
lines changed
Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
Access a Model Deployment
22
*************************
33

4-
When a model is deployed the ``.deploy()`` method of the ``ModelDeployer`` class will return a ``ModelDeployment`` object. This object can be used to interact with the actual model deployment. However, if the model has already been deployed, it is possible to obtain a ``ModelDeployment`` object. Use the ``.get_model_deployment()`` method when the model deployment OCID is known.
4+
When a model is deployed the ``.deploy()`` method of the ``ModelDeployment`` class will return an updated ``ModelDeployment`` object. This object can be used to interact with the actual model deployment. However, if the model has already been deployed, it is possible to obtain a ``ModelDeployment`` object. Use the ``.from_id()`` method when the model deployment OCID is known.
55

66
The next code snippet creates a new ``ModelDeployment`` object that has access to the created model deployment.
77

88
.. code-block:: python3
99
10-
from ads.model.deployment import ModelDeployer
11-
12-
deployer = ModelDeployer()
13-
existing_deployment = deployer.get_model_deployment(model_deployment_id="<MODEL_DEPLOYMENT_OCID>")
14-
15-
16-
10+
from ads.model.deployment import ModelDeployment
1711
12+
existing_deployment = ModelDeployment.from_id(id="<MODEL_DEPLOYMENT_OCID>")
1813

docs/source/user_guide/model_deployment/attributes.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Attributes
33

44
The ``ModelDeployment`` class has a number of attributes that are assigned by the system. They provide a mechanism to determine the state of the model deployment, the URI to make predictions, the model deployment OCID, etc.
55

6-
In the following code snippets, the variable ``deployment`` is a ``ModelDeployment`` object. This object can be obtained from a call to ``.deploy()`` or ``.get_model_deployment()``.
6+
In the following code snippets, the variable ``deployment`` is a ``ModelDeployment`` object. This object can be obtained from a call to ``.deploy()`` or ``.from_id()``.
77

88
OCID
99
====
@@ -18,9 +18,9 @@ the OCID of the model deployment.
1818
State
1919
=====
2020

21-
You can determine the state of the model deployment using the ``.current_state`` enum attribute of a ``ModelDeployment`` object. This returns an enum object and the string value can be determined with ``.current_state.name``. It will have values like ACTIVE’, ‘INACTIVE, and FAILED.
21+
You can determine the state of the model deployment using the ``.current_state`` enum attribute of a ``ModelDeployment`` object. This returns an enum object and the string value can be determined with ``.current_state.name``. It will have values like 'ACTIVE', 'INACTIVE', and 'FAILED'.
2222

23-
In the following code snippets, the variable ``deployment`` is a ``ModelDeployment`` object. This object can be obtained from a call to ``.deploy()`` or ``.get_model_deployment()``.
23+
In the following code snippets, the variable ``deployment`` is a ``ModelDeployment`` object. This object can be obtained from a call to ``.deploy()`` or ``.from_id()``.
2424

2525
.. code-block:: python3
2626

docs/source/user_guide/model_deployment/delete.rst

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,13 @@
11
Delete
22
******
33

4-
A model deployment can be deleted using a ``ModelDeployer`` or ``ModelDeployment`` objects.
4+
A model deployment can be deleted using a ``ModelDeployment`` objects.
55

66
When a model deployment is deleted, it deletes the load balancer instances associated with it. However, it doesn't delete other resources like log group, log, or model.
77

8-
9-
``ModelDeployer``
10-
=================
11-
12-
The ``ModelDeployer`` instance has a ``.delete()`` method for deleting a model deployment when give its OCID.
13-
14-
.. code-block:: python3
15-
16-
from ads.model.deployment import ModelDeployer
17-
18-
deployer = ModelDeployer()
19-
deployer.delete(model_deployment_id=deployment_id)
20-
21-
22-
``ModelDeployment``
23-
===================
24-
258
If you have a ``ModelDeployment`` object, you can use the ``.delete()`` method to delete the model that is associated with that object. The optional ``wait_for_completion`` parameter accepts a Boolean and determines if the process is blocking or not.
269

27-
In the following code snippets, the variable ``deployment`` is a ``ModelDeployment`` object. This object can be obtained from a call to ``.deploy()`` or ``.get_model_deployment()``.
10+
In the following code snippets, the variable ``deployment`` is a ``ModelDeployment`` object. This object can be obtained from a call to ``.deploy()`` or ``.from_id()``.
2811

2912
.. code-block:: python3
3013

0 commit comments

Comments
 (0)