diff --git a/opensearch_py_ml/ml_commons/ml_commons_client.py b/opensearch_py_ml/ml_commons/ml_commons_client.py index c159f0cf6..365ac0538 100644 --- a/opensearch_py_ml/ml_commons/ml_commons_client.py +++ b/opensearch_py_ml/ml_commons/ml_commons_client.py @@ -316,7 +316,9 @@ def load_model(self, model_id: str, wait_until_loaded: bool = True) -> object: print("Model deployed only partially") # TODO: need to add the test case later for this line else: - raise Exception("Model deployment failed. Model state: " + str(model_state)) + raise Exception( + f"Model deployment failed. Model state: {model_state}. Model Status: {str(ml_model_status)}" + ) return self._get_task_info(task_id) @@ -355,7 +357,9 @@ def deploy_model(self, model_id: str, wait_until_deployed: bool = True) -> objec elif model_state == "PARTIALLY_DEPLOYED": print("Model deployed only partially") else: - raise Exception("Model deployment failed") + raise Exception( + f"Model deployment failed. Model State: {model_state}. Model status: {str(ml_model_status)}" + ) return self._get_task_info(task_id)