off by one on last epoch save

This commit is contained in:
Victor Hall 2023-09-21 21:29:36 -04:00
parent ada6037463
commit 166c2e74e1
1 changed files with 1 additions and 1 deletions

View File

@ -1200,7 +1200,7 @@ def main(args):
last_epoch_saved_time = time.time()
logging.info(f"Saving model, {args.ckpt_every_n_minutes} mins at step {global_step}")
needs_save = True
if epoch > 0 and epoch % args.save_every_n_epochs == 0 and step == 0 and epoch < args.max_epochs - 1 and epoch >= args.save_ckpts_from_n_epochs:
if epoch > 0 and epoch % args.save_every_n_epochs == 0 and step == 0 and epoch < args.max_epochs and epoch >= args.save_ckpts_from_n_epochs:
logging.info(f" Saving model, {args.save_every_n_epochs} epochs at step {global_step}")
needs_save = True
if needs_save: