huggingface
network_error
ai_generated
true
OSError:model-org/model-name 不是本地文件夹,也不是 https://huggingface.co 上列出的有效模型标识符
OSError: model-org/model-name is not a local folder and is not a valid model identifier listed on 'https://huggingface.co'
ID: huggingface/model-id-not-found-local-or-remote
90%修复率
88%置信度
1证据数
2023-09-10首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| huggingface_hub>=0.16.0 | active | — | — | — |
| transformers>=4.25.0 | active | — | — | — |
| python>=3.8 | active | — | — | — |
根因分析
模型标识符在 Hugging Face Hub 上不存在,或本地路径错误,通常是由于拼写错误或仓库缺失。
English
The model identifier does not exist on Hugging Face Hub, or the local path is incorrect, often due to a typo or missing repository.
官方文档
https://huggingface.co/docs/hub/en/models解决方案
-
在 Hugging Face Hub 上验证模型 ID:https://huggingface.co/models?search=model-org/model-name。然后使用正确的 ID:model = AutoModel.from_pretrained('correct-org/correct-model') -
如果模型已手动下载,使用本地文件夹路径:model = AutoModel.from_pretrained('./local_model_folder')
无效尝试
常见但无效的做法:
-
70% 失败
The model ID should be 'org/name' without protocol, as the library automatically resolves it.
-
90% 失败
local_files_only=True prevents any network access, so the model must already be cached locally.