Datasets:

Modalities:
Text
Formats:
parquet
Languages:
English
Libraries:
Datasets
pandas
License:

KeyError: 'length' when downloading nq_open

#1
by janspoerer - opened

Loading the dataset using datase_nq_open = load_dataset("nq_open")

leads to a KeyError. Adding the argument download_mode="force_redownload" does not help to solve the problem.

Other Huggingface datasets are loading without issues.

Does anybody have an idea what could be wrong here? Any help would be highly appreciated.

Here are the prints and the error message:

Downloading builder script: 6.60kB [00:00, 1.45MB/s]                                                                                                 
Downloading metadata: 5.14kB [00:00, 1.83MB/s]                                                                                                       
Traceback (most recent call last):
  File "/home/username/code/username/05_QA_Scaling_on_Another_Dataset/question_classifier/__init__.py", line 45, in <module>
    dataset_7_nq_open = load_dataset("nq_open", download_mode="force_redownload") #  [https://huggingface.co/datasets/nq_open](https://huggingface.co/datasets/nq_open)
  File "/home/username/.pyenv/versions/finrag_sequence_3.9.13/lib/python3.9/site-packages/datasets/load.py", line 1723, in load_dataset
    builder_instance = load_dataset_builder(
  File "/home/username/.pyenv/versions/finrag_sequence_3.9.13/lib/python3.9/site-packages/datasets/load.py", line 1526, in load_dataset_builder
    builder_instance: DatasetBuilder = builder_cls(
  File "/home/username/.pyenv/versions/finrag_sequence_3.9.13/lib/python3.9/site-packages/datasets/builder.py", line 1154, in __init__
    super().__init__(*args, **kwargs)
  File "/home/username/.pyenv/versions/finrag_sequence_3.9.13/lib/python3.9/site-packages/datasets/builder.py", line 341, in __init__
    self.info = DatasetInfo.from_directory(self._cache_dir)
  File "/home/username/.pyenv/versions/finrag_sequence_3.9.13/lib/python3.9/site-packages/datasets/info.py", line 267, in from_directory
    return cls.from_dict(dataset_info_dict)
  File "/home/username/.pyenv/versions/finrag_sequence_3.9.13/lib/python3.9/site-packages/datasets/info.py", line 272, in from_dict
    return cls(**{k: v for k, v in dataset_info_dict.items() if k in field_names})
  File "<string>", line 20, in __init__
  File "/home/username/.pyenv/versions/finrag_sequence_3.9.13/lib/python3.9/site-packages/datasets/info.py", line 141, in __post_init__
    self.features = Features.from_dict(self.features)
  File "/home/username/.pyenv/versions/finrag_sequence_3.9.13/lib/python3.9/site-packages/datasets/features/features.py", line 1597, in from_dict
    obj = generate_from_dict(dic)
  File "/home/username/.pyenv/versions/finrag_sequence_3.9.13/lib/python3.9/site-packages/datasets/features/features.py", line 1280, in generate_from_dict
    return {key: generate_from_dict(value) for key, value in obj.items()}
  File "/home/username/.pyenv/versions/finrag_sequence_3.9.13/lib/python3.9/site-packages/datasets/features/features.py", line 1280, in <dictcomp>
    return {key: generate_from_dict(value) for key, value in obj.items()}
  File "/home/username/.pyenv/versions/finrag_sequence_3.9.13/lib/python3.9/site-packages/datasets/features/features.py", line 1284, in generate_from_dict
    return Sequence(feature=generate_from_dict(obj["feature"]), length=obj["length"])
KeyError: 'length'
janspoerer changed discussion status to closed

The problem was resolved after changing to a Python 3.10.6 environment. I previously ran a 3.9.13 environment.

Sign up or log in to comment