cleanup_old_checkpoints¶
- cleanup_old_checkpoints(main_dir, keep_last_n)[source]¶
Remove old checkpoints, keeping only the most recent N.
- Parameters:
- Raises:
ValueError – If keep_last_n is less than 1.
CheckpointNotFoundError – If the main directory does not exist.
- Return type: