Skip to content

Commit

Permalink
fix iterator when loading from checkpoint (facebookresearch#5344)
Browse files Browse the repository at this point in the history
Co-authored-by: Junteng Jia <[email protected]>
  • Loading branch information
2 people authored and zobadaniel committed Mar 1, 2024
1 parent cdf276b commit 3b74696
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fairseq/data/iterators.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ def _get_iterator_for_epoch(
# TODO: Below is a lazy implementation which discard the final batch regardless
# of whether it is a full batch or not.

total_num_itrs = len(self.epoch_batch_sampler) - 1
total_num_itrs = len(itr) - 1
itr.take(total_num_itrs)
logger.info(f"skip final residual batch, total_num_itrs = {total_num_itrs}")

Expand Down

0 comments on commit 3b74696

Please sign in to comment.