Common Voice 8 doesn't show datasets viewer
COLLABORATOR
Thanks for reporting. I understand it's an error in the dataset script. To reproduce:

```python
>>> import datasets as ds
>>> split_names = ds.get_dataset_split_names("mozilla-foundation/common_voice_8_0", use_auth_token="**********")
Downloading builder script: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10.9k/10.9k [00:00<00:00, 10.9MB/s]
Downloading extra modules: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.98k/2.98k [00:00<00:00, 3.36MB/s]
Downloading extra modules: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 53.1k/53.1k [00:00<00:00, 650kB/s]
No config specified, defaulting to: common_voice/en
Traceback (most recent call last):
  File "/home/slesage/hf/datasets-preview-backend/libs/libmodels/.venv/lib/python3.9/site-packages/datasets/inspect.py", line 280, in get_dataset_config_info
    for split_generator in builder._split_generators(
  File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/mozilla-foundation--common_voice_8_0/720589e6e5ad674019008b719053303a71716db1b27e63c9846df02fdf93f2f3/common_voice_8_0.py", line 153, in _split_generators
    self._log_download(self.config.name, bundle_version, hf_auth_token)
  File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/mozilla-foundation--common_voice_8_0/720589e6e5ad674019008b719053303a71716db1b27e63c9846df02fdf93f2f3/common_voice_8_0.py", line 139, in _log_download
    email = HfApi().whoami(auth_token)["email"]
KeyError: 'email'

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

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/slesage/hf/datasets-preview-backend/libs/libmodels/.venv/lib/python3.9/site-packages/datasets/inspect.py", line 323, in get_dataset_split_names
    info = get_dataset_config_info(
  File "/home/slesage/hf/datasets-preview-backend/libs/libmodels/.venv/lib/python3.9/site-packages/datasets/inspect.py", line 285, in get_dataset_config_info
    raise SplitsNotFoundError("The split names could not be parsed from the dataset config.") from err
datasets.inspect.SplitsNotFoundError: The split names could not be parsed from the dataset config.
```
2022-04-27T11:59:04Z
https://github.com/huggingface/datasets/issues/4237#issuecomment-1110914331
https://api.github.com/repos/huggingface/datasets/issues/4237
IC_kwDODunzps5CNzUb
https://api.github.com/repos/huggingface/datasets/issues/comments/1110914331/reactions
2022-04-27T11:59:04Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1110914331
https://avatars.githubusercontent.com/u/1676121?v=4
https://api.github.com/users/severo/events{/privacy}
https://api.github.com/users/severo/followers
https://api.github.com/users/severo/following{/other_user}
https://api.github.com/users/severo/gists{/gist_id}
https://github.com/severo
severo
MDQ6VXNlcjE2NzYxMjE=
https://api.github.com/users/severo/orgs
https://api.github.com/users/severo/received_events
https://api.github.com/users/severo/repos
https://api.github.com/users/severo/starred{/owner}{/repo}
https://api.github.com/users/severo/subscriptions
User
https://api.github.com/users/severo
public
MEMBER
Thanks for reporting @patrickvonplaten and thanks for the investigation @severo.

Unfortunately I'm not able to reproduce the error.

I think the error has to do with authentication with `huggingface_hub`, because the exception is thrown from these code lines: https://huggingface.co/datasets/mozilla-foundation/common_voice_8_0/blob/main/common_voice_8_0.py#L137-L139
```python
from huggingface_hub import HfApi, HfFolder

if isinstance(auth_token, bool):
    email = HfApi().whoami(auth_token)
email = HfApi().whoami(auth_token)["email"]
```

Could you please verify the previous code with the `auth_token` you pass to `load_dataset(..., use_auth_token=auth_token,...`?
2022-04-27T14:08:06Z
https://github.com/huggingface/datasets/issues/4237#issuecomment-1111049266
https://api.github.com/repos/huggingface/datasets/issues/4237
IC_kwDODunzps5COUQy
https://api.github.com/repos/huggingface/datasets/issues/comments/1111049266/reactions
2022-04-27T14:08:06Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1111049266
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
COLLABORATOR
OK, thanks for digging a bit into it. Indeed, the error occurs with the dataset-viewer, but not with a normal user token, because we use an app token, and it does not have a related email!

```python
>>> from huggingface_hub import HfApi, HfFolder
>>> auth_token = "hf_app_******"
>>> t = HfApi().whoami(auth_token)
>>> t
{'type': 'app', 'name': 'dataset-preview-backend'}
>>> t["email"]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: 'email'
```

