Invalid pattern: '**' can only be an entire path component
MEMBER
I couldn't reproduce the issue on my side on MacOS, I guess the issue comes from the recent `fsspec` on Windows.

Can you try downgrading to `fsspec==2023.9.2` for now ? It would also be great to investigate this and see if we need a fix in `datasets` or `fsspec`
2024-03-18T11:49:25Z
https://github.com/huggingface/datasets/issues/6737#issuecomment-2003704913
https://api.github.com/repos/huggingface/datasets/issues/6737
IC_kwDODunzps53bhxR
https://api.github.com/repos/huggingface/datasets/issues/comments/2003704913/reactions
2024-03-18T11:49:25Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2003704913
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
NONE
I had the same issue!  
Downgrading to fsspec from 2023.10.0 to 2023.9.2 solved it for me.

(env: python 3.11.7, datasets version: 2.15.0, Windows 10 22H2, Build 19045.4170)

Thanks a lot!
2024-04-01T12:12:28Z
https://github.com/huggingface/datasets/issues/6737#issuecomment-2029665035
https://api.github.com/repos/huggingface/datasets/issues/6737
IC_kwDODunzps54-jsL
https://api.github.com/repos/huggingface/datasets/issues/comments/2029665035/reactions
2024-04-01T12:16:59Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2029665035
https://avatars.githubusercontent.com/u/1935900?v=4
https://api.github.com/users/jpaw/events{/privacy}
https://api.github.com/users/jpaw/followers
https://api.github.com/users/jpaw/following{/other_user}
https://api.github.com/users/jpaw/gists{/gist_id}
https://github.com/jpaw
jpaw
MDQ6VXNlcjE5MzU5MDA=
https://api.github.com/users/jpaw/orgs
https://api.github.com/users/jpaw/received_events
https://api.github.com/users/jpaw/repos
https://api.github.com/users/jpaw/starred{/owner}{/repo}
https://api.github.com/users/jpaw/subscriptions
User
https://api.github.com/users/jpaw
public
NONE
Ubuntu 20.04  had the same issue
python 3.9 

