Skip to content

Commit

Permalink
Additionaly checking reset_for_eval=False before throwing the exhau…
Browse files Browse the repository at this point in the history
…sted dataset error.

PiperOrigin-RevId: 660839907
  • Loading branch information
The paxml Authors committed Aug 8, 2024
1 parent 0080ea2 commit c36b3c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion paxml/seqio_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,7 @@ def _get_targets(self) -> Mapping[str, NestedMap]:
if self.ds_ragged_tensor_keys:
example_orig = next(self.targets_iter_ori)
except (tf.errors.OutOfRangeError, StopIteration) as exc:
if self._num_eval_examples > 0:
if self._num_eval_examples > 0 and not self.reset_for_eval:
raise StopIteration(
'Exhausted eval data with reset_for_eval=False after'
f' {num_examples-1} examples (batch_size={self.batch_size})'
Expand Down

0 comments on commit c36b3c6

Please sign in to comment.