class_docstr: A [`TrainerCallback`] that displays the progress of training or evaluation, optimized for Jupyter Notebooks or
  Google colab.
class_docstr_tok: ["A","[","`","TrainerCallback","`","]","that","displays","the","progress","of","training","or","evaluation",",","optimized","for","Jupyter","Notebooks","or","Google","colab","."]
code: def on_evaluate(self, args, state, control, metrics=None, **kwargs):
      if self.training_tracker is not None:
          values = {
              "Training Loss": "No log",
              "Validation Loss": "No log",
          }
          for log in reversed(state.log_history):
              if "loss" in log:
                  values["Training Loss"] = log["loss"]
                  break
  
          if self.first_column == "Epoch":
              values["Epoch"] = int(state.epoch)
          else:
              values["Step"] = state.global_step
          metric_key_prefix = "eval"
          for k in metrics:
              if k.endswith("_loss"):
                  metric_key_prefix = re.sub(r"\_loss$", "", k)
          _ = metrics.pop("total_flos", None)
          _ = metrics.pop("epoch", None)
          _ = metrics.pop(f"{metric_key_prefix}_runtime", None)
          _ = metrics.pop(
              f"{metric_key_prefix}_samples_per_second", None
          )
          _ = metrics.pop(f"{metric_key_prefix}_steps_per_second", None)
          for k, v in metrics.items():
              if k == f"{metric_key_prefix}_loss":
                  values["Validation Loss"] = v
              else:
                  splits = k.split("_")
                  name = " ".join(
                      [part.capitalize() for part in splits[1:]]
                  )
                  values[name] = v
          self.training_tracker.write_line(values)
          self.training_tracker.remove_child()
          self.prediction_bar = None
          # Evaluation takes a long time so we should force the next update.
          self._force_next_update = True
  
imports: import re
  import time
  from typing import Optional
  import IPython.display
  from ..trainer_callback import TrainerCallback
  from ..trainer_utils import IntervalStrategy, has_length
label_desc: Use image node_id 7 for calling the NotebookProgressCallback obj's underlying member method code with example usage: obj.on_evaluate(args, state, control, metrics) without return types