-1

I'm trying to follow the quick tour example here: https://huggingface.co/docs/transformers/quicktour

and i'm getting a "bus error".

My env is:

  • MacOS Sonoma 14.7, Apple M1 Max chip
  • Python 3.11.5
  • pip install transformers datasets evaluate accelerate
  • pip install tf-keras

Running this code:

from transformers import pipeline

classifier = pipeline("sentiment-analysis")
result = classifier("We are very happy to show you the 🤗 Transformers library.")
print(result)

And getting this result:

No model was supplied, defaulted to distilbert/distilbert-base-uncased-finetuned-sst-2-english and revision 714eb0f (https://huggingface.co/distilbert/distilbert-base-uncased-finetuned-sst-2-english).

Using a pipeline without specifying a model name and revision in production is not recommended. [1]

92883 bus error python main.py

Any ideas?

Thanks for your help.

1 Answer 1

1

using device=0 (the first GPU) solved this:

classifier = pipeline("sentiment-analysis", device=0)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.