Cannot download the data, have an error in generating the datasets

#7
by lysummer55 - opened

Hi I am having an error in downloading and generating the data into different splits, please see the error below. Could you help on this? thanks!

JSONDecodeError Traceback (most recent call last)
~/opt/anaconda3/lib/python3.7/site-packages/datasets/builder.py in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id)
1607 _time = time.time()
-> 1608 for key, record in generator:
1609 if max_shard_size is not None and writer._num_bytes > max_shard_size:

~/.cache/huggingface/modules/datasets_modules/datasets/amazon_reviews_multi/724e94f4b0c6c405ce7e476a6c5ef4f87db30799ad49f765094cf9770e0f7609/amazon_reviews_multi.py in _generate_examples(self, file_paths)
129 for line in f:
--> 130 yield row_count, json.loads(line)
131 row_count += 1

~/opt/anaconda3/lib/python3.7/json/init.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
347 parse_constant is None and object_pairs_hook is None and not kw):
--> 348 return _default_decoder.decode(s)
349 if cls is None:

~/opt/anaconda3/lib/python3.7/json/decoder.py in decode(self, s, _w)
336 """
--> 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end())
338 end = _w(s, end).end()

~/opt/anaconda3/lib/python3.7/json/decoder.py in raw_decode(self, s, idx)
354 except StopIteration as err:
--> 355 raise JSONDecodeError("Expecting value", s, err.value) from None
356 return obj, end

JSONDecodeError: Expecting value: line 1 column 1 (char 0)

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

DatasetGenerationError Traceback (most recent call last)
in
1 # dataset = load_dataset(os.path.join(work_dir,'amazon_reviews_multi.py'))
----> 2 dataset = load_dataset('amazon_reviews_multi.py','en')
3 print(dataset)

~/opt/anaconda3/lib/python3.7/site-packages/datasets/load.py 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, use_auth_token, task, streaming, num_proc, **config_kwargs)
1785 verification_mode=verification_mode,
1786 try_from_hf_gcs=try_from_hf_gcs,
-> 1787 num_proc=num_proc,
1788 )
1789

~/opt/anaconda3/lib/python3.7/site-packages/datasets/builder.py in 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)
874 verification_mode=verification_mode,
875 **prepare_split_kwargs,
--> 876 **download_and_prepare_kwargs,
877 )
878 # Sync info

~/opt/anaconda3/lib/python3.7/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs)
1652 check_duplicate_keys=verification_mode == VerificationMode.BASIC_CHECKS
1653 or verification_mode == VerificationMode.ALL_CHECKS,
-> 1654 **prepare_splits_kwargs,
1655 )
1656

~/opt/anaconda3/lib/python3.7/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs)
965 try:
966 # Prepare split will record examples associated to the split
--> 967 self._prepare_split(split_generator, **prepare_split_kwargs)
968 except OSError as e:
969 raise OSError(

~/opt/anaconda3/lib/python3.7/site-packages/datasets/builder.py in _prepare_split(self, split_generator, check_duplicate_keys, file_format, num_proc, max_shard_size)
1487 job_id = 0
1488 for job_id, done, content in self._prepare_split_single(
-> 1489 gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args
1490 ):
1491 if done:

~/opt/anaconda3/lib/python3.7/site-packages/datasets/builder.py in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id)
1642 if isinstance(e, SchemaInferenceError) and e.context is not None:
1643 e = e.context
-> 1644 raise DatasetGenerationError("An error occurred while generating the dataset") from e
1645
1646 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths)

DatasetGenerationError: An error occurred while generating the dataset

Datasets Maintainers org

This is the same error as in https://huggingface.co/datasets/amazon_reviews_multi/discussions/4. We are working on fixing it!

mariosasko changed discussion status to closed

Sign up or log in to comment