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

Commit 16396e0

Browse files
committed
fix decode_from_file
1 parent 097ea5f commit 16396e0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tensor2tensor/utils/decoding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ def _get_sorted_inputs(filename, num_shards=1, delimiter="\n"):
512512
with tf.gfile.Open(decode_filename) as f:
513513
text = f.read()
514514
records = text.split(delimiter)
515-
inputs = [record.strip() for record in records]
515+
inputs = [record.strip() for record in records[:-1]]
516516
input_lens = [(i, len(line.split())) for i, line in enumerate(inputs)]
517517
sorted_input_lens = sorted(input_lens, key=operator.itemgetter(1))
518518
# We'll need the keys to rearrange the inputs back into their original order

0 commit comments

Comments
 (0)