From 2bdc4544f295f806282d124359b440dbc05271bf Mon Sep 17 00:00:00 2001 From: Julien Chaumond Date: Thu, 10 Sep 2020 17:19:01 +0200 Subject: [PATCH] [AutoTokenizer] Correct error message --- src/transformers/tokenization_auto.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/transformers/tokenization_auto.py b/src/transformers/tokenization_auto.py index e56491d30cadc2..7e50e3fbcde83e 100644 --- a/src/transformers/tokenization_auto.py +++ b/src/transformers/tokenization_auto.py @@ -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