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

其他格式: JSON · Markdown 中文 · English
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.

generic

官方文档

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

解决方案

  1. 在 Hugging Face Hub 上验证模型 ID:https://huggingface.co/models?search=model-org/model-name。然后使用正确的 ID:model = AutoModel.from_pretrained('correct-org/correct-model')
  2. 如果模型已手动下载,使用本地文件夹路径:model = AutoModel.from_pretrained('./local_model_folder')

无效尝试

常见但无效的做法:

  1. 70% 失败

    The model ID should be 'org/name' without protocol, as the library automatically resolves it.

  2. 90% 失败

    local_files_only=True prevents any network access, so the model must already be cached locally.