Error when loading the dataset
Hi,
I get an error when trying to load this dataset as shown in https://colab.research.google.com/github/huggingface/cookbook/blob/main/notebooks/en/rag_evaluation.ipynb
The error is : "ValueError: Invalid pattern: '**' can only be an entire path component"
The entire stack of the error is :
ValueError Traceback (most recent call last)
in <cell line: 0>()
----> 1 ds = datasets.load_dataset("m-ric/huggingface_doc")
11 frames
/usr/local/lib/python3.11/dist-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, token, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)
2110
2111 # Create a dataset builder
-> 2112 builder_instance = load_dataset_builder(
2113 path=path,
2114 name=name,
/usr/local/lib/python3.11/dist-packages/datasets/load.py in load_dataset_builder(path, name, data_dir, data_files, cache_dir, features, download_config, download_mode, revision, token, use_auth_token, storage_options, **config_kwargs)
1796 download_config = download_config.copy() if download_config else DownloadConfig()
1797 download_config.storage_options.update(storage_options)
-> 1798 dataset_module = dataset_module_factory(
1799 path,
1800 revision=revision,
/usr/local/lib/python3.11/dist-packages/datasets/load.py in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, **download_kwargs)
1493 f"Couldn't find '{path}' on the Hugging Face Hub either: {type(e1).name}: {e1}"
1494 ) from None
-> 1495 raise e1 from None
1496 else:
1497 raise FileNotFoundError(
/usr/local/lib/python3.11/dist-packages/datasets/load.py in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, **download_kwargs)
1477 download_config=download_config,
1478 download_mode=download_mode,
-> 1479 ).get_module()
1480 except (
1481 Exception
/usr/local/lib/python3.11/dist-packages/datasets/load.py in get_module(self)
1032 sanitize_patterns(self.data_files)
1033 if self.data_files is not None
-> 1034 else get_data_patterns(base_path, download_config=self.download_config)
1035 )
1036 data_files = DataFilesDict.from_patterns(
/usr/local/lib/python3.11/dist-packages/datasets/data_files.py in get_data_patterns(base_path, download_config)
455 resolver = partial(resolve_pattern, base_path=base_path, download_config=download_config)
456 try:
--> 457 return _get_data_files_patterns(resolver)
458 except FileNotFoundError:
459 raise EmptyDatasetError(f"The directory at {base_path} doesn't contain any data files") from None
/usr/local/lib/python3.11/dist-packages/datasets/data_files.py in _get_data_files_patterns(pattern_resolver)
246 for pattern in patterns:
247 try:
--> 248 data_files = pattern_resolver(pattern)
249 except FileNotFoundError:
250 continue
/usr/local/lib/python3.11/dist-packages/datasets/data_files.py in resolve_pattern(pattern, base_path, allowed_extensions, download_config)
330 base_path = ""
331 pattern, storage_options = _prepare_path_and_storage_options(pattern, download_config=download_config)
--> 332 fs, _, _ = get_fs_token_paths(pattern, storage_options=storage_options)
333 fs_base_path = base_path.split("::")[0].split("://")[-1] or fs.root_marker
334 fs_pattern = pattern.split("::")[0].split("://")[-1]
/usr/local/lib/python3.11/dist-packages/fsspec/core.py in get_fs_token_paths(urlpath, mode, num, name_function, storage_options, protocol, expand)
684 paths = _expand_paths(paths, name_function, num)
685 elif "*" in paths:
--> 686 paths = [f for f in sorted(fs.glob(paths)) if not fs.isdir(f)]
687 else:
688 paths = [paths]
/usr/local/lib/python3.11/dist-packages/huggingface_hub/hf_file_system.py in glob(self, path, **kwargs)
519 kwargs = {"expand_info": kwargs.get("detail", False), **kwargs}
520 path = self.resolve_path(path, revision=kwargs.get("revision")).unresolve()
--> 521 return super().glob(path, **kwargs)
522
523 def find(
/usr/local/lib/python3.11/dist-packages/fsspec/spec.py in glob(self, path, maxdepth, **kwargs)
609 allpaths = self.find(root, maxdepth=depth, withdirs=True, detail=True, **kwargs)
610
--> 611 pattern = glob_translate(path + ("/" if ends_with_sep else ""))
612 pattern = re.compile(pattern)
613
/usr/local/lib/python3.11/dist-packages/fsspec/utils.py in glob_translate(pat)
729 continue
730 elif "" in part:
--> 731 raise ValueError(
732 "Invalid pattern: '' can only be an entire path component"
733 )
ValueError: Invalid pattern: '**' can only be an entire path component
Any idea if a change happened in your dataset that prevents its usage, or if there's an error from my part ?
same error here. You can try this
pip install -U datasets huggingface_hub fsspec