Unable to login to Hugging Face via Google Colab

#129
by Sebalon - opened

The Hugging Face login request on colab refuses to progress and indicates that I need to accept the licence for the model card but I've already done that for both 1.4 and 1.5. Please help.

can add to this, am having the same problem on the sd_textual_inversion_training.ipynb colab. The error message is the one you get when you haven't accepted the license, which I already had done.

Do you have this error when downloading the model or when pushing it?

I have no problem downloading the model

I'm still unable login to Hugging Face via google colab or access the accepted licence

Same issue here.

Hey all! A bit more input on your issue would be helpful for us to help you.

Could you confirm you followed the next steps?

  1. Go to https://huggingface.co/CompVis/stable-diffusion-v1-4 and accept the license
  2. Go to https://huggingface.co/settings/tokens and create a token
  3. Go to a Colab and use huggingface_hub notebook_login method.
  4. Put the token there
  5. Run the following code
pipe = StableDiffusionPipeline.from_pretrained(model_id, use_auth_token=True)

In which of these steps is it failing for you?

Yes I had already completed all of the above steps apart from entering the code, I performed that step after applying the token into the relevant field and received this error:

NameError Traceback (most recent call last)
in
6 HUGGINGFACE_TOKEN = "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" #@param {type:"string"}
7 get_ipython().system('echo -n "{HUGGINGFACE_TOKEN}" > ~/.huggingface/token')
----> 8 pipe = StableDiffusionPipeline.from_pretrained(model_id, use_auth_token=True)

NameError: name 'StableDiffusionPipeline' is not defined

You need to also install diffusers

pip install --upgrade diffusers transformers scipy

And import StableDiffusionPipeline

from diffusers import StableDiffusionPipeline

before running the code to load it

could you please share the colab notebook you are using?

Yes I've already done all this, I've used dreambooth quite a lot already on 1.4 and 1.5, activating and completing each of the cells with no issue. The problem is, the login cell won't connect me to the hugging face licence anymore.
These codes that you ask me to enter, which cell should I enter them in? I'm not a coder so your going to need to elaborate a bit more than that please.
How do I import "stablediffusionpipeline" before running the code? Normally this all works just from activating each cell in order.

I tried entering the first code "pipe = StableDiffusionPipeline.from_pretrained(model_id, use_auth_token=True)" into the login cell again after installing the diffusers but just got the same error code:

NameError Traceback (most recent call last)
in
6 HUGGINGFACE_TOKEN = "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" #@param {type:"string"}
7 get_ipython().system('echo -n "{HUGGINGFACE_TOKEN}" > ~/.huggingface/token')
----> 8 pipe = StableDiffusionPipeline.from_pretrained(model_id, use_auth_token=True)

NameError: name 'StableDiffusionPipeline' is not defined

I believe the problem might have started when the Colab notebook was updated to point to the new 1.5 model, thats the one thing I know changed roughly about the time it stopped working for me.

I've tried accessing with an alt account and have met the same problem, I've tried accessing through an alternate browser and still meet the same problem

I believe the problem might have started when the Colab notebook was updated to point to the new 1.5 model, thats the one thing I know changed roughly about the time it stopped working for me.

That's when it started for me as well.

FYI that colab is not an official Hugging Face repo, so opening issues there might be better. Note that they seem to be having some issues on that end https://github.com/ShivamShrirao/diffusers/issues/50

Ok thanks, my initial thought was a problem with Hugging Face but, I'd not thought to look on the collab. I'll go log a report on there now

Sign up or log in to comment