Problems with pipeline("sentiment-analysis")

#11
by melslater - opened

hi, On 2 different Macs, one with the M1 chip and the other slightly older without, I am unable to use e.g.
nlp = pipeline("sentiment-analysis", model='nlptown/bert-base-multilingual-uncased-sentiment'), or even just
pipeline("sentiment-analysis").

I've been trying all kinds of combinations for hours but it insists that tensorflow or PyTorch are not installed, but they definitely are installed, and in the correct environment.

A few weeks ago all this was working fine.

Does anyone have any suggestions?

thanks
Mel

Forgot to say that this is using Visual Studio Code.

No issues running this on M1 Mac and within VS Code inside a Jupyter Notebook.

model_path = f'nlptown/bert-base-multilingual-uncased-sentiment'
from transformers import pipeline
sentiment_task = pipeline("sentiment-analysis", model=model_path, tokenizer=model_path)
sentiment_task("This was amazing! EXCELLENT")

Sign up or log in to comment