Skip to content

Commit

Permalink
[AutoTokenizer] Correct error message
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-c authored and Zigur committed Oct 26, 2020
1 parent ce41483 commit 2bdc454
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/transformers/tokenization_auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,9 @@ def from_pretrained(cls, pretrained_model_name_or_path, *inputs, **kwargs):
tokenizer_class_candidate = config.tokenizer_class
tokenizer_class = globals().get(tokenizer_class_candidate)
if tokenizer_class is None:
raise ValueError("Tokenizer class {} does not exist or is not currently imported.")
raise ValueError(
"Tokenizer class {} does not exist or is not currently imported.".format(tokenizer_class_candidate)
)
return tokenizer_class.from_pretrained(pretrained_model_name_or_path, *inputs, **kwargs)

# if model is an encoder decoder, the encoder tokenizer class is used by default
Expand Down

0 comments on commit 2bdc454

Please sign in to comment.