bugs when running this dataset

#4
by YunjinZhang - opened

I met a bug, which might be related to bugs in some field of the dataset:

I was running:

from datasets import load_dataset

dataset = load_dataset("togethercomputer/Long-Data-Collections", data_dir="pretrain", cache_dir="/mnt/localssd/dataset/long-data-collections")
print(dataset)

Here is the error

Generating train split: 1392058 examples [02:23, 9717.79 examples/s]
Traceback (most recent call last):
  File "/opt/venv/lib/python3.10/site-packages/datasets/builder.py", line 1871, in _prepare_split_single
    writer.write_table(table)
  File "/opt/venv/lib/python3.10/site-packages/datasets/arrow_writer.py", line 623, in write_table
    pa_table = table_cast(pa_table, self._schema)
  File "/opt/venv/lib/python3.10/site-packages/datasets/table.py", line 2293, in table_cast
    return cast_table_to_schema(table, schema)
  File "/opt/venv/lib/python3.10/site-packages/datasets/table.py", line 2241, in cast_table_to_schema
    raise CastError(
datasets.table.CastError: Couldn't cast
because column names don't match
text: string                                                                                                                                       [50/1831]
meta: struct<timestamp: double, yymm: string, arxiv_id: string, language: string, url: string>
  child 0, timestamp: double
  child 1, yymm: string
  child 2, arxiv_id: string
  child 3, language: string
  child 4, url: string
to
{'text': Value(dtype='string', id=None)}
because column names don't match

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/mnt/localssd/dataset/download_togeather.py", line 5, in <module>
    dataset = load_dataset("togethercomputer/Long-Data-Collections", data_dir="pretrain", cache_dir="/mnt/localssd/dataset/long-data-collections")
  File "/opt/venv/lib/python3.10/site-packages/datasets/load.py", line 2083, in load_dataset
    builder_instance.download_and_prepare(
  File "/opt/venv/lib/python3.10/site-packages/datasets/builder.py", line 925, in download_and_prepare
    self._download_and_prepare(
  File "/opt/venv/lib/python3.10/site-packages/datasets/builder.py", line 1001, in _download_and_prepare
    self._prepare_split(split_generator, **prepare_split_kwargs)
  File "/opt/venv/lib/python3.10/site-packages/datasets/builder.py", line 1742, in _prepare_split
    for job_id, done, content in self._prepare_split_single(
  File "/opt/venv/lib/python3.10/site-packages/datasets/builder.py", line 1873, in _prepare_split_single
    raise DatasetGenerationCastError.from_cast_error(
datasets.exceptions.DatasetGenerationCastError: An error occurred while generating the dataset

All the data files must have the same columns, but at some point there are 1 new columns ({'meta'})

This happened while the json dataset builder was generating data using

/mnt/localssd/.cache/huggingface/hub/datasets--togethercomputer--Long-Data-Collections/snapshots/613289c254401fcf41532d72e94eaf85a2554ae6/pretrain/arxiv_doc
_to_abs.jsonl.zst

Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manu
al-configuration#multiple-configurations)

my python env:
python: 3.10.16
datasets==3.4.0
numpy==2.2.4

Sign up or log in to comment