Error when loading the dataset

#1
by AntonVoronov - opened

I can't load your dataset using df = load_dataset("zihanz/RetrievalQA"). Here's the error message:

Generating train split: 0 examples [00:00, ? examples/s]
Traceback (most recent call last):
  File "/home/notantonvoron/.rye/py/cpython@3.12.5/lib/python3.12/site-packages/datasets/packaged_modules/json/json.py", line 160, in _generate_tables
    df = pandas_read_json(f)
         ^^^^^^^^^^^^^^^^^^^
  File "/home/notantonvoron/.rye/py/cpython@3.12.5/lib/python3.12/site-packages/datasets/packaged_modules/json/json.py", line 38, in pandas_read_json
    return pd.read_json(path_or_buf, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/notantonvoron/.rye/py/cpython@3.12.5/lib/python3.12/site-packages/pandas/io/json/_json.py", line 815, in read_json
    return json_reader.read()
           ^^^^^^^^^^^^^^^^^^
  File "/home/notantonvoron/.rye/py/cpython@3.12.5/lib/python3.12/site-packages/pandas/io/json/_json.py", line 1025, in read
    obj = self._get_object_parser(self.data)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/notantonvoron/.rye/py/cpython@3.12.5/lib/python3.12/site-packages/pandas/io/json/_json.py", line 1051, in _get_object_parser
    obj = FrameParser(json, **kwargs).parse()
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/notantonvoron/.rye/py/cpython@3.12.5/lib/python3.12/site-packages/pandas/io/json/_json.py", line 1187, in parse
    self._parse()
  File "/home/notantonvoron/.rye/py/cpython@3.12.5/lib/python3.12/site-packages/pandas/io/json/_json.py", line 1403, in _parse
    ujson_loads(json, precise_float=self.precise_float), dtype=None
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: Trailing data

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/notantonvoron/.rye/py/cpython@3.12.5/lib/python3.12/site-packages/datasets/builder.py", line 1997, in _prepare_split_single
    for _, table in generator:
                    ^^^^^^^^^
  File "/home/notantonvoron/.rye/py/cpython@3.12.5/lib/python3.12/site-packages/datasets/packaged_modules/json/json.py", line 163, in _generate_tables
    raise e
  File "/home/notantonvoron/.rye/py/cpython@3.12.5/lib/python3.12/site-packages/datasets/packaged_modules/json/json.py", line 137, in _generate_tables
    pa_table = paj.read_json(
               ^^^^^^^^^^^^^^
  File "pyarrow/_json.pyx", line 308, in pyarrow._json.read_json
  File "pyarrow/error.pxi", line 155, in pyarrow.lib.pyarrow_internal_check_status
  File "pyarrow/error.pxi", line 92, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: JSON parse error: Column(/context/[]) changed from object to string in row 14

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/notantonvoron/.rye/py/cpython@3.12.5/lib/python3.12/site-packages/datasets/load.py", line 2628, in load_dataset
    builder_instance.download_and_prepare(
  File "/home/notantonvoron/.rye/py/cpython@3.12.5/lib/python3.12/site-packages/datasets/builder.py", line 1029, in download_and_prepare
    self._download_and_prepare(
  File "/home/notantonvoron/.rye/py/cpython@3.12.5/lib/python3.12/site-packages/datasets/builder.py", line 1124, in _download_and_prepare
    self._prepare_split(split_generator, **prepare_split_kwargs)
  File "/home/notantonvoron/.rye/py/cpython@3.12.5/lib/python3.12/site-packages/datasets/builder.py", line 1884, in _prepare_split
    for job_id, done, content in self._prepare_split_single(
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/notantonvoron/.rye/py/cpython@3.12.5/lib/python3.12/site-packages/datasets/builder.py", line 2040, in _prepare_split_single
    raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.exceptions.DatasetGenerationError: An error occurred while generating the dataset

Hi, can you please try the updated dataset here: https://huggingface.co/datasets/hyintell/RetrievalQA
I have migrated the dataset. Thanks.

Sign up or log in to comment