File "/home/delight-gpu/Workspace2/azuryl/FLAP/main.py", line 112, in <module>
    main()
  File "/home/delight-gpu/Workspace2/azuryl/FLAP/main.py", line 85, in main
    prune_flap(args, model, tokenizer, device)
  File "/home/delight-gpu/Workspace2/azuryl/FLAP/lib/prune.py", line 294, in prune_flap
    dataloader, _ = get_loaders("wikitext2", nsamples=args.nsamples,seed=args.seed,seqlen=model.seqlen,tokenizer=tokenizer)
  File "/home/delight-gpu/Workspace2/azuryl/FLAP/lib/data.py", line 159, in get_loaders
    return get_wikitext2(nsamples, seed, seqlen, tokenizer)
  File "/home/delight-gpu/Workspace2/azuryl/FLAP/lib/data.py", line 79, in get_wikitext2
    traindata = load_dataset('wikitext', 'wikitext-2-raw-v1', split='train')
  File "/home/azuryl/anaconda3/envs/flap/lib/python3.9/site-packages/datasets/load.py", line 1767, in load_dataset
    builder_instance = load_dataset_builder(
  File "/home/azuryl/anaconda3/envs/flap/lib/python3.9/site-packages/datasets/load.py", line 1498, in load_dataset_builder
    dataset_module = dataset_module_factory(
  File "/home/azuryl/anaconda3/envs/flap/lib/python3.9/site-packages/datasets/load.py", line 1215, in dataset_module_factory
    raise e1 from None
  File "/home/azuryl/anaconda3/envs/flap/lib/python3.9/site-packages/datasets/load.py", line 1192, in dataset_module_factory
    return HubDatasetModuleFactoryWithoutScript(
  File "/home/azuryl/anaconda3/envs/flap/lib/python3.9/site-packages/datasets/load.py", line 765, in get_module
    else get_data_patterns_in_dataset_repository(hfh_dataset_info, self.data_dir)
  File "/home/azuryl/anaconda3/envs/flap/lib/python3.9/site-packages/datasets/data_files.py", line 675, in get_data_patterns_in_dataset_repository
    return _get_data_files_patterns(resolver)
  File "/home/azuryl/anaconda3/envs/flap/lib/python3.9/site-packages/datasets/data_files.py", line 236, in _get_data_files_patterns
    data_files = pattern_resolver(pattern)
  File "/home/azuryl/anaconda3/envs/flap/lib/python3.9/site-packages/datasets/data_files.py", line 486, in _resolve_single_pattern_in_dataset_repository
    glob_iter = [PurePath(filepath) for filepath in fs.glob(PurePath(pattern).as_posix()) if fs.isfile(filepath)]
  File "/home/azuryl/anaconda3/envs/flap/lib/python3.9/site-packages/fsspec/spec.py", line 606, in glob
    pattern = glob_translate(path + ("/" if ends_with_sep else ""))
  File "/home/azuryl/anaconda3/envs/flap/lib/python3.9/site-packages/fsspec/utils.py", line 734, in glob_translate
    raise ValueError(
ValueError: Invalid pattern: '**' can only be an entire path component
2024-05-13T02:59:39Z
https://github.com/huggingface/datasets/issues/6737#issuecomment-2106546462
https://api.github.com/repos/huggingface/datasets/issues/6737
IC_kwDODunzps59j1ke
https://api.github.com/repos/huggingface/datasets/issues/comments/2106546462/reactions
2024-05-13T02:59:39Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2106546462
https://avatars.githubusercontent.com/u/23340671?v=4
https://api.github.com/users/azuryl/events{/privacy}
https://api.github.com/users/azuryl/followers
https://api.github.com/users/azuryl/following{/other_user}
https://api.github.com/users/azuryl/gists{/gist_id}
https://github.com/azuryl
azuryl
MDQ6VXNlcjIzMzQwNjcx
https://api.github.com/users/azuryl/orgs
https://api.github.com/users/azuryl/received_events
https://api.github.com/users/azuryl/repos
https://api.github.com/users/azuryl/starred{/owner}{/repo}
https://api.github.com/users/azuryl/subscriptions
User
https://api.github.com/users/azuryl
public
MEMBER
on ubuntu you just need to have the latest `datasets` and `fsspec`

```
pip install -U datasets fsspec
```
2024-05-13T09:39:52Z
https://github.com/huggingface/datasets/issues/6737#issuecomment-2107110661
https://api.github.com/repos/huggingface/datasets/issues/6737
IC_kwDODunzps59l_UF
https://api.github.com/repos/huggingface/datasets/issues/comments/2107110661/reactions
2024-05-13T09:39:52Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2107110661
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
MEMBER
The issue was caused by an incompatibility between the versions of `datasets`, `huggingface-hub` and `fsspec`.

The issue was fixed in:
- huggingface-hub-0.21.2: https://github.com/huggingface/huggingface_hub/pull/2056
- and datasets-2.18.0: https://github.com/huggingface/datasets/pull/6687
  - datasets-2.19.1 fixed the minimum requirement huggingface-hub  >= 0.21.2: https://github.com/huggingface/datasets/pull/6713
2024-05-13T11:32:57Z
https://github.com/huggingface/datasets/issues/6737#issuecomment-2107336816
https://api.github.com/repos/huggingface/datasets/issues/6737
IC_kwDODunzps59m2hw
https://api.github.com/repos/huggingface/datasets/issues/comments/2107336816/reactions
2024-05-13T11:33:09Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2107336816
https://avatars.githubusercontent.com/u/8515462?v=4
https://api.github.com/users/albertvillanova/events{/privacy}
https://api.github.com/users/albertvillanova/followers
https://api.github.com/users/albertvillanova/following{/other_user}
https://api.github.com/users/albertvillanova/gists{/gist_id}
https://github.com/albertvillanova
albertvillanova
MDQ6VXNlcjg1MTU0NjI=
https://api.github.com/users/albertvillanova/orgs
https://api.github.com/users/albertvillanova/received_events
https://api.github.com/users/albertvillanova/repos
https://api.github.com/users/albertvillanova/starred{/owner}{/repo}
https://api.github.com/users/albertvillanova/subscriptions
User
https://api.github.com/users/albertvillanova
public
NONE
@albertvillanova, thank you for this solution. I encountered the same issue and had to use:
```
conda install -c conda-forge huggingface_hub=0.21.2 datasets=2.19.1
```

Cheers
2024-07-13T01:17:17Z
https://github.com/huggingface/datasets/issues/6737#issuecomment-2226662441
https://api.github.com/repos/huggingface/datasets/issues/6737
IC_kwDODunzps6EuCwp
https://api.github.com/repos/huggingface/datasets/issues/comments/2226662441/reactions
2024-07-13T01:17:17Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2226662441
https://avatars.githubusercontent.com/u/10137?v=4
https://api.github.com/users/ghost/events{/privacy}
https://api.github.com/users/ghost/followers
https://api.github.com/users/ghost/following{/other_user}
https://api.github.com/users/ghost/gists{/gist_id}
https://github.com/ghost
ghost
MDQ6VXNlcjEwMTM3
https://api.github.com/users/ghost/orgs
https://api.github.com/users/ghost/received_events
https://api.github.com/users/ghost/repos
https://api.github.com/users/ghost/starred{/owner}{/repo}
https://api.github.com/users/ghost/subscriptions
User
https://api.github.com/users/ghost
public
NONE
Cheers！
2024-07-23T14:23:26Z
https://github.com/huggingface/datasets/issues/6737#issuecomment-2245398230
https://api.github.com/repos/huggingface/datasets/issues/6737
IC_kwDODunzps6F1g7W
https://api.github.com/repos/huggingface/datasets/issues/comments/2245398230/reactions
2024-07-23T14:23:26Z
https://api.github.com/repos/huggingface/datasets/issues/comments/2245398230
https://avatars.githubusercontent.com/u/75256666?v=4
https://api.github.com/users/suhu93/events{/privacy}
https://api.github.com/users/suhu93/followers
https://api.github.com/users/suhu93/following{/other_user}
https://api.github.com/users/suhu93/gists{/gist_id}
https://github.com/suhu93
suhu93
MDQ6VXNlcjc1MjU2NjY2
https://api.github.com/users/suhu93/orgs
https://api.github.com/users/suhu93/received_events
https://api.github.com/users/suhu93/repos
https://api.github.com/users/suhu93/starred{/owner}{/repo}
https://api.github.com/users/suhu93/subscriptions
User
https://api.github.com/users/suhu93
public
### Describe the bug

ValueError: Invalid pattern: '**' can only be an entire path component
when loading any dataset


### Steps to reproduce the bug

import datasets
ds = datasets.load_dataset("TokenBender/code_instructions_122k_alpaca_style")

### Expected behavior

loading the dataset successfully 

### Environment info

- `datasets` version: 2.18.0
- Platform: Windows-10-10.0.22631-SP0
- Python version: 3.11.7
- `huggingface_hub` version: 0.20.3
- PyArrow version: 15.0.0
- Pandas version: 2.2.1
- `fsspec` version: 2023.12.2