Dataset Viewer issue

#3
by mdeopujari - opened

The dataset viewer is not working.

Error details:

Error code:   StreamingRowsError
Exception:    ReadError
Message:      invalid header
Traceback:    Traceback (most recent call last):
                File "/usr/local/lib/python3.9/tarfile.py", line 187, in nti
                  n = int(s.strip() or "0", 8)
              ValueError: invalid literal for int() with base 8: 'able=no"'
              
              During handling of the above exception, another exception occurred:
              
              Traceback (most recent call last):
                File "/usr/local/lib/python3.9/tarfile.py", line 2336, in next
                  tarinfo = self.tarinfo.fromtarfile(self)
                File "/usr/local/lib/python3.9/tarfile.py", line 1122, in fromtarfile
                  obj = cls.frombuf(buf, tarfile.encoding, tarfile.errors)
                File "/usr/local/lib/python3.9/tarfile.py", line 1064, in frombuf
                  chksum = nti(buf[148:156])
                File "/usr/local/lib/python3.9/tarfile.py", line 189, in nti
                  raise InvalidHeaderError("invalid header")
              tarfile.InvalidHeaderError: invalid header
              
              During handling of the above exception, another exception occurred:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/utils.py", line 258, in get_rows_or_raise
                  return get_rows(
                File "/src/services/worker/src/worker/utils.py", line 199, in decorator
                  return func(*args, **kwargs)
                File "/src/services/worker/src/worker/utils.py", line 236, in get_rows
                  rows_plus_one = list(itertools.islice(ds, rows_max_number + 1))
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 1379, in __iter__
                  for key, example in ex_iterable:
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 233, in __iter__
                  yield from self.generate_examples_fn(**self.kwargs)
                File "/tmp/modules-cache/datasets_modules/datasets/KoddaDuck--Cylonix_ASR_dataset/06a75f992a1f2196082e27ad8986edc0f48043048b9f52e8704765be1e6244ec/Cylonix_ASR_dataset.py", line 194, in _generate_examples
                  for filename, file in audio_archive:
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 840, in __iter__
                  yield from self.generator(*self.args, **self.kwargs)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 895, in _iter_from_urlpath
                  yield from cls._iter_tar(f)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 848, in _iter_tar
                  stream = tarfile.open(fileobj=f, mode="r|*")
                File "/usr/local/lib/python3.9/tarfile.py", line 1650, in open
                  t = cls(name, filemode, stream, **kwargs)
                File "/usr/local/lib/python3.9/tarfile.py", line 1531, in __init__
                  self.firstmember = self.next()
                File "/usr/local/lib/python3.9/tarfile.py", line 2348, in next
                  raise ReadError(str(e))
              tarfile.ReadError: invalid header

cc @albertvillanova @lhoestq @severo .

Thanks for reporting, @mdeopujari .

Please note this is not an issue with the viewer, but with a bug in the loading script: the dataset cannot be loaded.

Concretely, the script tries to download the TAR source data files with a wrong URL:

_BASE_URL = "https://huggingface.co/datasets/KoddaDuck/Cylonix_ASR_dataset/blob/main/"
_AUDIO_URL = _BASE_URL + "audio/{lang}/{split}/{lang}_{split}_{shard_idx}.tar"

The URL of the data file wrongly contains the /blob/segment:
https://huggingface.co/datasets/KoddaDuck/Cylonix_ASR_dataset/blob/main/audio/zh-CN/train/zh-CN_train_0.tar
instead of /resolve/:
https://huggingface.co/datasets/KoddaDuck/Cylonix_ASR_dataset/resolve/main/audio/zh-CN/train/zh-CN_train_0.tar

Therefore, the script downloads an HTML page instead of the TAR data file.

albertvillanova changed discussion status to closed

Sign up or log in to comment