Skip to content

Commit

Permalink
fix iterator when loading from checkpoint (#5344)
Browse files Browse the repository at this point in the history
Co-authored-by: Junteng Jia <[email protected]>
  • Loading branch information
000Justin000 and Junteng Jia authored Oct 9, 2023
1 parent 7409af7 commit c7c478b
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 c7c478b

Please sign in to comment.