Jupyter kernel dies when importing pipeline function from transformers class on Mac OS

Question:

I’m unable to import pipeline function of transformers class as my jupyter kernel keeps dying. Tried on transformers-4.15.0 and 4.16.2. Anyone faced this issue?

I tried importing the class in a new notebook as you can see in the image and it keeps killing the kernel.

Jupyter Lab Screenshot

Asked By: Angad Chandhok

||

Answers:

It works fine for me.

enter image description here

You could try creating a fresh conda environment and reinstalling the app.

You could also try using jupyterlab instead of jupyter-notebook.

Are you on Mac OS? I couldn’t get it to run at first using conda install transformers my jupyterlab kept hanging as well.

Then I did this, conda install -c huggingface transformers and here is the result.

enter image description here

It works fine for me on linux and Mac now.

Answered By: anarchy

If you are working on a Mac with a M1 silicon chip, you could try reinstalling transformers through huggingface using conda install -c huggingface transformers. It worked for me with Python 3.9 in a notebook when i had the same issue.

Answered By: Sebastian