Gated Repo Access in Google Colab
I am getting this error:
OSError: You are trying to access a gated repo.
Make sure to have access to it at https://huggingface.co./google/gemma-7b.
401 Client Error. (Request ID: Root=1-65e56481-05d4e73c3b3b3f11512a5693;8930f691-51e9-4c80-8596-7796518b78df)
Cannot access gated repo for url https://huggingface.co./google/gemma-7b/resolve/main/config.json.
Repo model Google/GEMMA-7B is gated. You must be authenticated to access it.
When running this code:
model_id = "google/gemma-7b"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, cache_dir='./workspace/',
torch_dtype=torch.bfloat16, trust_remote_code=True, device_map="auto", offload_folder="offload")
model.eval()
pipeline = transformers.pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
device_map="auto",
max_length=1000,
do_sample=True,
top_k=10,
num_return_sequences=1,
eos_token_id=tokenizer.eos_token_id
)
Please help me fix this, as I have access to the model on hugginface cannot run the code on google colab
You will need to follow https://huggingface.co./docs/hub/en/models-gated#access-gated-models-as-a-user and agree to the terms and conditions, and then it should work
Yes, make sure to login into your HF account in the notebook by calling the cell:
from huggingface_hub import notebook_login
notebook_login()
Thank you so much @ybelkada . I was facing the same problem and now it is fixed.
OSError: You are trying to access a gated repo.
Make sure to have access to it at https://huggingface.co./mistralai/Mistral-7B-Instruct-v0.3.
403 Client Error. (Request ID: Root=1-665909a3-3a369ad93bb01ba355c2fbd0;e1c179f0-83dc-408b-8c02-873b6da66b18)
Cannot access gated repo for url https://huggingface.co./mistralai/Mistral-7B-Instruct-v0.3/resolve/main/config.json.
Access to model mistralai/Mistral-7B-Instruct-v0.3 is restricted and you are not in the authorized list. Visit https://huggingface.co./mistralai/Mistral-7B-Instruct-v0.3 to ask for access.