Accessing RAGBENCH dataset using API Inference

Hello,

I am trying to access the RAGBENCH dataset via API Inference as follows:
def load_ragbench_dataset(config_name=“covidqa”):
print(“Fetching RAGBench dataset via Hugging Face API…”)
dataset_url = f"https://datasets-server.huggingface.co/datasets/rungalileo/ragbench/config/{config_name}"
response = requests.get(dataset_url, headers=headers)
if response.status_code == 200:
dataset = response.json()
print(“Dataset fetched successfully.”)
return dataset
else:
print(f"Error fetching dataset: {dataset_url}, {response.status_code}, {response.text}“)
raise ValueError(f"Error fetching dataset: {response.status_code}, {response.text}”)

But I am getting the following error:
Fetching RAGBench dataset via Hugging Face API…
Error fetching dataset: https://datasets-server.huggingface.co/datasets/rungalileo/ragbench/config/covidqa, 404, Not Found

Could you please suggest an approach to fix this issue/error?

Thanks!

2 Likes

maybe

#dataset_url = f"https://datasets-server.huggingface.co/datasets/rungalileo/ragbench/config/{config_name}"
dataset_url = f"https://datasets-server.huggingface.co/datasets/rungalileo/ragbench/resolve/main/config/{config_name}"
1 Like

from datasets import get_dataset_config_names

configs = get_dataset_config_names(“rungalileo/ragbench”)
print(configs) # Lists all available configurations

1 Like