Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
epwalsh committed Dec 7, 2023
1 parent 569381a commit a44217a
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions olmo/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -910,15 +910,10 @@ def on_trace_ready(p):
log.info("Training loop complete")

# Save final unsharded model-only checkpoint.
if not canceled:
if self.cfg.save_interval_unsharded is not None:
log.info("Saving final unsharded checkpoint...")
checkpoint_path, _ = self.save_checkpoint(CheckpointType.unsharded)
log.info(f"Unsharded checkpoint saved to {checkpoint_path}")
else:
log.info("Saving final sharded checkpoint...")
checkpoint_path, _ = self.save_checkpoint(CheckpointType.sharded)
log.info(f"Checkpoint saved to {checkpoint_path}")
if not canceled and self.cfg.save_interval_unsharded is not None:
log.info("Saving final unsharded model checkpoint...")
checkpoint_path, _ = self.save_checkpoint(CheckpointType.unsharded)
log.info(f"Unsharded checkpoint saved to {checkpoint_path}")

def close(self, exit_code: int = 0) -> None:
if self.indices_file is not None:
Expand Down

0 comments on commit a44217a

Please sign in to comment.