Skip to content

tinker_cookbook.checkpoint_utils.get_last_checkpoint

tinker_cookbook.checkpoint_utils.get_last_checkpoint(log_dir, required_key)

Get the last checkpoint from the checkpoints.jsonl file in the specified log directory.

Parameters:

  • log_dir (str) – The directory to check.
  • required_key (str) – The key to check for in the checkpoint. We might save partial checkpoints (e.g. sampler) in the same file, so we need to filter to the rows that have a fully-resumable checkpoint.

Returns: The last checkpoint, or None if no checkpoint is found.