cleanup_old_checkpoints

cleanup_old_checkpoints(main_dir, keep_last_n)[source]

Remove old checkpoints, keeping only the most recent N.

Parameters:
  • main_dir (Path) – Main checkpoint directory.

  • keep_last_n (int) – Number of most recent checkpoints to keep.

Raises:
Return type:

None