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 463678b commit 3631ec6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ def train(
tokenizer,
epochs=10,
gradient_accumulation_steps=4,
resume_from_checkpoint=None,
):
"""
Train the LongRoPE model.
Expand All @@ -153,6 +154,7 @@ def train(
tokenizer: Tokenizer for encoding/decoding text.
epochs (int): Number of training epochs.
gradient_accumulation_steps (int): Number of steps to accumulate gradients.
resume_from_checkpoint (str): Path to a checkpoint to resume training from.
Returns:
None
Expand All @@ -164,6 +166,7 @@ def train(
best_val_loss = float("inf")
patience = 0
max_patience = 3
start_epoch = 0

for epoch in range(epochs):
model.train()
Expand Down

0 comments on commit 3631ec6

Please sign in to comment.