code: def create_checkpoint_callback(
      save_last: bool = False,
      save_top_k: int = 0,
      monitor: str = "loss",
      dirpath: Optional[str] = None,
  ) -> ModelCheckpoint:
      """Initializes the checkpoint callback.
  
      Args:
          save_last:
              Whether or not to save the checkpoint of the last epoch.
          save_top_k:
              Save the top_k model checkpoints.
          monitor:
              Which quantity to monitor.
          dirpath:
              Where to save the checkpoint.
  
      """
      return ModelCheckpoint(
          dirpath=os.getcwd() if dirpath is None else dirpath,
          filename="lightly_epoch_{epoch:d}",
          save_last=save_last,
          save_top_k=save_top_k,
          monitor=monitor,
          auto_insert_metric_name=False,
      )
  
file_path: lightly/lightly/embedding/callbacks.py
imports: import os
  from typing import Optional
  from omegaconf import DictConfig
  from pytorch_lightning.callbacks import ModelCheckpoint, ModelSummary
  from lightly.utils.hipify import print_as_warning
label_desc: Use image node_id 1 for calling a global function with example usage: create_checkpoint_callback(save_last, save_top_k, monitor, dirpath) and returns: ModelCheckpoint