code: def check(self, tez_trainer):
      epoch_score = tez_trainer.metrics[self.model_state][
          self.monitor_value
      ]
      if self.mode == "min":
          score = -1.0 * epoch_score
      else:
          score = np.copy(epoch_score)
  
      if self.best_score is None:
          self.best_score = score
          self.save_checkpoint(epoch_score, tez_trainer)
      elif score < self.best_score + self.delta:
          self.counter += 1
          logger.info(
              f"EarlyStopping counter: {self.counter}/{self.patience}"
          )
          if self.counter >= self.patience:
              tez_trainer.model_state = enums.ModelState.END
      else:
          self.best_score = score
          self.save_checkpoint(epoch_score, tez_trainer)
          self.counter = 0
  
file_path: tez/tez/callbacks/early_stopping.py
imports: import numpy
  from accelerate.logging import get_logger
  from tez import enums
  from tez.callbacks import Callback
  from tez.logger import logger
label_desc: Use image node_id 2 for calling the EarlyStopping obj's underlying member method code with example usage: obj.check(tez_trainer) without return types