Bad error message when trying to download gated dataset
CONTRIBUTOR
cc @sanchit-gandhi @Vaibhavs10 @lhoestq - this is mainly for demos that use Common Voice datasets as done here: https://github.com/facebookresearch/fairseq/tree/main/examples/mms#-transformers

2023-06-14T10:04:36Z
https://github.com/huggingface/datasets/issues/5953#issuecomment-1590891684
https://api.github.com/repos/huggingface/datasets/issues/5953
IC_kwDODunzps5e0xSk
https://api.github.com/repos/huggingface/datasets/issues/comments/1590891684/reactions
2023-06-14T10:04:36Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1590891684
https://avatars.githubusercontent.com/u/23423619?v=4
https://api.github.com/users/patrickvonplaten/events{/privacy}
https://api.github.com/users/patrickvonplaten/followers
https://api.github.com/users/patrickvonplaten/following{/other_user}
https://api.github.com/users/patrickvonplaten/gists{/gist_id}
https://github.com/patrickvonplaten
patrickvonplaten
MDQ6VXNlcjIzNDIzNjE5
https://api.github.com/users/patrickvonplaten/orgs
https://api.github.com/users/patrickvonplaten/received_events
https://api.github.com/users/patrickvonplaten/repos
https://api.github.com/users/patrickvonplaten/starred{/owner}{/repo}
https://api.github.com/users/patrickvonplaten/subscriptions
User
https://api.github.com/users/patrickvonplaten
public
MEMBER
Hi ! the error for me is

```
FileNotFoundError: Couldn't find a dataset script at /content/mozilla-foundation/common_voice_13_0/common_voice_13_0.py or any data file in the same directory. Couldn't find 'mozilla-foundation/common_voice_13_0' on the Hugging Face Hub either: FileNotFoundError: Dataset 'mozilla-foundation/common_voice_13_0' doesn't exist on the Hub. If the repo is private or gated, make sure to log in with `huggingface-cli login`.
```

And tbh idk how you managed to get your error. "n_shards.json" is not even a thing in `datasets`
2023-06-14T10:10:06Z
https://github.com/huggingface/datasets/issues/5953#issuecomment-1590900665
https://api.github.com/repos/huggingface/datasets/issues/5953
IC_kwDODunzps5e0ze5
https://api.github.com/repos/huggingface/datasets/issues/comments/1590900665/reactions
2023-06-14T10:10:06Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1590900665
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
Okay, I am able to reproduce @patrickvonplaten's original error: https://github.com/Vaibhavs10/scratchpad/blob/main/cv13_datasets_test.ipynb

Also not sure why it looks for `n_shards.json`
2023-06-14T10:17:06Z
https://github.com/huggingface/datasets/issues/5953#issuecomment-1590912854
https://api.github.com/repos/huggingface/datasets/issues/5953
IC_kwDODunzps5e02dW
https://api.github.com/repos/huggingface/datasets/issues/comments/1590912854/reactions
2023-06-14T10:17:06Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1590912854
https://avatars.githubusercontent.com/u/18682411?v=4
https://api.github.com/users/Vaibhavs10/events{/privacy}
https://api.github.com/users/Vaibhavs10/followers
https://api.github.com/users/Vaibhavs10/following{/other_user}
https://api.github.com/users/Vaibhavs10/gists{/gist_id}
https://github.com/Vaibhavs10
Vaibhavs10
MDQ6VXNlcjE4NjgyNDEx
https://api.github.com/users/Vaibhavs10/orgs
https://api.github.com/users/Vaibhavs10/received_events
https://api.github.com/users/Vaibhavs10/repos
https://api.github.com/users/Vaibhavs10/starred{/owner}{/repo}
https://api.github.com/users/Vaibhavs10/subscriptions
User
https://api.github.com/users/Vaibhavs10
public
MEMBER
Ok I see, this file is downloaded from the CV dataset script - let me investigate
2023-06-14T10:19:12Z
https://github.com/huggingface/datasets/issues/5953#issuecomment-1590917492
https://api.github.com/repos/huggingface/datasets/issues/5953
IC_kwDODunzps5e03l0
https://api.github.com/repos/huggingface/datasets/issues/comments/1590917492/reactions
2023-06-14T10:19:12Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1590917492
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
Ok I see: when you log out you no longer have access to the repository.

Therefore the dataset script is loaded from cache:
```
WARNING:datasets.load:Using the latest cached version of the module from /root/.cache/huggingface/modules/datasets_modules/datasets/mozilla-foundation--common_voice_13_0/22809012aac1fc9803eaffc44122e4149043748e93933935d5ea19898587e4d7 (last modified on Wed Jun 14 10:13:17 2023) since it couldn't be found locally at mozilla-foundation/common_voice_13_0., or remotely on the Hugging Face Hub.
```

