When I try to run the sentiment analysis, as soon as I execute
nlp("I feel good"),
I get
zsh: bus error python
The problem turned out to be this code:
nlp = pipeline("sentiment-analysis")
After this step, I get - among other info - this line back:
Hardware accelerator e.g. GPU is available in the environment, but no device argument is passed to the Pipeline object. Model will be on CPU.
So I decided to provide the 'device' argument. If MPS is present on the machine, I can create the pipeline like this:
nlp = pipeline("sentiment-analysis", device="mps")
The documentation is here:
https://huggingface.co/docs/transformers/v4.44.0/en/main_classes/pipelines#transformers.pipeline
Now the sentiment analysis runs.
When I try to run the sentiment analysis, as soon as I execute
nlp("I feel good"),I get
The problem turned out to be this code:
nlp = pipeline("sentiment-analysis")After this step, I get - among other info - this line back:
So I decided to provide the 'device' argument. If MPS is present on the machine, I can create the pipeline like this:
nlp = pipeline("sentiment-analysis", device="mps")The documentation is here:
https://huggingface.co/docs/transformers/v4.44.0/en/main_classes/pipelines#transformers.pipeline
Now the sentiment analysis runs.