Note also that the doc (https://huggingface.co/docs/huggingface_hub/package_reference/hf_api#huggingface_hub.HfApi.whoami) does not state that `whoami` should return an `email` key.

@SBrandeis @julien-c: do you think the app token should have an email associated, like the users?
2022-04-27T14:23:04Z
https://github.com/huggingface/datasets/issues/4237#issuecomment-1111066620
https://api.github.com/repos/huggingface/datasets/issues/4237
IC_kwDODunzps5COYf8
https://api.github.com/repos/huggingface/datasets/issues/comments/1111066620/reactions
2022-04-27T14:27:23Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1111066620
https://avatars.githubusercontent.com/u/1676121?v=4
https://api.github.com/users/severo/events{/privacy}
https://api.github.com/users/severo/followers
https://api.github.com/users/severo/following{/other_user}
https://api.github.com/users/severo/gists{/gist_id}
https://github.com/severo
severo
MDQ6VXNlcjE2NzYxMjE=
https://api.github.com/users/severo/orgs
https://api.github.com/users/severo/received_events
https://api.github.com/users/severo/repos
https://api.github.com/users/severo/starred{/owner}{/repo}
https://api.github.com/users/severo/subscriptions
User
https://api.github.com/users/severo
public
MEMBER
We can workaround this with
```python
email = HfApi().whoami(auth_token).get("email", "system@huggingface.co")
```
in the common voice scripts
2022-04-29T15:24:03Z
https://github.com/huggingface/datasets/issues/4237#issuecomment-1113444775
https://api.github.com/repos/huggingface/datasets/issues/4237
IC_kwDODunzps5CXdGn
https://api.github.com/repos/huggingface/datasets/issues/comments/1113444775/reactions
2022-04-29T15:24:03Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1113444775
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
COLLABORATOR
Hmmm, does this mean that any person who downloads the common voice dataset will be logged as "system@huggingface.co"? If so, it would defeat the purpose of sending the user's email to the commonvoice API, right?
2022-04-29T15:47:34Z
https://github.com/huggingface/datasets/issues/4237#issuecomment-1113467006
https://api.github.com/repos/huggingface/datasets/issues/4237
IC_kwDODunzps5CXih-
https://api.github.com/repos/huggingface/datasets/issues/comments/1113467006/reactions
2022-04-29T15:47:34Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1113467006
https://avatars.githubusercontent.com/u/1676121?v=4
https://api.github.com/users/severo/events{/privacy}
https://api.github.com/users/severo/followers
https://api.github.com/users/severo/following{/other_user}
https://api.github.com/users/severo/gists{/gist_id}
https://github.com/severo
severo
MDQ6VXNlcjE2NzYxMjE=
https://api.github.com/users/severo/orgs
https://api.github.com/users/severo/received_events
https://api.github.com/users/severo/repos
https://api.github.com/users/severo/starred{/owner}{/repo}
https://api.github.com/users/severo/subscriptions
User
https://api.github.com/users/severo
public
MEMBER
I agree with @severo: we cannot set our system email as default, allowing anybody not authenticated to by-pass the Common Voice usage policy.

Additionally, looking at the code, I think we should implement a more robust way to send user email to Common Voice: currently anybody can tweak the script and send somebody else email instead.

CC: @patrickvonplaten @lhoestq @SBrandeis @julien-c 
2022-05-02T10:15:12Z
https://github.com/huggingface/datasets/issues/4237#issuecomment-1114694994
https://api.github.com/repos/huggingface/datasets/issues/4237
IC_kwDODunzps5CcOVS
https://api.github.com/repos/huggingface/datasets/issues/comments/1114694994/reactions
2022-05-02T10:15:12Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1114694994
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
CONTRIBUTOR
Hmm I don't agree here. 

Anybody can always just bypass the system by setting whatever email. As soon as someone has access to the downloading script it's trivial to tweak the code to not send the "correct" email but to just whatever and it would work.

Note that someone only has visibility on the code after having "signed" the access-mechanism so I think we can expect the users to have agreed to not do anything malicious. 

I'm fine with both @lhoestq's solution or we find a way that forces the user to be logged in + being able to load the data for the datasets viewer. Wdyt @lhoestq @severo @albertvillanova ?
2022-05-02T10:32:56Z
https://github.com/huggingface/datasets/issues/4237#issuecomment-1114708183
https://api.github.com/repos/huggingface/datasets/issues/4237
IC_kwDODunzps5CcRjX
https://api.github.com/repos/huggingface/datasets/issues/comments/1114708183/reactions
2022-05-02T10:32:56Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1114708183
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
> Additionally, looking at the code, I think we should implement a more robust way to send user email to Common Voice: currently anybody can tweak the script and send somebody else email instead.

Yes, I agree we can forget about this @patrickvonplaten. After having had a look at Common Voice website, I've seen they only require sending an email (no auth is inplace on their side, contrary to what I had previously thought). Therefore, currently we impose stronger requirements than them: we require the user having logged in and accepted the access mechanism.

Currently the script as it is already requires the user being logged in:
```python
HfApi().whoami(auth_token)
```
throws an exception if None/invalid auth_token is passed.

On the other hand, we should agree on the way to allow the viewer to stream the data.
2022-05-02T11:06:12Z
https://github.com/huggingface/datasets/issues/4237#issuecomment-1114728098
https://api.github.com/repos/huggingface/datasets/issues/4237
IC_kwDODunzps5CcWai
https://api.github.com/repos/huggingface/datasets/issues/comments/1114728098/reactions
2022-05-02T11:07:22Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1114728098
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
MEMBER
The preview is back now, thanks !
2022-05-10T12:17:04Z
https://github.com/huggingface/datasets/issues/4237#issuecomment-1122313815
https://api.github.com/repos/huggingface/datasets/issues/4237
IC_kwDODunzps5C5SZX
https://api.github.com/repos/huggingface/datasets/issues/comments/1122313815/reactions
2022-05-10T12:17:04Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1122313815
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
https://huggingface.co/datasets/mozilla-foundation/common_voice_8_0