405 : Client Error: Not Allowed for huggingface url

Viewed 255

I am trying to follow the huggingface tutorial on finetuning models for summarization. All I'm trying is to load the t5 tokenizer.

from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("t5-small")

And I get the following error: enter image description here ... ... enter image description here Please help. Thank you.

1 Answers

This solved the issue for me. You can add

import os
os.environ['TRANSFORMERS_OFFLINE'] = 'yes'

Quoting sgugger from here.

No that’s not a bug, the method tries to detect if a more recent version of the model is available, which is why it connects to the repo. To work fully offline, you need to set the environment variable TRANSFORMERS_OFFLINE to 1 or yes (see here 313).

Related