Huggingface Jupyter Notebook Login

Hi Huggingface users!

I am facing an issue. When I open my Jupyter notebook, and I type in a cell

from huggingface_hub import notebook_login
notebook_login()

I get the huggingface login. I type my username (wilornel) and password (secret), and press Login.

Then, a dialog appears:

Kernel Restarting
The kernel for Untitled2.ipynb appears to have died. It will restart automatically.
```.

I tried with my email address for the username. I tried with a bad password. It all does not work.

Please help.

Thank you!

Wilornel

Hello Wilornel,
I hope you have figured out a solution to your issue. If you have not, and for anyone else who Googled and found this post, here is the solution.

The box that pops up in your Python notebook’s output cell is meant for a huggingface access token that you are to create from within your huggingface.co profile. Follow these steps to login.

  1. Login to your huggingface.co account.
  2. Navigate to your “profile”.
  3. Navigate to “settings”.
  4. Click “Access Tokens” on the left hand side of the page.
  5. Click “Create new token”.
  6. Click “Write” to give a notebook with this code read and write permission or select specific permissions.
  7. Type a name in the box and create the token.
  8. Copy the token and paste it into the popup box from within your python notebook.

You should now be logged in to huggingface from within that notebook.

1 Like