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

Commit

Permalink
Merge pull request #78 from vthorsteinsson/fix-indent
Browse files Browse the repository at this point in the history
Fix wrong indent in text_encoder.py
  • Loading branch information
lukaszkaiser authored Jun 30, 2017
2 parents aae9966 + d4c7b92 commit 0d5422d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@
# PyPI distribution artificats
build/
dist/

# Sublime project files
*.sublime-project
*.sublime-workspace

8 changes: 4 additions & 4 deletions tensor2tensor/data_generators/text_encoder.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 0d5422d

Please sign in to comment.