Dataset Viewer issue

#3
by jmhessel - opened

Hi there ---

I wrote a dataset loader script for this dataset. But, now it doesn't work because of arbitrary code execution. I really would love to show the data in the preview if possible. Are the scripts no longer supported?

Error details:

Error code:   ConfigNamesError
Exception:    DatasetWithScriptNotSupportedError
Message:      The dataset viewer doesn't support this dataset because it runs arbitrary python code. Please open a discussion in the discussion tab if you think this is an error and tag 

@lhoestq
	 and 

@severo
	.
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/dataset/config_names.py", line 65, in compute_config_names_response
                  for config in sorted(get_dataset_config_names(path=dataset, token=hf_token))
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/inspect.py", line 351, in get_dataset_config_names
                  dataset_module = dataset_module_factory(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 1512, in dataset_module_factory
                  raise e1 from None
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 1481, in dataset_module_factory
                  return HubDatasetModuleFactoryWithScript(
                File "/src/services/worker/src/worker/utils.py", line 400, in raise_unsupported_dataset_with_script_or_init
                  raise DatasetWithScriptNotSupportedError(
              libcommon.exceptions.DatasetWithScriptNotSupportedError: The dataset viewer doesn't support this dataset because it runs arbitrary python code. Please open a discussion in the discussion tab if you think this is an error and tag 

@lhoestq
	 and 

@severo
	.

cc @albertvillanova @lhoestq @severo .

Hi. Indeed, the reason is that we no longer support the dataset scripts in the dataset viewer. See https://discuss.huggingface.co/t/dataset-repo-requires-arbitrary-python-code-execution/59346/5

We had to disable the viewer for datasets with a script for now, because some people were abusing it. Sorry for the inconvenience.

In the meantime, if you want the dataset viewer to work you need to remove the dataset script and use a supported data format (csv, parquet, etc.) Personnally I’d recommend uploading the dataset using the datasets library and push_to_hub().

Hi @severo --- thanks for the info! I don't have time to fix this right now, but can look into it when I get a chance. I also saw in that discussion that @julien-c mentioned that some datasets might be considered for allowlisting. I don't know how popular a dataset needs to be to be considered, but, we do have 13k downloads/mo + 30 likes, and, the paper that accompanies this one won a paper award at a major NLP conference. I wrote the dataset script so that images of new yorker cartoons would display properly in the viewer, which I do think is pretty important for this corpus

Folowing #4 i think this can be closed no?

Yes, thank you both! I really appreciate it

jmhessel changed discussion status to closed

Sign up or log in to comment