Dataset Viewer issue: DatasetWithScriptNotSupportedError

#2
by amanrangapur - opened

The dataset viewer is not working.
Please help me out with it.
Error details:

Error code:   DatasetWithScriptNotSupportedError

cc @albertvillanova @lhoestq @severo .

Hi! You can just delete the script (Fin-Fact.py) and configure from the README header (see https://huggingface.co/docs/hub/datasets-manual-configuration) to point to the data file. Something like:

configs:
- config_name: default
  data_files:
  - split: train
    path: "finfact.json"

Hello, thanks for taking your time to help me resolve this issue. I think this works fine with .csv files. But for json, I am not sure why this is throwing this error.
Error code: FeaturesError
Exception: ValueError
Message: Not able to read records in the JSON file at hf://datasets/amanrangapur/Fin-Fact@bd8018121e6fcc8cce22991ca0e68a7c4cd4cfae/finfact.json.

Not sure. cc @albertvillanova @lhoestq

@albertvillanova @lhoestq Can you please help me out with dataset card loading issue?
Error: Error code: FeaturesError
Exception: ValueError
Message: Not able to read records in the JSON file at hf://datasets/amanrangapur/Fin-Fact@bd8018121e6fcc8cce22991ca0e68a7c4cd4cfae/finfact.json.

Hi ! The Dataset Viewer expects all the columns to have a fixed type.

However the error says cannot mix list and non-list, non-null values: so it looks like at least one field in your JSON file has a mixe type (sometimes it's an object and sometimes it's a list).
Indeed the third sample has 'hrefs': 'http://www.tampabay.com/opinion/columns/crisafulli-why-the-florida-house-opposes-medicaid-expansion/2227220' while in other samples hrefs is a list of strings.

To fix the Viewer you can fix your JSON file to always have lists for hrefs

I tried a lot of ways, but still I am unable to resolve this. Please help me out to solve this problem.
@albertvillanova @lhoestq

For security reasons, the viewer is not supported with Python scripts.

As JSON format is supported, to have the viewer working, you need to remove all the files except the finfact.json. You also need to delete the dataset_info: from the README file.

albertvillanova changed discussion status to closed

Sign up or log in to comment