Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot load dataset from Hugging Face #5

Open
NafisSadeq opened this issue Nov 6, 2023 · 2 comments
Open

Cannot load dataset from Hugging Face #5

NafisSadeq opened this issue Nov 6, 2023 · 2 comments

Comments

@NafisSadeq
Copy link

NafisSadeq commented Nov 6, 2023

Hi, I could not load the dataset using datasets library. This is the error I am getting:

DatasetGenerationError: An error occurred while generating the dataset

Any idea what might cause this error? I used the following code:

from datasets import load_dataset
dataset = load_dataset("ZenMoore/RoleBench")
@Bachstelze
Copy link

Any hints on how to load this dataset?

@Bachstelze
Copy link

A possible workaround is to load the files via separate requests:

import requests
import json

role_general_url = "https://huggingface.co/datasets/ZenMoore/RoleBench/raw/main/rolebench-eng/role-generalization/general/test.jsonl"
role_instruction_url = "https://huggingface.co/datasets/ZenMoore/RoleBench/raw/main/rolebench-eng/instruction-generalization/role_specific/train.jsonl"
generalization_instruction_url = "https://huggingface.co/datasets/ZenMoore/RoleBench/resolve/main/rolebench-eng/instruction-generalization/general/train.jsonl"

def load_dict_from_url(json_url):
  role_data = requests.get(json_url, verify=False)
  json_responses = role_data.text.split('\n')
  list_of_role_dicts = []
  for item in json_responses:
    list_of_role_dicts.append(json.loads(item))

  return list_of_role_dicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants