Skip to content

Commit

Permalink
Update tokenizer_spm.py to issue warning message only when 'spm' is u…
Browse files Browse the repository at this point in the history
…sed (#238)

* Update tokenizer_spm.py to issue warning message only when 'spm' is used

An attempt at fixing issue 219
#219
  • Loading branch information
Pogayo authored Jul 17, 2023
1 parent 38256a7 commit bafca9d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sacrebleu/tokenizers/tokenizer_spm.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ def signature(self):
def __init__(self, key="spm"):
self.name = SPM_MODELS[key]["signature"]

sacrelogger.warn("Tokenizer 'spm' has been changed to 'flores101', and may be removed in the future.")
if key == "spm":
sacrelogger.warn("Tokenizer 'spm' has been changed to 'flores101', and may be removed in the future.")

try:
import sentencepiece as spm
Expand Down

0 comments on commit bafca9d

Please sign in to comment.