class_docstr: Common interface for all model server clients.
class_docstr_tok: ["Common","interface","for","all","model","server","clients","."]
docstr: Wait until model is loaded and available.
  
  Args:
    deadline: A deadline time in UTC timestamp (in seconds).
    polling_interval_sec: GetServingStatus() polling interval.
  
  Raises:
    DeadlineExceeded: When deadline exceeded before model is ready.
    ValidationFailed: If validation failed explicitly.
docstr_tok: ["Wait","until","model","is","loaded","and","available",".","Args",":","deadline",":","A","deadline","time","in","UTC","timestamp","(","in","seconds",")",".","polling_interval_sec",":","GetServingStatus","(",")","polling","interval",".","Raises",":","DeadlineExceeded",":","When","deadline","exceeded","before","model","is","ready",".","ValidationFailed",":","If","validation","failed","explicitly","."]
code: def WaitUntilModelLoaded(
      self, deadline: float, polling_interval_sec: int
  ) -> None:
      """Wait until model is loaded and available.
  
      Args:
        deadline: A deadline time in UTC timestamp (in seconds).
        polling_interval_sec: GetServingStatus() polling interval.
  
      Raises:
        DeadlineExceeded: When deadline exceeded before model is ready.
        ValidationFailed: If validation failed explicitly.
      """
      while time.time() < deadline:
          status = self._GetServingStatus()
          if status == types.ModelServingStatus.NOT_READY:
              logging.log_every_n_seconds(
                  level=logging.INFO,
                  n_seconds=10,
                  msg="Waiting for model to be loaded...",
              )
              time.sleep(polling_interval_sec)
              continue
          elif status == types.ModelServingStatus.UNAVAILABLE:
              raise error_types.ValidationFailed(
                  "Model server failed to load the model."
              )
          else:
              logging.info("Model is successfully loaded.")
              return
  
      raise error_types.DeadlineExceeded(
          "Deadline exceeded while waiting the model to be loaded."
      )
  
file_path: tfx/tfx/components/infra_validator/model_server_clients/base_client.py
imports: import abc
  import time
  from typing import List
  from absl import logging
  from tfx.components.infra_validator import error_types
  from tfx.components.infra_validator import types
label_desc: Use image node_id 2 for calling the BaseModelServerClient obj's underlying member method code with example usage: obj.WaitUntilModelLoaded(deadline, polling_interval_sec) without return types