Skip to content

Commit

Permalink
Update tokenization.py
Browse files Browse the repository at this point in the history
Logging "using sentence piece tokenzier." only when initializing the FullTokenizer
  • Loading branch information
arrrrrmin authored Feb 14, 2020
1 parent 4c601a1 commit ef80a5f
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions tokenization.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,15 +281,13 @@ def tokenize(self, text):

def convert_tokens_to_ids(self, tokens):
if self.sp_model:
tf.logging.info("using sentence piece tokenzier.")
return [self.sp_model.PieceToId(
printable_text(token)) for token in tokens]
else:
return convert_by_vocab(self.vocab, tokens)

def convert_ids_to_tokens(self, ids):
if self.sp_model:
tf.logging.info("using sentence piece tokenzier.")
return [self.sp_model.IdToPiece(id_) for id_ in ids]
else:
return convert_by_vocab(self.inv_vocab, ids)
Expand Down

0 comments on commit ef80a5f

Please sign in to comment.