Dataset Viewer issue

#4
by Viper12 - opened

The dataset viewer is not working.

Error details:

Error code:   StreamingRowsError
Exception:    DecompressionBombError
Message:      Image size (806504000 pixels) exceeds limit of 178956970 pixels, could be decompression bomb DOS attack.
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/src/worker/utils.py", line 365, in get_rows_or_raise
                  return get_rows(
                File "/src/services/worker/src/worker/utils.py", line 307, in decorator
                  return func(*args, **kwargs)
                File "/src/services/worker/src/worker/utils.py", line 343, 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 985, in __iter__
                  yield _apply_feature_types_on_example(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 738, in _apply_feature_types_on_example
                  decoded_example = features.decode_example(encoded_example, token_per_repo_id=token_per_repo_id)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1875, in decode_example
                  return {
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1876, in <dictcomp>
                  column_name: decode_nested_example(feature, value, token_per_repo_id=token_per_repo_id)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1319, in decode_nested_example
                  return schema.decode_example(obj, token_per_repo_id=token_per_repo_id)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/image.py", line 175, in decode_example
                  image = PIL.Image.open(bytes_)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/PIL/Image.py", line 3277, in open
                  im = _open_core(fp, filename, prefix, formats)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/PIL/Image.py", line 3264, in _open_core
                  _decompression_bomb_check(im.size)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/PIL/Image.py", line 3173, in _decompression_bomb_check
                  raise DecompressionBombError(msg)
              PIL.Image.DecompressionBombError: Image size (806504000 pixels) exceeds limit of 178956970 pixels, could be decompression bomb DOS attack.

cc @albertvillanova @lhoestq @severo .

Yes, we're relying on PIL for image processing, and the size of some images in the dataset is above its limit (178,956,970 pixels). We will try to handle this case better to be able to show the other images.

Sign up or log in to comment