docstr: Called at the beginning of training.
  Subclasses should override for any actions to run.
  :param logs: Dict. Currently, no data is passed to this argument for this method
    but that may change in the future.
docstr_tok: ["Called","at","the","beginning","of","training",".","Subclasses","should","override","for","any","actions","to","run",".",":","param","logs",":","Dict",".","Currently",",","no","data","is","passed","to","this","argument","for","this","method","but","that","may","change","in","the","future","."]
code: def before_run(self, runner):
      """
      Called at the beginning of training.
      Subclasses should override for any actions to run.
      :param logs: Dict. Currently, no data is passed to this argument for this method
        but that may change in the future.
      """
      # todo: support resume training
      dirname = os.path.dirname(self.filepath)
      from bigdl.orca.data.file import exists, listdir, makedirs
  
      if exists(dirname):
          files = [os.path.basename(f) for f in listdir(dirname)]
          files = [x for x in files if "ckpt" in x]
          if len(files) == 0:
              return None
          invalidInputError(
              False,
              f"Find non-empty dirname with filepath of {self.filepath}.",
          )
      else:
          makedirs(dirname)
  
file_path: BigDL/python/orca/src/bigdl/orca/learn/pytorch/callbacks/model_checkpoint.py
imports: from bigdl.orca.learn.pytorch.callbacks import Callback
  import os
  import re
  import warnings
  from bigdl.dllib.utils.log4Error import invalidInputError
label_desc: Use image node_id 4 for calling the ModelCheckpoint obj's underlying member method code with example usage: obj.before_run(runner) and returns: None