# OSError：model-org/model-name 不是本地文件夹，也不是 https://huggingface.co 上列出的有效模型标识符

- **ID:** `huggingface/model-id-not-found-local-or-remote`
- **领域:** huggingface
- **类别:** network_error
- **验证级别:** ai_generated
- **修复率:** 90%

## 根因

模型标识符在 Hugging Face Hub 上不存在，或本地路径错误，通常是由于拼写错误或仓库缺失。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| huggingface_hub>=0.16.0 | active | — | — |
| transformers>=4.25.0 | active | — | — |
| python>=3.8 | active | — | — |

## 解决方案

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')
   ```

## 无效尝试

- **** — The model ID should be 'org/name' without protocol, as the library automatically resolves it. (70% 失败率)
- **** — local_files_only=True prevents any network access, so the model must already be cached locally. (90% 失败率)
