Skip to content

Latest commit

 

History

History
38 lines (23 loc) · 1 KB

File metadata and controls

38 lines (23 loc) · 1 KB

State

ModelDeployer

The .get_model_deployment_state() method of the ModelDeployer class accepts a model deployment OCID and returns an enum state. This is a convenience method to obtain the model deployment state when the model deployment OCID is known.

from ads.model.deployment import ModelDeployer

deployer = ModelDeployer()
deployer.get_model_deployment_state(model_deployment_id="<MODEL_DEPLOYMENT_OCID>").name

'ACTIVE'

ModelDeployment

You can determine the state of the model deployment using the current_state.name attribute of a ModelDeployment object. This returns a string with values like ‘ACTIVE’, ‘INACTIVE’, and ‘FAILED’.

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().

deployment.current_state.name