Skip to content

Improve error message when no suitable file is found #2082

@severo

Description

@severo

See https://huggingface.co/datasets/wefussell/amasum_neg/discussions/1#654d1c3671a30c4bcaf9fb77

It contains the following tree:

Capture d’écran 2023-11-09 à 19 36 17

The files have no extensions, so datasets cannot get the list of configs. But the error message mentions a dataset script. Now that we "deprecated" the datasets scripts in the dataset viewer, it's confusing for the users. The error message is:

Error code:   ConfigNamesError
Exception:    FileNotFoundError
Message:      Couldn't find a dataset script at /src/services/worker/wefussell/amasum_neg/amasum_neg.py or any data file in the same directory. Couldn't find 'wefussell/amasum_neg' on the Hugging Face Hub either: FileNotFoundError: No (supported) data files or dataset script found in wefussell/amasum_neg. 
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 1508, in dataset_module_factory
                  raise FileNotFoundError(
              FileNotFoundError: Couldn't find a dataset script at /src/services/worker/wefussell/amasum_neg/amasum_neg.py or any data file in the same directory. Couldn't find 'wefussell/amasum_neg' on the Hugging Face Hub either: FileNotFoundError: No (supported) data files or dataset script found in wefussell/amasum_neg.

We should instead return an error message with a specific error code (different from "ConfigNamesError") so that the Hub can show a specific message, pointing to the new docs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions