def unevaluated_checkpoints(
      self,
      timeout: int = 3600 * 8,
      num_batched_steps: int = 1,
      eval_every_steps: Optional[int] = None,
      include_tmp: bool = False,
      return_all: bool = False,
  ) -> Iterable[str]:
    """Generator for checkpoints without evaluation results.

    Args:
      timeout: Optional timeout for waiting for new checkpoints. Set this to do
        continious evaluation.
      num_batched_steps: Steps that are batched into a single tf.function.
        Required for computing correct evaluation checkpoints.
      eval_every_steps: Only evaluate checkpoints from steps divisible by this
        integer.
      include_tmp: Whether to evaluate tmp checkpoints.
      return_all: Whether to return all checkpoints including evaluated ones.

    Yields:
      Path to checkpoints that have not yet been evaluated.
    """
    logging.info('Looking for checkpoints in %s', self.model_dir)
    if not return_all:
      evaluated_checkpoints = self._get_checkpoints_with_results()
    else:
      evaluated_checkpoints = set()
    last_eval = time.time()
    while True:
      # Check if directory exists. The train job may only create the directory
      # some time after the test job starts.
      if not gfile.exists(self.model_dir):
        logging.info('Directory %s does not exist!', self.model_dir)
      else:
        logging.info(
            'what is in %s:  are  %s',
            self.model_dir,
            gfile.listdir(self.model_dir),
        )
        unevaluated_checkpoints = []
        checkpoints = gfile.glob(
            os.path.join(self._model_dir, self.file_pattern)
        )
        if include_tmp:
          checkpoints = set(checkpoints)
        else:
          checkpoints = set(
              [x for x in checkpoints if 'tmp' not in os.path.basename(x)]
          )
        logging.info('checkpoints: %s', checkpoints)
        unevaluated_checkpoints = checkpoints - evaluated_checkpoints
        step_and_ckpt = sorted(
            (self.sort_key_fn(x), x) for x in unevaluated_checkpoints
        )

        unevaluated_checkpoints = []
        for step, ckpt in step_and_ckpt:
          if eval_every_steps:
            if step > num_batched_steps and (
                step % eval_every_steps < num_batched_steps
            ):
              unevaluated_checkpoints.append(ckpt)
          else:
            unevaluated_checkpoints.append(ckpt)

        logging.info(
            (
                'Found checkpoints: %s\nEvaluated checkpoints: %s\n'
                'Unevaluated checkpoints: %s'
            ),
            checkpoints,
            evaluated_checkpoints,
            unevaluated_checkpoints,
        )
        for checkpoint_path in unevaluated_checkpoints:
          yield checkpoint_path

        if unevaluated_checkpoints:
          evaluated_checkpoints |= set(unevaluated_checkpoints)
          last_eval = time.time()
          continue
      if time.time() - last_eval > timeout or self.is_training_done():
        break
      time.sleep(5)
Generator for checkpoints without evaluation results.

    Args:
      timeout: Optional timeout for waiting for new checkpoints. Set this to do
        continious evaluation.
      num_batched_steps: Steps that are batched into a single tf.function.
        Required for computing correct evaluation checkpoints.
      eval_every_steps: Only evaluate checkpoints from steps divisible by this
        integer.
      include_tmp: Whether to evaluate tmp checkpoints.
      return_all: Whether to return all checkpoints including evaluated ones.

    Yields:
      Path to checkpoints that have not yet been evaluated.
    
videogvt/train_lib/task_manager.py