diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 index dd84837dd..80f48a2fd --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,8 @@ # PyPI distribution artificats build/ dist/ + +# Sublime project files +*.sublime-project +*.sublime-workspace + diff --git a/tensor2tensor/data_generators/text_encoder.py b/tensor2tensor/data_generators/text_encoder.py old mode 100644 new mode 100755 index 1bf7539d3..6cfa9e740 --- a/tensor2tensor/data_generators/text_encoder.py +++ b/tensor2tensor/data_generators/text_encoder.py @@ -321,10 +321,10 @@ def bisect(min_val, max_val): other_subtokenizer = bisect(present_count + 1, max_val) else: other_subtokenizer = bisect(min_val, present_count - 1) - if (abs(other_subtokenizer.vocab_size - target_size) < - abs(subtokenizer.vocab_size - target_size)): - return other_subtokenizer - return subtokenizer + if (abs(other_subtokenizer.vocab_size - target_size) < + abs(subtokenizer.vocab_size - target_size)): + return other_subtokenizer + return subtokenizer return bisect(min_val, max_val)