Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

tokenization: log spm usage only in debug mode to avoid console spamming #268

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions tokenization.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,15 +233,15 @@ def tokenize(self, text):

def convert_tokens_to_ids(self, tokens):
if self.sp_model:
tf.logging.info("using sentence piece tokenzier.")
tf.logging.debug("using sentence piece tokenizer.")
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.")
tf.logging.debug("using sentence piece tokenizer.")
return [self.sp_model.IdToPiece(id_) for id_ in ids]
else:
return convert_by_vocab(self.inv_vocab, ids)
Expand Down