Datasets:
Dataset Viewer issue: Extraction protocol for TAR archives is not implemented in streaming mode
#1
by
albertvillanova
HF staff
- opened
The dataset viewer is not working.
Error details:
Error code: InfoError
Exception: SplitsNotFoundError
Message: The split names could not be parsed from the dataset config.
Traceback: Traceback (most recent call last):
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/inspect.py", line 388, in get_dataset_config_info
for split_generator in builder._split_generators(
File "/tmp/modules-cache/datasets_modules/datasets/ceval--ceval-exam/955d76b4f8ea8c9b6a14519905c8c10f781d3feb698126e274d2eb16cefc671f/ceval-exam.py", line 130, in _split_generators
data_dir = dl_manager.download_and_extract(_URL)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 1087, in download_and_extract
return self.extract(self.download(url_or_urls))
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 1039, in extract
urlpaths = map_nested(self._extract, url_or_urls, map_tuple=True)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 435, in map_nested
return function(data_struct)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 1049, in _extract
raise NotImplementedError(
NotImplementedError: Extraction protocol for TAR archives like 'https://huggingface.co/datasets/ceval/ceval-exam/resolve/main/ceval_data.tar' is not implemented in streaming mode. Please use `dl_manager.iter_archive` instead.
Example usage:
url = dl_manager.download(url)
tar_archive_iterator = dl_manager.iter_archive(url)
for filename, file in tar_archive_iterator:
...
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/src/services/worker/src/worker/job_runners/split/first_rows_from_streaming.py", line 156, in compute_first_rows_response
info = get_dataset_config_info(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/inspect.py", line 393, in get_dataset_config_info
raise SplitsNotFoundError("The split names could not be parsed from the dataset config.") from err
datasets.inspect.SplitsNotFoundError: The split names could not be parsed from the dataset config.
albertvillanova
changed discussion title from
Dataset Viewer issue
to Dataset Viewer issue: Extraction protocol for TAR archives is not implemented in streaming mode
Note that the viewer uses the streaming mode and that TAR archives are not supported in streaming mode, out of the box, because the TAR format does not allow random access to the archived files.
To support streaming (and fix the issue with the viewer) you could:
- Either replace the TAR archive with a ZIP archive (ZIP archives allow random access)
- Or use
dl_manager.iter_archive
to iterate over the archived files within the TAR archive: you have a usage example in the error message above.
We have replaced the TAR archive with a ZIP archive. Thanks!
yuzhen17
changed discussion status to
closed
Great, the viewer is working now.