Error in create a dataset from a Python generator
COLLABORATOR
Hi, thanks for reporting! The last line should be `dataset = Dataset.from_generator(my_gen)`.
2022-10-11T14:48:02Z
https://github.com/huggingface/datasets/issues/5102#issuecomment-1274819846
https://api.github.com/repos/huggingface/datasets/issues/5102
IC_kwDODunzps5L_DUG
https://api.github.com/repos/huggingface/datasets/issues/comments/1274819846/reactions
2022-10-11T14:48:02Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1274819846
https://avatars.githubusercontent.com/u/47462742?v=4
https://api.github.com/users/mariosasko/events{/privacy}
https://api.github.com/users/mariosasko/followers
https://api.github.com/users/mariosasko/following{/other_user}
https://api.github.com/users/mariosasko/gists{/gist_id}
https://github.com/mariosasko
mariosasko
MDQ6VXNlcjQ3NDYyNzQy
https://api.github.com/users/mariosasko/orgs
https://api.github.com/users/mariosasko/received_events
https://api.github.com/users/mariosasko/repos
https://api.github.com/users/mariosasko/starred{/owner}{/repo}
https://api.github.com/users/mariosasko/subscriptions
User
https://api.github.com/users/mariosasko
public
NONE
Can I work on this one?
2022-10-11T21:23:18Z
https://github.com/huggingface/datasets/issues/5102#issuecomment-1275290092
https://api.github.com/repos/huggingface/datasets/issues/5102
IC_kwDODunzps5MA2Hs
https://api.github.com/repos/huggingface/datasets/issues/comments/1275290092/reactions
2022-10-11T21:23:18Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1275290092
https://avatars.githubusercontent.com/u/22431866?v=4
https://api.github.com/users/mundruid/events{/privacy}
https://api.github.com/users/mundruid/followers
https://api.github.com/users/mundruid/following{/other_user}
https://api.github.com/users/mundruid/gists{/gist_id}
https://github.com/mundruid
mundruid
MDQ6VXNlcjIyNDMxODY2
https://api.github.com/users/mundruid/orgs
https://api.github.com/users/mundruid/received_events
https://api.github.com/users/mundruid/repos
https://api.github.com/users/mundruid/starred{/owner}{/repo}
https://api.github.com/users/mundruid/subscriptions
User
https://api.github.com/users/mundruid
public
## Describe the bug
In HOW-TO-GUIDES > Load > [Python generator](https://huggingface.co/docs/datasets/v2.5.2/en/loading#python-generator), the code example defines the `my_gen` function, but when creating the dataset, an undefined `my_dict` is passed in.  

```Python
>>> from datasets import Dataset
>>> def my_gen():
...    for i in range(1, 4):
...        yield {"a": i}
>>> dataset = Dataset.from_generator(my_dict)
```