TypeError: 'NoneType' object is not callable Tokenizer

#1
by CristianTacoronteRivero - opened

Hello! I try to load the model but it gives me an error with the tokenizer. the error is the following:

from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("Helsinki-NLP/opus-mt-ROMANCE-en")
model = AutoModelForSeq2SeqLM.from_pretrained("Helsinki-NLP/opus-mt-ROMANCE-en")


TypeError Traceback (most recent call last)
Cell In [25], line 3
1 from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
----> 3 tokenizer = AutoTokenizer.from_pretrained("Helsinki-NLP/opus-mt-ROMANCE-en")
5 model = AutoModelForSeq2SeqLM.from_pretrained("Helsinki-NLP/opus-mt-ROMANCE-en")

File c:\Users\ctacoronte\Anaconda3\envs\scrapy\lib\site-packages\transformers\models\auto\tokenization_auto.py:640, in AutoTokenizer.from_pretrained(cls, pretrained_model_name_or_path, *inputs, **kwargs)
638 else:
639 if tokenizer_class_py is not None:
--> 640 return tokenizer_class_py.from_pretrained(pretrained_model_name_or_path, *inputs, **kwargs)
641 else:
642 raise ValueError(
643 "This tokenizer cannot be instantiated. Please make sure you have sentencepiece installed "
644 "in order to use this tokenizer."
645 )

TypeError: 'NoneType' object is not callable

Sign up or log in to comment