Datasets:
Dataset Viewer issue
Hello, I notice that the dataset viewer is not working for some subsets (e.g., 2k_random_10k
, 2k_random_50k
, 2k_random_5k
) with an aiohttp.client_exceptions.ClientPayloadError: Response payload is not completed
error. Is there a way that I can fix it?
Error details:
Error code: StreamingRowsError
Exception: ClientPayloadError
Message: Response payload is not completed
Traceback: Traceback (most recent call last):
File "/src/workers/first_rows/src/first_rows/response.py", line 407, in compute_first_rows_response
rows = get_rows(
File "/src/workers/first_rows/src/first_rows/utils.py", line 136, in decorator
return func(*args, **kwargs)
File "/src/workers/first_rows/src/first_rows/response.py", line 86, in get_rows
rows_plus_one = list(itertools.islice(ds, rows_max_number + 1))
File "/src/workers/first_rows/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 782, in __iter__
for key, example in self._iter():
File "/src/workers/first_rows/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 772, in _iter
yield from ex_iterable
File "/src/workers/first_rows/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 142, in __iter__
yield from self.generate_examples_fn(**self.kwargs)
File "/tmp/modules-cache/datasets_modules/datasets/poloclub--diffusiondb/8e4f79d20e94e3f261bfbea0101aa5047d6961c1d124920dc067889f88f5cddd/diffusiondb.py", line 385, in _generate_examples
"bytes": open(img_path, "rb").read(),
File "/src/workers/first_rows/.venv/lib/python3.9/site-packages/datasets/streaming.py", line 69, in wrapper
return function(*args, use_auth_token=use_auth_token, **kwargs)
File "/src/workers/first_rows/.venv/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 469, in xopen
file_obj = fsspec.open(file, mode=mode, *args, **kwargs).open()
File "/src/workers/first_rows/.venv/lib/python3.9/site-packages/fsspec/core.py", line 135, in open
return self.__enter__()
File "/src/workers/first_rows/.venv/lib/python3.9/site-packages/fsspec/core.py", line 103, in __enter__
f = self.fs.open(self.path, mode=mode)
File "/src/workers/first_rows/.venv/lib/python3.9/site-packages/fsspec/spec.py", line 1094, in open
f = self._open(
File "/src/workers/first_rows/.venv/lib/python3.9/site-packages/fsspec/implementations/zip.py", line 106, in _open
out = self.zip.open(path, mode.strip("b"))
File "/usr/local/lib/python3.9/zipfile.py", line 1518, in open
fheader = zef_file.read(sizeFileHeader)
File "/usr/local/lib/python3.9/zipfile.py", line 742, in read
data = self._file.read(n)
File "/src/workers/first_rows/.venv/lib/python3.9/site-packages/fsspec/implementations/http.py", line 590, in read
return super().read(length)
File "/src/workers/first_rows/.venv/lib/python3.9/site-packages/fsspec/spec.py", line 1643, in read
out = self.cache._fetch(self.loc, self.loc + length)
File "/src/workers/first_rows/.venv/lib/python3.9/site-packages/fsspec/caching.py", line 381, in _fetch
self.cache = self.fetcher(start, bend)
File "/src/workers/first_rows/.venv/lib/python3.9/site-packages/fsspec/asyn.py", line 111, in wrapper
return sync(self.loop, func, *args, **kwargs)
File "/src/workers/first_rows/.venv/lib/python3.9/site-packages/fsspec/asyn.py", line 96, in sync
raise return_result
File "/src/workers/first_rows/.venv/lib/python3.9/site-packages/fsspec/asyn.py", line 53, in _runner
result[0] = await coro
File "/src/workers/first_rows/.venv/lib/python3.9/site-packages/fsspec/implementations/http.py", line 632, in async_fetch_range
out = await r.read()
File "/src/workers/first_rows/.venv/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 1037, in read
self._body = await self.content.read()
File "/src/workers/first_rows/.venv/lib/python3.9/site-packages/aiohttp/streams.py", line 375, in read
block = await self.readany()
File "/src/workers/first_rows/.venv/lib/python3.9/site-packages/aiohttp/streams.py", line 397, in readany
await self._wait("readany")
File "/src/workers/first_rows/.venv/lib/python3.9/site-packages/aiohttp/streams.py", line 304, in _wait
await waiter
aiohttp.client_exceptions.ClientPayloadError: Response payload is not completed
Thanks. I'm looking at it. It seems like an error due to rate limiting on the host.
I refreshed the dataset viewer for this dataset, I think the errors are gone. See https://huggingface.co/datasets/poloclub/diffusiondb/viewer/2m_random_10k/train for example
Hooray!! Thank you so much for your help @severo ! Really appreciate your team for building such a terrific dataset sharing infrastructure!
Two minor bugs I had noticed when experimenting with the dataset preview:
- The image column displayed an error message when my subset names are
random_10k [2m]
. I suspect it had something to do with the space or the[]
charterers in the path URLs. - The
timestamp
type is displayed asunknown
in the preview. In my loading script, I define the type of this column asdatasets.Value("timestamp[us, tz=UTC]")
. If I use the HF loader in Python, the result is correct (with Python'sdatetime
type). So I suspect it is just an UI bug?
Thanks!
Thanks for reporting the bugs, I'll look at them (at https://github.com/huggingface/datasets-server).