Dataset does not work with newer version of the datasets library

#3
by jordimas - opened

Hello. Using datasets library version 2.7.1:

Just trying the basic sample:

from datasets import load_dataset
dataset = load_dataset("projecte-aina/parlament_parla")

Produces an exception when loading:

Traceback (most recent call last):
  File "/home/jordi/sc/whisper/whisper-small-ca-parla/parla.py", line 3, in <module>
    dataset = load_dataset("projecte-aina/parlament_parla", "clean")
  File "/home/jordi/.local/lib/python3.10/site-packages/datasets/load.py", line 1670, in load_dataset
    builder_instance = load_dataset_builder(
  File "/home/jordi/.local/lib/python3.10/site-packages/datasets/load.py", line 1473, in load_dataset_builder
    builder_instance: DatasetBuilder = builder_cls(
  File "/home/jordi/.local/lib/python3.10/site-packages/datasets/builder.py", line 1285, in __init__
    super().__init__(*args, **kwargs)
  File "/home/jordi/.local/lib/python3.10/site-packages/datasets/builder.py", line 313, in __init__
    info.update(self._info())
  File "/home/jordi/.cache/huggingface/modules/datasets_modules/datasets/projecte-aina--parlament_parla/c6a8bcee1fa7728e0a97dfe5ae7ec213c8702778a9667c57fc28f9c428c4072e/parlament_parla.py", line 87, in _info
    AutomaticSpeechRecognition(audio_file_path_column="path", transcription_column="sentence")
TypeError: AutomaticSpeechRecognition.__init__() got an unexpected keyword argument 'audio_file_path_column'

I think that the problem is caused because the contracts have change in the datasets library.

Projecte Aina org

Hi!
It seams that there are two available configs: ['clean', 'other']. So instead of passing just the dataset name, you need to pass also the desired config:

from datasets import load_dataset
load_dataset('parlament_parla', 'clean')

Hope this solves the error.

Same problem. This problem is probably linked to recent changes in "datasets" library.

Projecte Aina org
edited Dec 8, 2022

You're completely right!
It turns out that the audio_file_path_column of the AutomaticSpeechRecognition task template has changed to audio_column as can be seen here. Because the default value of the new audio_column is "audio" and that is the name of our feature I have just erased that parameter from line 87

Hope this solved the problem and thank you very much for spotting this!

Yes, it does. Thanks!

jordimas changed discussion status to closed

Hey, yes, sorry...

We introduced that change in the Audio task quite long ago, since datasetsversion 2.1.0 (Mar 24 2022)... https://github.com/huggingface/datasets/pull/4006
And at that moment, we hadn't implemented the right procedure to make bulk pull requests in all the datasets in the Hub to update them...
This procedure is established now...

By the way, we are planning to deprecate the task templates, and use YAML tags in the README file instead.
Once we push this change to the library, we will start a deprecation cycle: raising warnings, making bulk pull requests to suggest the update...

Sign up or log in to comment