huggingface-transformers - 405 : Client Error: Not Allowed for huggingface url

标签 huggingface-transformers http-status-code-405 huggingface-tokenizers

我正在尝试遵循“huggingface”教程中关于微调模型的总结。 我所尝试的只是加载 t5 分词器。

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

我收到以下错误: enter image description here ... ... enter image description here 请帮忙。谢谢。

最佳答案

这为我解决了这个问题。您可以添加

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/

相关文章:

python - 来自 Transformers 的 BertForSequenceClassification 的大小不匹配和多类问题

python - 具有 dropout 设置的 Transformers 预训练模型

deep-learning - token 索引序列长度大于此模型的指定最大序列长度 (651 > 512),带有 Hugging face 情感分类器

java - 尝试执行 POST 时不允许使用 REST Java 方法

python - Django - 提交联系表单时出现 405 错误

pytorch - 如何从输入 ID 获取填充掩码?

javascript - 发布网站后,使用 AngularJS 发布表单返回 405 代码

python - 拥抱脸 - GPT2 中未知 token 的高效标记化

bert-language-model - PyTorch 中 Bert 预训练模型推理的正常速度是多少