Skip to content

Commit adc4431

Browse files
committed
Modified model deployment watch method.
1 parent ff08a04 commit adc4431

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

ads/model/deployment/model_deployment.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
DELETE_WORKFLOW_STEPS = 2
6565
DEACTIVATE_WORKFLOW_STEPS = 2
6666
DEFAULT_RETRYING_REQUEST_ATTEMPTS = 3
67-
TERMINAL_STATES = [State.ACTIVE, State.FAILED, State.DELETED, State.INACTIVE]
67+
TERMINAL_STATES = [State.FAILED, State.DELETED, State.INACTIVE]
6868

6969
MODEL_DEPLOYMENT_KIND = "deployment"
7070
MODEL_DEPLOYMENT_TYPE = "modelDeployment"
@@ -720,7 +720,7 @@ def update(
720720

721721
def watch(
722722
self,
723-
log_type: str = ModelDeploymentLogType.ACCESS,
723+
log_type: str = None,
724724
time_start: datetime = None,
725725
interval: int = LOG_INTERVAL,
726726
log_filter: str = None,
@@ -731,7 +731,7 @@ def watch(
731731
----------
732732
log_type: str, optional
733733
The log type. Can be `access`, `predict` or None.
734-
Defaults to access.
734+
Defaults to None.
735735
time_start : datetime.datetime, optional
736736
Starting time for the log query.
737737
Defaults to None.
@@ -748,7 +748,12 @@ def watch(
748748
The instance of ModelDeployment.
749749
"""
750750
status = ""
751-
while not self._stop_condition():
751+
while self.state not in [
752+
State.ACTIVE,
753+
State.FAILED,
754+
State.DELETED,
755+
State.INACTIVE
756+
]:
752757
status = self._check_and_print_status(status)
753758
time.sleep(interval)
754759

0 commit comments

Comments
 (0)