fix condition to perform bpb evaluation

This commit is contained in:
Nitish Pandey 2025-11-23 12:07:40 +05:30
parent 4a87a0d19f
commit 861cbce2e9

View File

@ -188,7 +188,7 @@ while True:
last_step = bool(last_step_tensor.item())
# once in a while: evaluate the val bpb (all ranks participate)
if eval_every > 0 and (last_step or step % eval_every == 0):
if last_step or (eval_every > 0 and step % eval_every == 0):
model.eval()
val_loader = build_val_loader()
eval_steps = eval_tokens // (device_batch_size * max_seq_len * ddp_world_size)