404 huggingface network_error ai_generated true

HTTPError: 404 客户端错误:未找到 URL:https://huggingface.co/api/models/org/nonexistent-model

HTTPError: 404 Client Error: Not Found for url: https://huggingface.co/api/models/org/nonexistent-model

ID: huggingface/model-card-not-found

其他格式: JSON · Markdown 中文 · English
95%修复率
90%置信度
1证据数
2023-01-05首次发现

版本兼容性

版本状态引入弃用备注
huggingface-hub>=0.11.0 active
transformers>=4.20.0 active

根因分析

模型标识符在 Hugging Face Hub 上不存在,可能是由于拼写错误、无访问权限的私有仓库或模型被删除。

English

The model identifier does not exist on the Hugging Face Hub, either due to a typo, private repository without access, or model deletion.

generic

官方文档

https://huggingface.co/docs/hub/en/models-identifiers

解决方案

  1. Verify the exact model identifier on the Hugging Face Hub and correct it: `model_id = 'bert-base-uncased'  # correct identifier`
  2. If the model is private, log in with `huggingface-cli login` and use `token=True` in `from_pretrained()`: `model = AutoModel.from_pretrained('org/private-model', token=True)`
  3. Search for the model using the Hub API: `import requests; r = requests.get('https://huggingface.co/api/models?search=bert'); r.json()` to find valid identifiers.

无效尝试

常见但无效的做法:

  1. Adding `--use_auth_token` or `token=True` without a valid token 80% 失败

    If the model does not exist at all, authentication does not help; 404 persists.

  2. Checking the model page manually but not correcting the identifier in code 90% 失败

    The code still uses the wrong identifier; manual verification does not fix the programmatic call.

  3. Clearing the cache and retrying 70% 失败

    The error is a server-side 404, not a cache issue; clearing cache has no effect.