make mid_train script work even with a tiny number of iterations

This commit is contained in:
Eric Silberstein 2025-11-19 15:52:20 -05:00
parent 4a87a0d19f
commit dddb95caac

View File

@ -139,7 +139,7 @@ def mid_data_generator(split):
last_step = True # toggle last_step to True, which will terminate the training loop last_step = True # toggle last_step to True, which will terminate the training loop
# Stopping condition to respect num_iterations, if given # Stopping condition to respect num_iterations, if given
it += 1 it += 1
if num_iterations > 0 and it >= num_iterations: if num_iterations > 0 and it >= num_iterations and split == "train":
last_step = True # toggle last_step to True, which will terminate the training loop last_step = True # toggle last_step to True, which will terminate the training loop
# Build up inputs/targets and yield # Build up inputs/targets and yield
for i in range(needed_tokens): for i in range(needed_tokens):