Dataset Viewer issue

#1
by Stardrums - opened

The dataset viewer is not working.

Error details:

Error code:   StreamingRowsError
Exception:    ValueError
Message:      Invalid string class label 
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 736, in _apply_feature_types_on_example
                  encoded_example = features.encode_example(example)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1824, in encode_example
                  return encode_nested_example(self, example)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1223, in encode_nested_example
                  {
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1224, in <dictcomp>
                  k: encode_nested_example(sub_schema, sub_obj, level=level + 1)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1273, in encode_nested_example
                  return [encode_nested_example(schema.feature, o, level=level + 1) for o in obj]
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1273, in <listcomp>
                  return [encode_nested_example(schema.feature, o, level=level + 1) for o in obj]
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1278, in encode_nested_example
                  return schema.encode_example(obj) if obj is not None else None
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1069, in encode_example
                  example_data = self.str2int(example_data)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1006, in str2int
                  output = [self._strval2int(value) for value in values]
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1006, in <listcomp>
                  output = [self._strval2int(value) for value in values]
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1027, in _strval2int
                  raise ValueError(f"Invalid string class label {value}")
              ValueError: Invalid string class label

cc @albertvillanova @lhoestq @severo .

I opened a PR to fix the data parsing issue here: https://huggingface.co/datasets/Stardrums/pico-breast-cancer/discussions/2

Stardrums changed discussion status to closed

Sign up or log in to comment