Helsinki-NLP / Tatoeba-Challenge

Other
808 stars 91 forks source link

En-to-es model doesn't work #32

Closed ng1402 closed 7 months ago

ng1402 commented 1 year ago

I am trying to translate english to Spanish using model "Helsinki-NLP/opus-mt-en-es". This is my code snippet :

!pip install transformers !pip install sentencepiece from transformers import pipeline translator = pipeline("translation",model="Helsinki-NLP/opus-mt-en-es")

I am getting this error : "

ValueError Traceback (most recent call last) in <cell line: 1>() ----> 1 translator = pipeline("translation",model="Helsinki-NLP/opus-mt-en-es")

1 frames /usr/local/lib/python3.10/dist-packages/transformers/models/auto/tokenization_auto.py in from_pretrained(cls, pretrained_model_name_or_path, *inputs, *kwargs) 712 return tokenizer_class_py.from_pretrained(pretrained_model_name_or_path, inputs, **kwargs) 713 else: --> 714 raise ValueError( 715 "This tokenizer cannot be instantiated. Please make sure you have sentencepiece installed " 716 "in order to use this tokenizer."

ValueError: This tokenizer cannot be instantiated. Please make sure you have sentencepiece installed in order to use this tokenizer."

droussis commented 1 year ago

Try: !pip install transformers[sentencepiece]