and the script tries to download the n_shards.json but fails
2023-06-14T10:20:44Z
https://github.com/huggingface/datasets/issues/5953#issuecomment-1590919623
https://api.github.com/repos/huggingface/datasets/issues/5953
IC_kwDODunzps5e04HH
https://api.github.com/repos/huggingface/datasets/issues/comments/1590919623/reactions
2023-06-14T10:20:44Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1590919623
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
Is this ok for you https://github.com/huggingface/datasets/pull/5954 ?

I'll do a release this afternoon
2023-06-14T12:08:52Z
https://github.com/huggingface/datasets/issues/5953#issuecomment-1591069057
https://api.github.com/repos/huggingface/datasets/issues/5953
IC_kwDODunzps5e1cmB
https://api.github.com/repos/huggingface/datasets/issues/comments/1591069057/reactions
2023-06-14T12:08:52Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1591069057
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
CONTRIBUTOR
Cool! 
2023-06-14T16:22:55Z
https://github.com/huggingface/datasets/issues/5953#issuecomment-1591597719
https://api.github.com/repos/huggingface/datasets/issues/5953
IC_kwDODunzps5e3dqX
https://api.github.com/repos/huggingface/datasets/issues/comments/1591597719/reactions
2023-06-14T16:22:55Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1591597719
https://avatars.githubusercontent.com/u/23423619?v=4
https://api.github.com/users/patrickvonplaten/events{/privacy}
https://api.github.com/users/patrickvonplaten/followers
https://api.github.com/users/patrickvonplaten/following{/other_user}
https://api.github.com/users/patrickvonplaten/gists{/gist_id}
https://github.com/patrickvonplaten
patrickvonplaten
MDQ6VXNlcjIzNDIzNjE5
https://api.github.com/users/patrickvonplaten/orgs
https://api.github.com/users/patrickvonplaten/received_events
https://api.github.com/users/patrickvonplaten/repos
https://api.github.com/users/patrickvonplaten/starred{/owner}{/repo}
https://api.github.com/users/patrickvonplaten/subscriptions
User
https://api.github.com/users/patrickvonplaten
public
MEMBER
this is included in the new release 2.13.0
2023-06-14T16:36:51Z
https://github.com/huggingface/datasets/issues/5953#issuecomment-1591621991
https://api.github.com/repos/huggingface/datasets/issues/5953
IC_kwDODunzps5e3jln
https://api.github.com/repos/huggingface/datasets/issues/comments/1591621991/reactions
2023-06-14T16:36:51Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1591621991
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
### Describe the bug

When I attempt to download a model from the Hub that is gated without being logged in, I get a nice error message. E.g.:

E.g.
```sh
Repository Not Found for url: https://huggingface.co/api/models/DeepFloyd/IF-I-XL-v1.0.
Please make sure you specified the correct `repo_id` and `repo_type`.
If you are trying to access a private or gated repo, make sure you are authenticated.
Invalid username or password..
Will try to load from local cache.
```

If I do the same for a gated dataset on the Hub, I'm not gated a nice error message IMO:

```sh
File ~/hf/lib/python3.10/site-packages/fsspec/implementations/http.py:430, in HTTPFileSystem._info(self, url, **kwargs)
    427     except Exception as exc:
    428         if policy == "get":
    429             # If get failed, then raise a FileNotFoundError
--> 430             raise FileNotFoundError(url) from exc
    431         logger.debug(str(exc))
    433 return {"name": url, "size": None, **info, "type": "file"}

FileNotFoundError: https://huggingface.co/datasets/mozilla-foundation/common_voice_13_0/resolve/main/n_shards.json
```

### Steps to reproduce the bug

```
huggingface-cli logout
```

and then:

```py
from datasets import load_dataset, Audio

# English
stream_data = load_dataset("mozilla-foundation/common_voice_13_0", "en", split="test", streaming=True)
stream_data = stream_data.cast_column("audio", Audio(sampling_rate=16000))
en_sample = next(iter(stream_data))["audio"]["array"]

# Swahili
stream_data = load_dataset("mozilla-foundation/common_voice_13_0", "sw", split="test", streaming=True)
stream_data = stream_data.cast_column("audio", Audio(sampling_rate=16000))
sw_sample = next(iter(stream_data))["audio"]["array"]
```

### Expected behavior

Better error message

### Environment info

Copy-and-paste the text below in your GitHub issue.

- `datasets` version: 2.12.0
- Platform: Linux-6.2.0-76060200-generic-x86_64-with-glibc2.35
- Python version: 3.10.6
- Huggingface_hub version: 0.16.0.dev0
- PyArrow version: 11.0.0
- Pandas version: 1.5.3
