Skip to content

Commit

Permalink
Begin implementing a training edge case to pickup where the training …
Browse files Browse the repository at this point in the history
…left off if interrupeted.
  • Loading branch information
jshuadvd committed Jul 7, 2024
1 parent c70b0bc commit 32e537f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion train.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,9 @@ def train(
best_val_loss = avg_val_loss
patience = 0
# Save best model
accelerator.save_state("best_model.pt")
accelerator.save_state(
{"epoch": epoch, "best_val_loss": best_val_loss}, "best_model.pt"
)
else:
patience += 1
if patience >= max_patience:
Expand Down

0 comments on commit 32e537f

Please sign in to comment.