Datasets:
Tasks:
Automatic Speech Recognition
Modalities:
Audio
Languages:
Polish
Size:
10K<n<100K
ArXiv:
DOI:
License:
[Issue] Unable to load dataset
#2
by
eryk7381
- opened
Hey,
Today I discovered that I am not able to load dataset using datasets library .
I would be so thankful for any help.
Code:
from datasets import load_dataset
ds_full = load_dataset('amu-cai/pl-asr-bigos-v2','pjatk-clarin_mobile-15')
or
ds_full = load_dataset('amu-cai/pl-asr-bigos-v2','all',trust_remote_code=True)
Error:
File c:\Users\Eryk\anaconda3\envs\Magisterka\Lib\site-packages\datasets\builder.py:1726, in GeneratorBasedBuilder._prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id)
1725 _time = time.time()
-> 1726 for key, record in generator:
1727 if max_shard_size is not None and writer._num_bytes > max_shard_size:
File ~\.cache\huggingface\modules\datasets_modules\datasets\amu-cai--pl-asr-bigos-v2\a25cb2a334616ef94467c071558eb16c3032550afc8d6c7413517f47c89b5b16\pl-asr-bigos-v2.py:224, in Bigos._generate_examples(self, local_extracted_archives, archive_iters, text_paths)
223 lines = f.readlines()
--> 224 data = self._get_data(lines, subset_id)
226 for audio_path, audio_file in archive:
227 #print("audio_path: ", audio_path)
File ~\.cache\huggingface\modules\datasets_modules\datasets\amu-cai--pl-asr-bigos-v2\a25cb2a334616ef94467c071558eb16c3032550afc8d6c7413517f47c89b5b16\pl-asr-bigos-v2.py:181, in Bigos._get_data(self, lines, subset_id)
180 line = line.decode("utf-8")
--> 181 (
182 _id,
183 split,
184 dataset,
185 speaker_id,
186 sampling_rate_orig,
187 sampling_rate,
188 ref_orig,
189 audio_path_bigos,
190 gender,
191 age
192
193 ) = line.strip().split("\t")
196 data[audio_path_bigos] = {
197 "audioname": str.strip(_id),
198 "split": str.strip(split),
(...)
206 "speaker_gender": str.strip(gender)
207 }
ValueError: not enough values to unpack (expected 10, got 8)
The above exception was the direct cause of the following exception:
DatasetGenerationError Traceback (most recent call last)
Cell In[22], line 2
1 from datasets import load_dataset
----> 2 ds_full = load_dataset('amu-cai/pl-asr-bigos-v2','pjatk-clarin_mobile-15',trust_remote_code=True)
File c:\Users\Eryk\anaconda3\envs\Magisterka\Lib\site-packages\datasets\load.py:2582, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, token, use_auth_token, task, streaming, num_proc, storage_options, trust_remote_code, **config_kwargs)
2579 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES
2581 # Download and prepare data
-> 2582 builder_instance.download_and_prepare(
2583 download_config=download_config,
2584 download_mode=download_mode,
2585 verification_mode=verification_mode,
2586 try_from_hf_gcs=try_from_hf_gcs,
2587 num_proc=num_proc,
2588 storage_options=storage_options,
2589 )
2591 # Build dataset for splits
2592 keep_in_memory = (
2593 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)
2594 )
File c:\Users\Eryk\anaconda3\envs\Magisterka\Lib\site-packages\datasets\builder.py:1005, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, verification_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, num_proc, storage_options, **download_and_prepare_kwargs)
1003 if num_proc is not None:
1004 prepare_split_kwargs["num_proc"] = num_proc
-> 1005 self._download_and_prepare(
1006 dl_manager=dl_manager,
1007 verification_mode=verification_mode,
1008 **prepare_split_kwargs,
1009 **download_and_prepare_kwargs,
1010 )
1011 # Sync info
1012 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values())
File c:\Users\Eryk\anaconda3\envs\Magisterka\Lib\site-packages\datasets\builder.py:1767, in GeneratorBasedBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs)
1766 def _download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs):
-> 1767 super()._download_and_prepare(
1768 dl_manager,
1769 verification_mode,
1770 check_duplicate_keys=verification_mode == VerificationMode.BASIC_CHECKS
1771 or verification_mode == VerificationMode.ALL_CHECKS,
1772 **prepare_splits_kwargs,
1773 )
File c:\Users\Eryk\anaconda3\envs\Magisterka\Lib\site-packages\datasets\builder.py:1100, in DatasetBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs)
1096 split_dict.add(split_generator.split_info)
1098 try:
1099 # Prepare split will record examples associated to the split
-> 1100 self._prepare_split(split_generator, **prepare_split_kwargs)
1101 except OSError as e:
1102 raise OSError(
1103 "Cannot find data file. "
1104 + (self.manual_download_instructions or "")
1105 + "\nOriginal error:\n"
1106 + str(e)
1107 ) from None
File c:\Users\Eryk\anaconda3\envs\Magisterka\Lib\site-packages\datasets\builder.py:1605, in GeneratorBasedBuilder._prepare_split(self, split_generator, check_duplicate_keys, file_format, num_proc, max_shard_size)
1603 job_id = 0
1604 with pbar:
-> 1605 for job_id, done, content in self._prepare_split_single(
1606 gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args
1607 ):
1608 if done:
1609 result = content
File c:\Users\Eryk\anaconda3\envs\Magisterka\Lib\site-packages\datasets\builder.py:1762, in GeneratorBasedBuilder._prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id)
1760 if isinstance(e, SchemaInferenceError) and e.__context__ is not None:
1761 e = e.__context__
-> 1762 raise DatasetGenerationError("An error occurred while generating the dataset") from e
1764 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths)
DatasetGenerationError: An error occurred while generating the dataset
Hey!
You may try to load the dataset again with the force_download option enabled:
ds_full = load_dataset('amu-cai/pl-asr-bigos-v2', 'pjatk-clarin_mobile-15', download_mode="force_redownload")
or
ds_full = load_dataset('amu-cai/pl-asr-bigos-v2', 'all', download_mode="force_redownload")
The option "trust_remote_code" is not required.
I hope this helps!