You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

向Hugging Face Hub推送数据集时遭遇404 NotFound错误求助

解决Hugging Face Hub数据集推送/下载404错误

你遇到的错误如下:

requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://huggingface.co/api/models/aben118/common_voice_16_2_hi_pseudo_labelled/revision/main
Repository Not Found for url: https://huggingface.co/api/models/aben118/common_voice_16_2_hi_pseudo_labelled/revision/main.
请确保已指定正确的repo_id和repo_type。若访问私有或gated仓库,请确保已完成身份验证。

错误原因分析

  1. 仓库类型不匹配:错误请求路径是/api/models/...,说明工具默认在模型仓库中查找,但你创建的是数据集仓库,未显式指定类型导致查找失败
  2. 仓库名称不一致:错误信息中的仓库名是common_voice_16_2_hi_pseudo_labelled,但代码里使用的是common_voice_16_1_hi_pseudo_labelled,版本号(16_2 vs 16_1)不匹配

修正步骤

  • 统一所有操作的repo_id,确保拼写、版本号完全一致
  • 调用snapshot_download时必须显式添加repo_type="dataset"参数,避免默认查找模型仓库
  • 确认token已正确配置且拥有目标仓库的访问权限

修正后的代码

from huggingface_hub import create_repo, snapshot_download

# 创建数据集仓库(保持repo_id统一)
create_repo("aben118/common_voice_16_1_hi_pseudo_labelled", repo_type="dataset", exist_ok=True, token=<your_token>)

# 下载时指定repo_type为dataset,确保匹配仓库类型
snapshot_download(
    repo_id="aben118/common_voice_16_1_hi_pseudo_labelled",
    local_dir="./common_voice_16_1_hi_pseudo_labelled",
    repo_type="dataset",
    token=<your_token>
)

内容的提问来源于stack exchange,提问作者afsara_ben

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.25 10:33:34