OSError: You are trying to access a gated repo.

#14
by anothercoder2 - opened

Getting the error below.
Where do I accept the T&C for this model on HF?

OSError: You are trying to access a gated repo.
Make sure to have access to it at https://huggingface.co/google/gemma-2-2b.
401 Client Error. (Request ID: Root=1-66ac0be5-1eb9ab0d5dfd244b41149ad9;21ed4952-96b3-4a78-a22a-e0afc0f8e8ef)

Cannot access gated repo for url https://huggingface.co/google/gemma-2-2b/resolve/main/config.json.
Access to model google/gemma-2-2b is restricted. You must be authenticated to access it.

Google org

Hi @anothercoder2 ,

When you open any Gemma model card in HuggingFace, you'll be prompted to acknowledge the license. By clicking on it, you provide your consent and agree to the terms and conditions of Gemma.

Steps to Create a New Access Token with Read Permissions:

  1. Navigate to Your Profile:
    • Click on your profile icon located at the top right corner of the screen.
  2. Access Settings:
    • From the dropdown menu, select Settings to open your account settings page.
  3. Go to Access Tokens:
    • In the settings menu, find and click on Access Tokens. This section allows you to manage your personal access tokens.
  4. Create a New Token:
    • Click on the Create New Token button to generate a new access token.
  5. Set Permissions:
    • In the permissions section, ensure that Repositories permissions are configured with Read access. This is important for accessing the repositories you need.
  6. Generate Token:
    • Once you’ve configured the necessary permissions, click on Generate Token. Make sure to copy the token and store it securely, as it will only be displayed once.

After that, follow the lines of code below in your notebook:

      from huggingface_hub import login
      login(access_token)

If your still facing an issue, please let us know.

Thank you.

Sign up or log in to comment