Skip to content
This repository was archived by the owner on Jul 7, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tensor2tensor/utils/decoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ def _get_sorted_inputs(filename, num_shards=1, delimiter="\n"):
with tf.gfile.Open(decode_filename) as f:
text = f.read()
records = text.split(delimiter)
inputs = [record.strip() for record in records]
inputs = [record.strip() for record in records[:-1]]
input_lens = [(i, len(line.split())) for i, line in enumerate(inputs)]
sorted_input_lens = sorted(input_lens, key=operator.itemgetter(1))
# We'll need the keys to rearrange the inputs back into their original order
Expand Down