我正在尝试遵循“huggingface”教程中关于微调模型的总结。 我所尝试的只是加载 t5 分词器。
from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("t5-small")
最佳答案
这为我解决了这个问题。您可以添加
import os
os.environ['TRANSFORMERS_OFFLINE'] = 'yes'
引用 here 的 sugger .
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).
关于huggingface-transformers - 405 : Client Error: Not Allowed for huggingface url,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71655721/