ConnectionError: Couldn‘t reach https://raw.githubuserc//huggingface/datasets/1.15.1/datasets/squad/

出错的地方

data_args.dataset_name = 'squad'
raw_datasets = load_dataset(`data_args.dataset_name`)

报错:

ConnectionError: Couldn‘t reach https://raw.githubuserc//huggingface/datasets/1.15.1/datasets/squad/squad.py

解决方案

把文件直接下载到本地
下载地址 https://codeload.github.com/huggingface/datasets/zip/refs/tags/1.15.1
ConnectionError: Couldn‘t reach https://raw.githubuserc//huggingface/datasets/1.15.1/datasets/squad/
ConnectionError: Couldn‘t reach https://raw.githubuserc//huggingface/datasets/1.15.1/datasets/squad/
这个文件是处理原始数据的函数,进入函数需要修改一下你存放原始数据的地址。


_URL = "../../../data/squad/"
_URLS = {
    "train": _URL + "train-v1.1.json",
    "dev": _URL + "dev-v1.1.json",
}

ConnectionError: Couldn‘t reach https://raw.githubuserc//huggingface/datasets/1.15.1/datasets/squad/
当然你要修改load_dataset的地址,改成你的本地地址

raw_datasets = load_dataset('tasks/qa/'+data_args.dataset_name)

运行可以看到这些数据已经被加载到本地了
ConnectionError: Couldn‘t reach https://raw.githubuserc//huggingface/datasets/1.15.1/datasets/squad/

上一篇:react 中401问题-整体说明


下一篇:mysql操作索引的sql语句