Skip to content

Commit

Permalink
Save the final model
Browse files Browse the repository at this point in the history
  • Loading branch information
jshuadvd committed Jul 10, 2024
1 parent 7f2c9ef commit 99c846b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,10 @@ def main():
logger.info(f"Validation loss after short context recovery: {val_loss:.4f}")
wandb.log({"short_context_val_loss": val_loss})

# Save the final model
accelerator.save_state("final_model.pt")
wandb.save("final_model.pt")

# Finish logging and close the Weights & Biases run
wandb.finish()

Expand Down

0 comments on commit 99c846b

Please sign in to comment.