Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,9 +609,15 @@ def get_weight_decay(progress):

# Final eval
model.eval()
checkpoint_path = "checkpoint_preeval.pt"
torch.save(model.state_dict(), checkpoint_path)
Comment on lines +612 to +613
with autocast_ctx:
val_bpb = evaluate_bpb(model, tokenizer, DEVICE_BATCH_SIZE)

# Clean up checkpoint if evaluation succeeded
if os.path.exists(checkpoint_path):
os.remove(checkpoint_path)
Comment on lines 614 to +619
Comment on lines +618 to +619

# Final summary
t_end = time.time()
startup_time = t_start_training - t_start
Expand Down