TypeError when downloading en-swa

#1
by cdleong - opened
from datasets import load_dataset

dataset = load_dataset("masakhane/mafand", "en-swa")

Gives me

Downloading and preparing dataset mafand/en-swa (download: 9.07 MiB, generated: 3.98 MiB, post-processed: Unknown size, total: 13.05 MiB) to /root/.cache/huggingface/datasets/masakhane___mafand/en-swa/1.0.0/67304918ceaeb8cf2cfa0cc76a684248c282da43b067fa7a1cb69965d4fedbb7...

Downloading data files: 100%
3/3 [00:03<00:00, 1.25s/it]
Downloading data:
8.45M/? [00:00<00:00, 52.6MB/s]
Downloading data:
511k/? [00:00<00:00, 16.1MB/s]
Downloading data:
553k/? [00:00<00:00, 15.7MB/s]
Extracting data files: 100%
3/3 [00:00<00:00, 98.58it/s]
Generating train split: 0%
0/30782 [00:00<?, ? examples/s]

---------------------------------------------------------------------------

TypeError                                 Traceback (most recent call last)

/usr/local/lib/python3.8/dist-packages/datasets/builder.py in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id)
   1587                     example = self.info.features.encode_example(record) if self.info.features is not None else record
-> 1588                     writer.write(example, key)
   1589                     num_examples_progress_update += 1

27 frames

TypeError: Couldn't cast array of type
struct<en: string, sw: string>
to
struct<en: string, swa: string>


During handling of the above exception, another exception occurred:

TypeError                                 Traceback (most recent call last)

TypeError: Couldn't cast array of type
struct<en: string, sw: string>
to
struct<en: string, swa: string>


The above exception was the direct cause of the following exception:

DatasetGenerationError                    Traceback (most recent call last)

/usr/local/lib/python3.8/dist-packages/datasets/builder.py in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id)
   1604             if isinstance(e, SchemaInferenceError) and e.__context__ is not None:
   1605                 e = e.__context__
-> 1606             raise DatasetGenerationError("An error occurred while generating the dataset") from e
   1607 
   1608         yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths)

DatasetGenerationError: An error occurred while generating the dataset

Note the difference: "sw" versus "swa"

This was fixed by David Adelani.

cdleong changed discussion status to closed

Sign up or log in to comment