Skip to content
This repository was archived by the owner on Jul 7, 2023. It is now read-only.

Commit 39ddff9

Browse files
authored
Merge pull request #608 from bwilbertz/fix-txt-iterator
fix txt_line_iterator to not stop at empty line
2 parents ac62e8f + 8df5591 commit 39ddff9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tensor2tensor/data_generators/text_problems.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,9 +418,9 @@ def example_reading_spec(self):
418418
def txt_line_iterator(txt_path):
419419
"""Iterate through lines of file."""
420420
with tf.gfile.Open(txt_path) as f:
421-
readline = lambda: f.readline().strip()
421+
readline = lambda: f.readline()
422422
for line in iter(readline, ""):
423-
yield line
423+
yield line.strip()
424424

425425

426426
def text2text_txt_iterator(source_txt_path, target_txt_path):

0 commit comments

Comments
 (0)