Datasets:

Modalities:
Text
ArXiv:
Libraries:
Datasets

Missing file error

#9
by emrgnt-cmplxty - opened

I wrote a short script to run the data streamer:

    ds_iterator = load_dataset(
        "togethercomputer/RedPajama-Data-V2",
        snapshots=["2023-14"],
        languages=["en"],
        name="default",
        streaming=True,
    )

and I quickly found this error:

-bash-4.2$ python3 filter_rpj.py 
getting data iterator
Using custom data configuration default-18df3f9c3df27db5
running iterator
Traceback (most recent call last):
  File "/home/ec2-user/data_scrape_efforts/red_pajama_data/filter_rpj.py", line 55, in <module>
    for sample in ds_iterator["train"]:
  File "/opt/conda/lib/python3.10/site-packages/datasets/iterable_dataset.py", line 723, in __iter__
    for key, example in self._iter():
  File "/opt/conda/lib/python3.10/site-packages/datasets/iterable_dataset.py", line 713, in _iter
    yield from ex_iterable
  File "/opt/conda/lib/python3.10/site-packages/datasets/iterable_dataset.py", line 113, in __iter__
    yield from self.generate_examples_fn(**self.kwargs)
  File "/home/ec2-user/.cache/huggingface/modules/datasets_modules/datasets/togethercomputer--RedPajama-Data-V2/4db97fc3d3261d52f9b87fcab64d3a258ca823adc36138396a5b5c7da789550e/RedPajama-Data-V2.py", line 294, in _generate_examples
    for sample in self._handle_head_middle_partition(
  File "/home/ec2-user/.cache/huggingface/modules/datasets_modules/datasets/togethercomputer--RedPajama-Data-V2/4db97fc3d3261d52f9b87fcab64d3a258ca823adc36138396a5b5c7da789550e/RedPajama-Data-V2.py", line 324, in _handle_head_middle_partition
    with gzip.open(doc_file, "rt", encoding="utf-8") as df:
  File "/opt/conda/lib/python3.10/gzip.py", line 58, in open
    binary_file = GzipFile(filename, gz_mode, compresslevel)
  File "/opt/conda/lib/python3.10/gzip.py", line 174, in __init__
    fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'https://data.together.xyz/redpajama-data-v2/v1.0.0/documents/2014-15/0000/en_head.json.gz'

How do we resolve this?

This comment has been hidden
Together org

Hi @emrgnt-cmplxty -- can you show me the code you are using so that I can reproduce your error?

Streaming from the ds_iterator you provided does not lead to any error. The following code snippet prints the first 5 samples for example:

ds_iterator = load_dataset(
    "togethercomputer/RedPajama-Data-V2",
    snapshots=["2023-14"],
    languages=["en"],
    name="default",
    streaming=True
)

for i, sample in enumerate(ds_iterator["train"]):
    print(sample)
    if i == 4:
        break    

Thanks, I think this must have been datasets version related or some other env issue as it's working after uninstalling and re-installing datasets.

emrgnt-cmplxty changed discussion status to closed

Sign up or log in to comment