url
stringlengths
58
61
repository_url
stringclasses
1 value
labels_url
stringlengths
72
75
comments_url
stringlengths
67
70
events_url
stringlengths
65
68
html_url
stringlengths
48
51
id
int64
600M
2.19B
node_id
stringlengths
18
24
number
int64
2
6.73k
title
stringlengths
1
290
user
dict
labels
listlengths
0
4
state
stringclasses
2 values
locked
bool
1 class
assignee
dict
assignees
listlengths
0
4
milestone
dict
comments
sequencelengths
0
30
created_at
timestamp[s]
updated_at
timestamp[s]
closed_at
timestamp[s]
author_association
stringclasses
3 values
active_lock_reason
null
draft
null
pull_request
null
body
stringlengths
0
228k
reactions
dict
timeline_url
stringlengths
67
70
performed_via_github_app
null
state_reason
stringclasses
3 values
https://api.github.com/repos/huggingface/datasets/issues/6447
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6447/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6447/comments
https://api.github.com/repos/huggingface/datasets/issues/6447/events
https://github.com/huggingface/datasets/issues/6447
2,008,195,298
I_kwDODunzps53sqDi
6,447
Support one dataset loader per config when using YAML
{ "login": "severo", "id": 1676121, "node_id": "MDQ6VXNlcjE2NzYxMjE=", "avatar_url": "https://avatars.githubusercontent.com/u/1676121?v=4", "gravatar_id": "", "url": "https://api.github.com/users/severo", "html_url": "https://github.com/severo", "followers_url": "https://api.github.com/users/severo/followers", "following_url": "https://api.github.com/users/severo/following{/other_user}", "gists_url": "https://api.github.com/users/severo/gists{/gist_id}", "starred_url": "https://api.github.com/users/severo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/severo/subscriptions", "organizations_url": "https://api.github.com/users/severo/orgs", "repos_url": "https://api.github.com/users/severo/repos", "events_url": "https://api.github.com/users/severo/events{/privacy}", "received_events_url": "https://api.github.com/users/severo/received_events", "type": "User", "site_admin": false }
[ { "id": 1935892871, "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement", "name": "enhancement", "color": "a2eeef", "default": true, "description": "New feature or request" } ]
open
false
null
[]
null
[]
2023-11-23T13:03:07
2023-11-23T13:03:07
null
CONTRIBUTOR
null
null
null
### Feature request See https://huggingface.co/datasets/datasets-examples/doc-unsupported-1 I would like to use CSV loader for the "csv" config, JSONL loader for the "jsonl" config, etc. ### Motivation It would be more flexible for the users ### Your contribution No specific contribution
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6447/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6447/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6446
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6446/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6446/comments
https://api.github.com/repos/huggingface/datasets/issues/6446/events
https://github.com/huggingface/datasets/issues/6446
2,007,092,708
I_kwDODunzps53oc3k
6,446
Speech Commands v2 dataset doesn't match AST-v2 config
{ "login": "vymao", "id": 18024303, "node_id": "MDQ6VXNlcjE4MDI0MzAz", "avatar_url": "https://avatars.githubusercontent.com/u/18024303?v=4", "gravatar_id": "", "url": "https://api.github.com/users/vymao", "html_url": "https://github.com/vymao", "followers_url": "https://api.github.com/users/vymao/followers", "following_url": "https://api.github.com/users/vymao/following{/other_user}", "gists_url": "https://api.github.com/users/vymao/gists{/gist_id}", "starred_url": "https://api.github.com/users/vymao/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/vymao/subscriptions", "organizations_url": "https://api.github.com/users/vymao/orgs", "repos_url": "https://api.github.com/users/vymao/repos", "events_url": "https://api.github.com/users/vymao/events{/privacy}", "received_events_url": "https://api.github.com/users/vymao/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "You can use `.align_labels_with_mapping` on the dataset to align the labels with the model config.\r\n\r\nRegarding the number of labels, only the special `_silence_` label corresponding to noise is missing, which is consistent with the model paper (reports training on 35 labels). You can run a `.filter` to drop it.\r\n\r\nPS: You should create a discussion on a model/dataset repo (on the Hub) for these kinds of questions", "Thanks, will keep that in mind. But I tried running `dataset_aligned = dataset.align_labels_with_mapping(model.config.id2label, 'label')`, and received this error: \r\n\r\n```\r\nTraceback (most recent call last):\r\n File \"<stdin>\", line 1, in <module>\r\n File \"/Users/victor/anaconda3/envs/transformers-v2/lib/python3.9/site-packages/datasets/arrow_dataset.py\", line 5928, in align_labels_with_mapping\r\n label2id = {k.lower(): v for k, v in label2id.items()}\r\n File \"/Users/victor/anaconda3/envs/transformers-v2/lib/python3.9/site-packages/datasets/arrow_dataset.py\", line 5928, in <dictcomp>\r\n label2id = {k.lower(): v for k, v in label2id.items()}\r\nAttributeError: 'int' object has no attribute 'lower'\r\n```\r\nMy guess is that the dataset `label` column is purely an int ID, and I'm not sure there's a way to identify which class label the ID belongs to in the dataset easily.", "Replacing `model.config.id2label` with `model.config.label2id` should fix the issue.\r\n\r\nSo, the full code to align the labels with the model config is as follows:\r\n```python\r\nfrom datasets import load_dataset\r\nfrom transformers import AutoFeatureExtractor, AutoModelForAudioClassification\r\n\r\n# extractor = AutoFeatureExtractor.from_pretrained(\"MIT/ast-finetuned-speech-commands-v2\")\r\nmodel = AutoModelForAudioClassification.from_pretrained(\"MIT/ast-finetuned-speech-commands-v2\")\r\n\r\nds = load_dataset(\"speech_commands\", \"v0.02\")\r\nds = ds.filter(lambda label: label != ds[\"train\"].features[\"label\"].str2int(\"_silence_\"), input_columns=\"label\")\r\nds = ds.align_labels_with_mapping(model.config.label2id, \"label\")\r\n```" ]
2023-11-22T20:46:36
2023-11-28T14:46:08
2023-11-28T14:46:08
NONE
null
null
null
### Describe the bug [According](https://huggingface.co/MIT/ast-finetuned-speech-commands-v2) to `MIT/ast-finetuned-speech-commands-v2`, the model was trained on the Speech Commands v2 dataset. However, while the model config says the model should have 35 class labels, the dataset itself has 36 class labels. Moreover, the class labels themselves don't match between the model config and the dataset. It is difficult to reproduce the data used to fine tune `MIT/ast-finetuned-speech-commands-v2`. ### Steps to reproduce the bug ``` >>> model = ASTForAudioClassification.from_pretrained("MIT/ast-finetuned-speech-commands-v2") >>> model.config.id2label {0: 'backward', 1: 'follow', 2: 'five', 3: 'bed', 4: 'zero', 5: 'on', 6: 'learn', 7: 'two', 8: 'house', 9: 'tree', 10: 'dog', 11: 'stop', 12: 'seven', 13: 'eight', 14: 'down', 15: 'six', 16: 'forward', 17: 'cat', 18: 'right', 19: 'visual', 20: 'four', 21: 'wow', 22: 'no', 23: 'nine', 24: 'off', 25: 'three', 26: 'left', 27: 'marvin', 28: 'yes', 29: 'up', 30: 'sheila', 31: 'happy', 32: 'bird', 33: 'go', 34: 'one'} >>> dataset = load_dataset("speech_commands", "v0.02", split="test") >>> torch.unique(torch.Tensor(dataset['label'])) tensor([ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20., 21., 22., 23., 24., 25., 26., 27., 28., 29., 30., 31., 32., 33., 34., 35.]) ``` If you try to explore the [dataset itself](https://huggingface.co/datasets/speech_commands/viewer/v0.02/test), you can see that the id to label does not match what is provided by `model.config.id2label`. ### Expected behavior The labels should match completely and there should be the same number of label classes between the model config and the dataset itself. ### Environment info datasets = 2.14.6, transformers = 4.33.3
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6446/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6446/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6443
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6443/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6443/comments
https://api.github.com/repos/huggingface/datasets/issues/6443/events
https://github.com/huggingface/datasets/issues/6443
2,006,568,368
I_kwDODunzps53mc2w
6,443
Trouble loading files defined in YAML explicitly
{ "login": "severo", "id": 1676121, "node_id": "MDQ6VXNlcjE2NzYxMjE=", "avatar_url": "https://avatars.githubusercontent.com/u/1676121?v=4", "gravatar_id": "", "url": "https://api.github.com/users/severo", "html_url": "https://github.com/severo", "followers_url": "https://api.github.com/users/severo/followers", "following_url": "https://api.github.com/users/severo/following{/other_user}", "gists_url": "https://api.github.com/users/severo/gists{/gist_id}", "starred_url": "https://api.github.com/users/severo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/severo/subscriptions", "organizations_url": "https://api.github.com/users/severo/orgs", "repos_url": "https://api.github.com/users/severo/repos", "events_url": "https://api.github.com/users/severo/events{/privacy}", "received_events_url": "https://api.github.com/users/severo/received_events", "type": "User", "site_admin": false }
[ { "id": 1935892857, "node_id": "MDU6TGFiZWwxOTM1ODkyODU3", "url": "https://api.github.com/repos/huggingface/datasets/labels/bug", "name": "bug", "color": "d73a4a", "default": true, "description": "Something isn't working" } ]
open
false
null
[]
null
[ "There is a typo in one of the file names - `data/edf.csv` should be renamed to `data/def.csv` 🙂. ", "wow, I reviewed it twice to avoid being ashamed like that, but... I didn't notice the typo.\r\n\r\n---\r\n\r\nBesides this: do you think we would be able to improve the error message to make this clearer?" ]
2023-11-22T15:18:10
2023-11-23T09:06:20
null
CONTRIBUTOR
null
null
null
Look at https://huggingface.co/datasets/severo/doc-yaml-2 It's a reproduction of the example given in the docs at https://huggingface.co/docs/hub/datasets-manual-configuration ``` You can select multiple files per split using a list of paths: my_dataset_repository/ ├── README.md ├── data/ │ ├── abc.csv │ └── def.csv └── holdout/ └── ghi.csv --- configs: - config_name: default data_files: - split: train path: - "data/abc.csv" - "data/def.csv" - split: test path: "holdout/ghi.csv" --- ``` It raises the following error: ``` Error code: ConfigNamesError Exception: FileNotFoundError Message: Couldn't find a dataset script at /src/services/worker/severo/doc-yaml-2/doc-yaml-2.py or any data file in the same directory. Couldn't find 'severo/doc-yaml-2' on the Hugging Face Hub either: FileNotFoundError: Unable to find 'hf://datasets/severo/doc-yaml-2@938a0578fb4c6bc9da7d80b06a3ba39c2834b0c2/data/def.csv' with any supported extension ['.csv', '.tsv', '.json', '.jsonl', '.parquet', '.arrow', '.txt', '.blp', '.bmp', '.dib', '.bufr', '.cur', '.pcx', '.dcx', '.dds', '.ps', '.eps', '.fit', '.fits', '.fli', '.flc', '.ftc', '.ftu', '.gbr', '.gif', '.grib', '.h5', '.hdf', '.png', '.apng', '.jp2', '.j2k', '.jpc', '.jpf', '.jpx', '.j2c', '.icns', '.ico', '.im', '.iim', '.tif', '.tiff', '.jfif', '.jpe', '.jpg', '.jpeg', '.mpg', '.mpeg', '.msp', '.pcd', '.pxr', '.pbm', '.pgm', '.ppm', '.pnm', '.psd', '.bw', '.rgb', '.rgba', '.sgi', '.ras', '.tga', '.icb', '.vda', '.vst', '.webp', '.wmf', '.emf', '.xbm', '.xpm', '.BLP', '.BMP', '.DIB', '.BUFR', '.CUR', '.PCX', '.DCX', '.DDS', '.PS', '.EPS', '.FIT', '.FITS', '.FLI', '.FLC', '.FTC', '.FTU', '.GBR', '.GIF', '.GRIB', '.H5', '.HDF', '.PNG', '.APNG', '.JP2', '.J2K', '.JPC', '.JPF', '.JPX', '.J2C', '.ICNS', '.ICO', '.IM', '.IIM', '.TIF', '.TIFF', '.JFIF', '.JPE', '.JPG', '.JPEG', '.MPG', '.MPEG', '.MSP', '.PCD', '.PXR', '.PBM', '.PGM', '.PPM', '.PNM', '.PSD', '.BW', '.RGB', '.RGBA', '.SGI', '.RAS', '.TGA', '.ICB', '.VDA', '.VST', '.WEBP', '.WMF', '.EMF', '.XBM', '.XPM', '.aiff', '.au', '.avr', '.caf', '.flac', '.htk', '.svx', '.mat4', '.mat5', '.mpc2k', '.ogg', '.paf', '.pvf', '.raw', '.rf64', '.sd2', '.sds', '.ircam', '.voc', '.w64', '.wav', '.nist', '.wavex', '.wve', '.xi', '.mp3', '.opus', '.AIFF', '.AU', '.AVR', '.CAF', '.FLAC', '.HTK', '.SVX', '.MAT4', '.MAT5', '.MPC2K', '.OGG', '.PAF', '.PVF', '.RAW', '.RF64', '.SD2', '.SDS', '.IRCAM', '.VOC', '.W64', '.WAV', '.NIST', '.WAVEX', '.WVE', '.XI', '.MP3', '.OPUS', '.zip'] Traceback: Traceback (most recent call last): File "/src/services/worker/src/worker/job_runners/dataset/config_names.py", line 65, in compute_config_names_response for config in sorted(get_dataset_config_names(path=dataset, token=hf_token)) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/inspect.py", line 351, in get_dataset_config_names dataset_module = dataset_module_factory( File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 1507, in dataset_module_factory raise FileNotFoundError( FileNotFoundError: Couldn't find a dataset script at /src/services/worker/severo/doc-yaml-2/doc-yaml-2.py or any data file in the same directory. Couldn't find 'severo/doc-yaml-2' on the Hugging Face Hub either: FileNotFoundError: Unable to find 'hf://datasets/severo/doc-yaml-2@938a0578fb4c6bc9da7d80b06a3ba39c2834b0c2/data/def.csv' with any supported extension ['.csv', '.tsv', '.json', '.jsonl', '.parquet', '.arrow', '.txt', '.blp', '.bmp', '.dib', '.bufr', '.cur', '.pcx', '.dcx', '.dds', '.ps', '.eps', '.fit', '.fits', '.fli', '.flc', '.ftc', '.ftu', '.gbr', '.gif', '.grib', '.h5', '.hdf', '.png', '.apng', '.jp2', '.j2k', '.jpc', '.jpf', '.jpx', '.j2c', '.icns', '.ico', '.im', '.iim', '.tif', '.tiff', '.jfif', '.jpe', '.jpg', '.jpeg', '.mpg', '.mpeg', '.msp', '.pcd', '.pxr', '.pbm', '.pgm', '.ppm', '.pnm', '.psd', '.bw', '.rgb', '.rgba', '.sgi', '.ras', '.tga', '.icb', '.vda', '.vst', '.webp', '.wmf', '.emf', '.xbm', '.xpm', '.BLP', '.BMP', '.DIB', '.BUFR', '.CUR', '.PCX', '.DCX', '.DDS', '.PS', '.EPS', '.FIT', '.FITS', '.FLI', '.FLC', '.FTC', '.FTU', '.GBR', '.GIF', '.GRIB', '.H5', '.HDF', '.PNG', '.APNG', '.JP2', '.J2K', '.JPC', '.JPF', '.JPX', '.J2C', '.ICNS', '.ICO', '.IM', '.IIM', '.TIF', '.TIFF', '.JFIF', '.JPE', '.JPG', '.JPEG', '.MPG', '.MPEG', '.MSP', '.PCD', '.PXR', '.PBM', '.PGM', '.PPM', '.PNM', '.PSD', '.BW', '.RGB', '.RGBA', '.SGI', '.RAS', '.TGA', '.ICB', '.VDA', '.VST', '.WEBP', '.WMF', '.EMF', '.XBM', '.XPM', '.aiff', '.au', '.avr', '.caf', '.flac', '.htk', '.svx', '.mat4', '.mat5', '.mpc2k', '.ogg', '.paf', '.pvf', '.raw', '.rf64', '.sd2', '.sds', '.ircam', '.voc', '.w64', '.wav', '.nist', '.wavex', '.wve', '.xi', '.mp3', '.opus', '.AIFF', '.AU', '.AVR', '.CAF', '.FLAC', '.HTK', '.SVX', '.MAT4', '.MAT5', '.MPC2K', '.OGG', '.PAF', '.PVF', '.RAW', '.RF64', '.SD2', '.SDS', '.IRCAM', '.VOC', '.W64', '.WAV', '.NIST', '.WAVEX', '.WVE', '.XI', '.MP3', '.OPUS', '.zip'] ```
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6443/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6443/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6442
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6442/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6442/comments
https://api.github.com/repos/huggingface/datasets/issues/6442/events
https://github.com/huggingface/datasets/issues/6442
2,006,086,907
I_kwDODunzps53knT7
6,442
Trouble loading image folder with additional features - metadata file ignored
{ "login": "linoytsaban", "id": 57615435, "node_id": "MDQ6VXNlcjU3NjE1NDM1", "avatar_url": "https://avatars.githubusercontent.com/u/57615435?v=4", "gravatar_id": "", "url": "https://api.github.com/users/linoytsaban", "html_url": "https://github.com/linoytsaban", "followers_url": "https://api.github.com/users/linoytsaban/followers", "following_url": "https://api.github.com/users/linoytsaban/following{/other_user}", "gists_url": "https://api.github.com/users/linoytsaban/gists{/gist_id}", "starred_url": "https://api.github.com/users/linoytsaban/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/linoytsaban/subscriptions", "organizations_url": "https://api.github.com/users/linoytsaban/orgs", "repos_url": "https://api.github.com/users/linoytsaban/repos", "events_url": "https://api.github.com/users/linoytsaban/events{/privacy}", "received_events_url": "https://api.github.com/users/linoytsaban/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "I reproduced too:\r\n- root: metadata file is ignored (https://huggingface.co/datasets/severo/doc-image-3)\r\n- data/ dir: metadata file is ignored (https://huggingface.co/datasets/severo/doc-image-4)\r\n- train/ dir: works (https://huggingface.co/datasets/severo/doc-image-5)" ]
2023-11-22T11:01:35
2023-11-24T17:13:03
2023-11-24T17:13:03
NONE
null
null
null
### Describe the bug Loading image folder with a caption column using `load_dataset(<image_folder_path>)` doesn't load the captions. When loading a local image folder with captions using `datasets==2.13.0` ``` from datasets import load_dataset data = load_dataset(<image_folder_path>) data.column_names ``` yields `{'train': ['image', 'prompt']}` but when using `datasets==2.15.0` yeilds `{'train': ['image']}` Putting the images and `metadata.jsonl` file into a nested `train` folder **or** loading with `load_dataset("imagefolder", data_dir=<image_folder_path>)` solves the issue and yields `{'train': ['image', 'prompt']}` ### Steps to reproduce the bug 1. create a folder `<image_folder_path>` that contains images and a metadata file with additional features- e.g. "prompt" 2. run: ``` from datasets import load_dataset data = load_dataset("<image_folder_path>") data.column_names ``` ### Expected behavior `{'train': ['image', 'prompt']}` ### Environment info - `datasets` version: 2.15.0 - Platform: Linux-5.15.120+-x86_64-with-glibc2.35 - Python version: 3.10.12 - `huggingface_hub` version: 0.19.4 - PyArrow version: 9.0.0 - Pandas version: 1.5.3 - `fsspec` version: 2023.6.0
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6442/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6442/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6441
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6441/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6441/comments
https://api.github.com/repos/huggingface/datasets/issues/6441/events
https://github.com/huggingface/datasets/issues/6441
2,004,985,857
I_kwDODunzps53gagB
6,441
Trouble Loading a Gated Dataset For User with Granted Permission
{ "login": "e-trop", "id": 124715309, "node_id": "U_kgDOB28BLQ", "avatar_url": "https://avatars.githubusercontent.com/u/124715309?v=4", "gravatar_id": "", "url": "https://api.github.com/users/e-trop", "html_url": "https://github.com/e-trop", "followers_url": "https://api.github.com/users/e-trop/followers", "following_url": "https://api.github.com/users/e-trop/following{/other_user}", "gists_url": "https://api.github.com/users/e-trop/gists{/gist_id}", "starred_url": "https://api.github.com/users/e-trop/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/e-trop/subscriptions", "organizations_url": "https://api.github.com/users/e-trop/orgs", "repos_url": "https://api.github.com/users/e-trop/repos", "events_url": "https://api.github.com/users/e-trop/events{/privacy}", "received_events_url": "https://api.github.com/users/e-trop/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "> Also when they try to click the url link for the dataset they get a 404 error.\r\n\r\nThis seems to be a Hub error then (cc @SBrandeis)", "Could you report this to https://discuss.huggingface.co/c/hub/23, providing the URL of the dataset, or at least if the dataset is public or private?", "Thanks for the reply! I've created an issue on the hub's board here: https://discuss.huggingface.co/t/trouble-loading-a-gated-dataset-for-user-with-granted-permission/65565" ]
2023-11-21T19:24:36
2023-12-13T08:27:16
2023-12-13T08:27:16
NONE
null
null
null
### Describe the bug I have granted permissions to several users to access a gated huggingface dataset. The users accepted the invite and when trying to load the dataset using their access token they get `FileNotFoundError: Couldn't find a dataset script at .....` . Also when they try to click the url link for the dataset they get a 404 error. ### Steps to reproduce the bug 1. Grant access to gated dataset for specific users 2. Users accept invitation 3. Users login to hugging face hub using cli login 4. Users run load_dataset ### Expected behavior Dataset is loaded normally for users who were granted access to the gated dataset. ### Environment info datasets==2.15.0
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6441/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6441/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6440
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6440/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6440/comments
https://api.github.com/repos/huggingface/datasets/issues/6440/events
https://github.com/huggingface/datasets/issues/6440
2,004,509,301
I_kwDODunzps53emJ1
6,440
`.map` not hashing under python 3.9
{ "login": "changyeli", "id": 9058204, "node_id": "MDQ6VXNlcjkwNTgyMDQ=", "avatar_url": "https://avatars.githubusercontent.com/u/9058204?v=4", "gravatar_id": "", "url": "https://api.github.com/users/changyeli", "html_url": "https://github.com/changyeli", "followers_url": "https://api.github.com/users/changyeli/followers", "following_url": "https://api.github.com/users/changyeli/following{/other_user}", "gists_url": "https://api.github.com/users/changyeli/gists{/gist_id}", "starred_url": "https://api.github.com/users/changyeli/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/changyeli/subscriptions", "organizations_url": "https://api.github.com/users/changyeli/orgs", "repos_url": "https://api.github.com/users/changyeli/repos", "events_url": "https://api.github.com/users/changyeli/events{/privacy}", "received_events_url": "https://api.github.com/users/changyeli/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "Tried to upgrade Python to 3.11 - still get this message. A partial solution is to NOT use `num_proc` at all. It will be considerably longer to finish the job.", "Hi! The `model = torch.compile(model)` line is problematic for our hashing logic. We would have to merge https://github.com/huggingface/datasets/pull/5867 to support hashing `torch.compile`-ed models/functions. \r\n\r\nI've started refactoring the hashing logic and plan to incorporate a fix for `torch.compile` as part of it, so this should be addressed soon (probably this or next week). " ]
2023-11-21T15:14:54
2023-11-28T16:29:33
2023-11-28T16:29:33
NONE
null
null
null
### Describe the bug The `.map` function cannot hash under python 3.9. Tried to use [the solution here](https://github.com/huggingface/datasets/issues/4521#issuecomment-1205166653), but still get the same message: `Parameter 'function'=<function map_to_pred at 0x7fa0b49ead30> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed.` ### Steps to reproduce the bug ```python def map_to_pred(batch): """ Perform inference on an audio batch Parameters: batch (dict): A dictionary containing audio data and other related information. Returns: dict: The input batch dictionary with added prediction and transcription fields. """ audio = batch['audio'] input_features = processor( audio['array'], sampling_rate=audio['sampling_rate'], return_tensors="pt").input_features input_features = input_features.to('cuda') with torch.no_grad(): predicted_ids = model.generate(input_features) preds = processor.batch_decode(predicted_ids, skip_special_tokens=True)[0] batch['prediction'] = processor.tokenizer._normalize(preds) batch["transcription"] = processor.tokenizer._normalize(batch['transcription']) return batch MODEL_CARD = "openai/whisper-small" MODEL_NAME = MODEL_CARD.rsplit('/', maxsplit=1)[-1] model = WhisperForConditionalGeneration.from_pretrained(MODEL_CARD) processor = AutoProcessor.from_pretrained( MODEL_CARD, language="english", task="transcribe") model = torch.compile(model) dt = load_dataset("audiofolder", data_dir=config['DATA']['dataset'], split="test") dt = dt.cast_column("audio", Audio(sampling_rate=16000)) result = coraal_dt.map(map_to_pred, num_proc=16) ``` ### Expected behavior Hashed and cached dataset starts inferencing ### Environment info - `transformers` version: 4.35.0 - Platform: Linux-5.14.0-284.30.1.el9_2.x86_64-x86_64-with-glibc2.34 - Python version: 3.9.18 - Huggingface_hub version: 0.17.3 - Safetensors version: 0.4.0 - Accelerate version: 0.24.1 - Accelerate config: not found - PyTorch version (GPU?): 2.1.0 (True) - Tensorflow version (GPU?): not installed (NA) - Flax version (CPU?/GPU?/TPU?): not installed (NA) - Jax version: not installed - JaxLib version: not installed - Using GPU in script?: yes - Using distributed or parallel set-up in script?: no
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6440/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6440/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6439
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6439/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6439/comments
https://api.github.com/repos/huggingface/datasets/issues/6439/events
https://github.com/huggingface/datasets/issues/6439
2,002,916,514
I_kwDODunzps53YhSi
6,439
Download + preparation speed of datasets.load_dataset is 20x slower than huggingface hub snapshot and manual loding
{ "login": "AntreasAntoniou", "id": 10792502, "node_id": "MDQ6VXNlcjEwNzkyNTAy", "avatar_url": "https://avatars.githubusercontent.com/u/10792502?v=4", "gravatar_id": "", "url": "https://api.github.com/users/AntreasAntoniou", "html_url": "https://github.com/AntreasAntoniou", "followers_url": "https://api.github.com/users/AntreasAntoniou/followers", "following_url": "https://api.github.com/users/AntreasAntoniou/following{/other_user}", "gists_url": "https://api.github.com/users/AntreasAntoniou/gists{/gist_id}", "starred_url": "https://api.github.com/users/AntreasAntoniou/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/AntreasAntoniou/subscriptions", "organizations_url": "https://api.github.com/users/AntreasAntoniou/orgs", "repos_url": "https://api.github.com/users/AntreasAntoniou/repos", "events_url": "https://api.github.com/users/AntreasAntoniou/events{/privacy}", "received_events_url": "https://api.github.com/users/AntreasAntoniou/received_events", "type": "User", "site_admin": false }
[]
open
false
null
[]
null
[]
2023-11-20T20:07:23
2023-11-20T20:07:37
null
NONE
null
null
null
### Describe the bug I am working with a dataset I am trying to publish. The path is Antreas/TALI. It's a fairly large dataset, and contains images, video, audio and text. I have been having multiple problems when the dataset is being downloaded using the load_dataset function -- even with 64 workers taking more than 7 days to process. With snapshot download it takes 12 hours, and that includes the dataset preparation done using load_dataset and passing the dataset parquet file paths. Find the script I am using below: ```python import multiprocessing as mp import pathlib from typing import Optional import datasets from rich import print from tqdm import tqdm def download_dataset_via_hub( dataset_name: str, dataset_download_path: pathlib.Path, num_download_workers: int = mp.cpu_count(), ): import huggingface_hub as hf_hub download_folder = hf_hub.snapshot_download( repo_id=dataset_name, repo_type="dataset", cache_dir=dataset_download_path, resume_download=True, max_workers=num_download_workers, ignore_patterns=[], ) return pathlib.Path(download_folder) / "data" def load_dataset_via_hub( dataset_download_path: pathlib.Path, num_download_workers: int = mp.cpu_count(), dataset_name: Optional[str] = None, ): from dataclasses import dataclass, field from datasets import ClassLabel, Features, Image, Sequence, Value dataset_path = download_dataset_via_hub( dataset_download_path=dataset_download_path, num_download_workers=num_download_workers, dataset_name=dataset_name, ) # Building a list of file paths for validation set train_files = [ file.as_posix() for file in pathlib.Path(dataset_path).glob("*.parquet") if "train" in file.as_posix() ] val_files = [ file.as_posix() for file in pathlib.Path(dataset_path).glob("*.parquet") if "val" in file.as_posix() ] test_files = [ file.as_posix() for file in pathlib.Path(dataset_path).glob("*.parquet") if "test" in file.as_posix() ] print( f"Found {len(test_files)} files for testing set, {len(train_files)} for training set and {len(val_files)} for validation set" ) data_files = { "test": test_files, "val": val_files, "train": train_files, } features = Features( { "image": Image( decode=True ), # Set `decode=True` if you want to decode the images, otherwise `decode=False` "image_url": Value("string"), "item_idx": Value("int64"), "wit_features": Sequence( { "attribution_passes_lang_id": Value("bool"), "caption_alt_text_description": Value("string"), "caption_reference_description": Value("string"), "caption_title_and_reference_description": Value("string"), "context_page_description": Value("string"), "context_section_description": Value("string"), "hierarchical_section_title": Value("string"), "is_main_image": Value("bool"), "language": Value("string"), "page_changed_recently": Value("bool"), "page_title": Value("string"), "page_url": Value("string"), "section_title": Value("string"), } ), "wit_idx": Value("int64"), "youtube_title_text": Value("string"), "youtube_description_text": Value("string"), "youtube_video_content": Value("binary"), "youtube_video_starting_time": Value("string"), "youtube_subtitle_text": Value("string"), "youtube_video_size": Value("int64"), "youtube_video_file_path": Value("string"), } ) dataset = datasets.load_dataset( "parquet" if dataset_name is None else dataset_name, data_files=data_files, features=features, num_proc=1, cache_dir=dataset_download_path / "cache", ) return dataset if __name__ == "__main__": dataset_cache = pathlib.Path("/disk/scratch_fast0/tali/") dataset = load_dataset_via_hub(dataset_cache, dataset_name="Antreas/TALI")[ "test" ] for sample in tqdm(dataset): print(list(sample.keys())) ``` Also, streaming this dataset has been a very painfully slow process. Streaming the train set takes 15m to start, and streaming the test and val sets takes 3 hours to start! ### Steps to reproduce the bug 1. Run the code I provided to get a sense of how fast snapshot + manual is 2. Run datasets.load_dataset("Antreas/TALI") to get a sense of the speed of that OP. 3. You should now have an appreciation of how long these things take. ### Expected behavior The load dataset function should be at least as fast as the huggingface snapshot download function in terms of downloading dataset files. Not 20 times slower. ### Environment info - `datasets` version: 2.14.5 - Platform: Linux-5.15.0-76-generic-x86_64-with-glibc2.35 - Python version: 3.10.13 - Huggingface_hub version: 0.17.3 - PyArrow version: 13.0.0 - Pandas version: 2.1.1
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6439/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6439/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6438
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6438/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6438/comments
https://api.github.com/repos/huggingface/datasets/issues/6438/events
https://github.com/huggingface/datasets/issues/6438
2,002,032,804
I_kwDODunzps53VJik
6,438
Support GeoParquet
{ "login": "severo", "id": 1676121, "node_id": "MDQ6VXNlcjE2NzYxMjE=", "avatar_url": "https://avatars.githubusercontent.com/u/1676121?v=4", "gravatar_id": "", "url": "https://api.github.com/users/severo", "html_url": "https://github.com/severo", "followers_url": "https://api.github.com/users/severo/followers", "following_url": "https://api.github.com/users/severo/following{/other_user}", "gists_url": "https://api.github.com/users/severo/gists{/gist_id}", "starred_url": "https://api.github.com/users/severo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/severo/subscriptions", "organizations_url": "https://api.github.com/users/severo/orgs", "repos_url": "https://api.github.com/users/severo/repos", "events_url": "https://api.github.com/users/severo/events{/privacy}", "received_events_url": "https://api.github.com/users/severo/received_events", "type": "User", "site_admin": false }
[ { "id": 1935892871, "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement", "name": "enhancement", "color": "a2eeef", "default": true, "description": "New feature or request" } ]
open
false
null
[]
null
[ "Thank you, @severo ! I would be more than happy to help in any way I can. I am not familiar with this repo's codebase, but I would be eager to contribute. :)\r\n\r\nFor the preview in Datasets Hub, I think it makes sense to just display the geospatial column as text. If there were a dataset loader, though, I think it should be able to support the geospatial components. Geopandas is probably the most user-friendly interface for that. I'm not sure if it's currently relevant in the context of geoparquet, but I think the pyogrio driver is faster than fiona.\r\n\r\nBut the whole gdal dependency thing can be a real pain. If anything, it would need to be an optional dependency. Maybe it would be best if the loader tries importing relevant geospatial libraries, and in the event of an ImportError, falls back to text for the geometry column.\r\n\r\nPlease let me know if I can be of assistance, and thanks again for creating this Issue. :)", "Just hitting into this same issue too showing GeoParquet files in Datasets Viewer. I tried to implement a custom reader for GeoParquet in https://huggingface.co/datasets/weiji14/clay_vector_embeddings/discussions/1, but it seems like HuggingFace has disabled datasets with custom loading scripts from using the dataset viewer according to https://discuss.huggingface.co/t/dataset-repo-requires-arbitrary-python-code-execution/59346 :frowning_face: \r\n\r\n![image](https://github.com/huggingface/datasets/assets/23487320/2f84d8ce-91c2-48cb-b72c-547ea8583892)\r\n\r\nI'm thinking now if there's a way to simply map files with GeoParquet extensions (*.gpq, *.geoparquet, etc) to use the Parquet reader. Maybe we could allowlist these geoparquet file extensions at https://github.com/huggingface/datasets/blame/0caf91285116ec910f409e82cc6e1f4cff7496e3/src/datasets/packaged_modules/__init__.py#L30-L51? Having the table columns show up would be a quick win.\r\n\r\nLonger term though, it would certainly be nice if the WKB geometry columns could be displayed in a nicer form. Geopandas' [read_parquet](https://geopandas.org/en/v0.14.1/docs/reference/api/geopandas.read_parquet.html) function is supposedly faster than `pyogrio.read_dataframe` according to https://github.com/geopandas/geopandas/discussions/2724#discussioncomment-4606048, but there's also [`pyogrio.raw.read_arrow`](https://pyogrio.readthedocs.io/en/latest/api.html#pyogrio.raw.read_arrow) now that can read into a `pyarrow.Table` directly.", "Update: It looks like renaming the GeoParquet file to have a file extension of `*.parquet` works (see https://huggingface.co/datasets/weiji14/clay_vector_embeddings). HuggingFace's default parquet reader is able to read the GeoParquet file, though the geometry column is of an unknown type:\r\n\r\n![image](https://github.com/huggingface/datasets/assets/23487320/9060c300-d595-4409-9ccb-5e0207396883)\r\n\r\nI've opened a quick PR at #6508 to allow files with a `*.geoparquet` or `*.gpq` extension to be read using the default Parquet reader. Let's see how that goes :smile:", "@joshuasundance-swca, @weiji14, If I'm understanding this correctly, the code below wouldn't be recommended to due to dependency headaches? If that's the case, what solution would there be to see the geometry features for .gpq files in huggingfaceHub? \r\n\r\ncode for dataset_loader.py\r\n```\r\nimport geopandas as gpd\r\n# ... (other imports remain the same)\r\n\r\nclass ClayVectorEmbeddings(datasets.ArrowBasedBuilder):\r\n # ... (other parts of the class remain the same)\r\n\r\n def _info(self):\r\n # Read the GeoParquet file to get the schema for the 'geometry' feature\r\n gdf = gpd.read_file(\"path/to/your/geoparquet/file.gpq\") # Replace with your file path\r\n geometry_schema = str(gdf.geometry.dtype)\r\n\r\n return datasets.DatasetInfo(\r\n # This is the description that will appear on the datasets page.\r\n description=\"Clay Vector Embeddings in GeoParquet format.\",\r\n # This defines the different columns of the dataset and their types\r\n features=datasets.Features(\r\n {\r\n \"source_url\": datasets.Value(dtype=\"string\"),\r\n \"date\": datasets.Value(dtype=\"date32\"),\r\n \"embeddings\": datasets.Value(\"string\"),\r\n \"geometry\": datasets.Value(dtype=geometry_schema), # Use the schema read by GeoPandas\r\n # ... (other features)\r\n }\r\n ),\r\n )\r\n\r\n# ... (rest of the script remains the same)\r\n\r\n```", "Hi @mehrdad-es, I'm not sure if HuggingFace would be keen to add `geopandas` to HuggingFace Hub (maybe a question for @severo?). Having a geometry viewer would be an even bigger task, and if you're thinking of a map-viewer, it might involve some redesign of the website UI. Some of my colleagues are working on streamlining GeoParquet visualization from cloud-hosted instances like HuggingFace (see e.g. https://github.com/developmentseed/lonboard/issues/314), and we could definitely come up with something if there's interest.", "I've created https://github.com/huggingface/datasets-server/issues/2416 to discuss the possibility of supporting (vectorial) geospatial columns in the dataset viewer, or in the converted parquet files.\r\n\r\nAt the same time, it would be super interesting to see what is already possible to do with a Hugging Face dataset that hosts geospatial data. \r\n\r\n> Some of my colleagues are working on streamlining GeoParquet visualization from cloud-hosted instances like HuggingFace (see e.g. https://github.com/developmentseed/lonboard/issues/314), and we could definitely come up with something if there's interest.\r\n\r\nIt would be awesome to show this inside a [Space](https://huggingface.co/docs/hub/spaces)." ]
2023-11-20T11:54:58
2024-02-07T08:36:51
null
CONTRIBUTOR
null
null
null
### Feature request Support the GeoParquet format ### Motivation GeoParquet (https://geoparquet.org/) is a common format for sharing vectorial geospatial data on the cloud, along with "traditional" data columns. It would be nice to be able to load this format with datasets, and more generally, in the Datasets Hub (see https://huggingface.co/datasets/joshuasundance/govgis_nov2023-slim-spatial/discussions/1). ### Your contribution I would be happy to help work on a PR (but I don't think I can do one on my own). Also, we have to define what we want to support: - load all the columns, but get the "geospatial" column in text-only mode for now - or, fully support the spatial features, maybe taking inspiration from (or depending upon) https://geopandas.org/en/stable/index.html (which itself depends on https://fiona.readthedocs.io/en/stable/, which requires a local install of https://gdal.org/)
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6438/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6438/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6437
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6437/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6437/comments
https://api.github.com/repos/huggingface/datasets/issues/6437/events
https://github.com/huggingface/datasets/issues/6437
2,001,272,606
I_kwDODunzps53SP8e
6,437
Problem in training iterable dataset
{ "login": "21Timothy", "id": 38107672, "node_id": "MDQ6VXNlcjM4MTA3Njcy", "avatar_url": "https://avatars.githubusercontent.com/u/38107672?v=4", "gravatar_id": "", "url": "https://api.github.com/users/21Timothy", "html_url": "https://github.com/21Timothy", "followers_url": "https://api.github.com/users/21Timothy/followers", "following_url": "https://api.github.com/users/21Timothy/following{/other_user}", "gists_url": "https://api.github.com/users/21Timothy/gists{/gist_id}", "starred_url": "https://api.github.com/users/21Timothy/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/21Timothy/subscriptions", "organizations_url": "https://api.github.com/users/21Timothy/orgs", "repos_url": "https://api.github.com/users/21Timothy/repos", "events_url": "https://api.github.com/users/21Timothy/events{/privacy}", "received_events_url": "https://api.github.com/users/21Timothy/received_events", "type": "User", "site_admin": false }
[]
open
false
null
[]
null
[ "Has anyone ever encountered this problem before?", "`split_dataset_by_node` doesn't give the exact same number of examples to each node in the case of iterable datasets, though it tries to be as equal as possible. In particular if your dataset is sharded and you have a number of shards that is a factor of the number of workers, then the shards will be evenly distributed among workers. If the shards don't contain the same number of examples, then some workers might end up with more examples than others.\r\n\r\nHowever if you use a Dataset you'll end up with the same amount of data, because we know the length of the dataset we can split it exactly where we want. Also Dataset objects don't load the full dataset in memory; instead it memory maps Arrow files from disk." ]
2023-11-20T03:04:02
2023-11-29T11:11:15
null
NONE
null
null
null
### Describe the bug I am using PyTorch DDP (Distributed Data Parallel) to train my model. Since the data is too large to load into memory at once, I am using load_dataset to read the data as an iterable dataset. I have used datasets.distributed.split_dataset_by_node to distribute the dataset. However, I have noticed that this distribution results in different processes having different amounts of data to train on. As a result, when the earliest process finishes training and starts predicting on the test set, other processes are still training, causing the overall training speed to be very slow. ### Steps to reproduce the bug ``` def train(args, model, device, train_loader, optimizer, criterion, epoch, length): model.train() idx_length = 0 for batch_idx, data in enumerate(train_loader): s_time = time.time() X = data['X'] target = data['y'].reshape(-1, 28) X, target = X.to(device), target.to(device) optimizer.zero_grad() output = model(X) loss = criterion(output, target) loss.backward() optimizer.step() idx_length += 1 if batch_idx % args.log_interval == 0: # print('Train Epoch: {} Batch_idx: {} Process: {} [{}/{} ({:.0f}%)]\tLoss: {:.6f}'.format( # epoch, batch_idx, torch.distributed.get_rank(), batch_idx * len(X), length / torch.distributed.get_world_size(), # 100. * batch_idx * len( # X) * torch.distributed.get_world_size() / length, loss.item())) print('Train Epoch: {} Batch_idx: {} Process: {} [{}/{} ({:.0f}%)]\t'.format( epoch, batch_idx, torch.distributed.get_rank(), batch_idx * len(X), length / torch.distributed.get_world_size(), 100. * batch_idx * len( X) * torch.distributed.get_world_size() / length)) if args.dry_run: break print('Process %s length: %s time: %s' % (torch.distributed.get_rank(), idx_length, datetime.datetime.now())) train_iterable_dataset = load_dataset("parquet", data_files=data_files, split="train", streaming=True) test_iterable_dataset = load_dataset("parquet", data_files=data_files, split="test", streaming=True) train_iterable_dataset = train_iterable_dataset.map(process_fn) test_iterable_dataset = test_iterable_dataset.map(process_fn) train_iterable_dataset = train_iterable_dataset.map(scale) test_iterable_dataset = test_iterable_dataset.map(scale) train_iterable_dataset = datasets.distributed.split_dataset_by_node(train_iterable_dataset, world_size=world_size, rank=local_rank).shuffle(seed=1234) test_iterable_dataset = datasets.distributed.split_dataset_by_node(test_iterable_dataset, world_size=world_size, rank=local_rank).shuffle(seed=1234) print(torch.distributed.get_rank(), train_iterable_dataset.n_shards, test_iterable_dataset.n_shards) train_kwargs = {'batch_size': args.batch_size} test_kwargs = {'batch_size': args.test_batch_size} if use_cuda: cuda_kwargs = {'num_workers': 3,#ngpus_per_node, 'pin_memory': True, 'shuffle': False} train_kwargs.update(cuda_kwargs) test_kwargs.update(cuda_kwargs) train_loader = torch.utils.data.DataLoader(train_iterable_dataset, **train_kwargs, # sampler=torch.utils.data.distributed.DistributedSampler( # train_iterable_dataset, # num_replicas=ngpus_per_node, # rank=0) ) test_loader = torch.utils.data.DataLoader(test_iterable_dataset, **test_kwargs, # sampler=torch.utils.data.distributed.DistributedSampler( # test_iterable_dataset, # num_replicas=ngpus_per_node, # rank=0) ) for epoch in range(1, args.epochs + 1): start_time = time.time() train_iterable_dataset.set_epoch(epoch) test_iterable_dataset.set_epoch(epoch) train(args, model, device, train_loader, optimizer, criterion, epoch, train_len) test(args, model, device, criterion2, test_loader) ``` And here’s the part of output: ``` Train Epoch: 1 Batch_idx: 5000 Process: 0 [320000/4710975.0 (7%)] Train Epoch: 1 Batch_idx: 5000 Process: 1 [320000/4710975.0 (7%)] Train Epoch: 1 Batch_idx: 5000 Process: 2 [320000/4710975.0 (7%)] Train Epoch: 1 Batch_idx: 5862 Process: 3 Data_length: 12 coststime: 0.04095172882080078 Train Epoch: 1 Batch_idx: 5862 Process: 0 Data_length: 3 coststime: 0.0751960277557373 Train Epoch: 1 Batch_idx: 5867 Process: 3 Data_length: 49 coststime: 0.0032558441162109375 Train Epoch: 1 Batch_idx: 5872 Process: 1 Data_length: 2 coststime: 0.022842884063720703 Train Epoch: 1 Batch_idx: 5876 Process: 3 Data_length: 63 coststime: 0.002694845199584961 Process 3 length: 5877 time: 2023-11-17 17:03:26.582317 Train epoch 1 costTime: 241.72063446044922s . Process 3 Start to test. 3 0 tensor(45508.8516, device='cuda:3') 3 100 tensor(45309.0469, device='cuda:3') 3 200 tensor(45675.3047, device='cuda:3') 3 300 tensor(45263.0273, device='cuda:3') Process 3 Reduce metrics. Train Epoch: 2 Batch_idx: 0 Process: 3 [0/4710975.0 (0%)] Train Epoch: 1 Batch_idx: 5882 Process: 1 Data_length: 63 coststime: 0.05185818672180176 Train Epoch: 1 Batch_idx: 5887 Process: 1 Data_length: 12 coststime: 0.006895303726196289 Process 1 length: 5888 time: 2023-11-17 17:20:48.578204 Train epoch 1 costTime: 1285.7279663085938s . Process 1 Start to test. 1 0 tensor(45265.9141, device='cuda:1') ``` ### Expected behavior I'd like to know how to fix this problem. ### Environment info ``` torch==2.0 datasets==2.14.0 ```
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6437/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6437/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6436
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6436/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6436/comments
https://api.github.com/repos/huggingface/datasets/issues/6436/events
https://github.com/huggingface/datasets/issues/6436
2,000,844,474
I_kwDODunzps53Qna6
6,436
TypeError: <lambda>() takes 0 positional arguments but 1 was given
{ "login": "ahmadmustafaanis", "id": 47111429, "node_id": "MDQ6VXNlcjQ3MTExNDI5", "avatar_url": "https://avatars.githubusercontent.com/u/47111429?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ahmadmustafaanis", "html_url": "https://github.com/ahmadmustafaanis", "followers_url": "https://api.github.com/users/ahmadmustafaanis/followers", "following_url": "https://api.github.com/users/ahmadmustafaanis/following{/other_user}", "gists_url": "https://api.github.com/users/ahmadmustafaanis/gists{/gist_id}", "starred_url": "https://api.github.com/users/ahmadmustafaanis/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ahmadmustafaanis/subscriptions", "organizations_url": "https://api.github.com/users/ahmadmustafaanis/orgs", "repos_url": "https://api.github.com/users/ahmadmustafaanis/repos", "events_url": "https://api.github.com/users/ahmadmustafaanis/events{/privacy}", "received_events_url": "https://api.github.com/users/ahmadmustafaanis/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "This looks like a problem with your environment rather than `datasets`." ]
2023-11-19T13:10:20
2023-11-29T16:28:34
2023-11-29T16:28:34
NONE
null
null
null
### Describe the bug ``` --------------------------------------------------------------------------- TypeError Traceback (most recent call last) [<ipython-input-35-7b6becee3685>](https://localhost:8080/#) in <cell line: 1>() ----> 1 from datasets import Dataset 9 frames [/usr/local/lib/python3.10/dist-packages/datasets/__init__.py](https://localhost:8080/#) in <module> 20 __version__ = "2.15.0" 21 ---> 22 from .arrow_dataset import Dataset 23 from .arrow_reader import ReadInstruction 24 from .builder import ArrowBasedBuilder, BeamBasedBuilder, BuilderConfig, DatasetBuilder, GeneratorBasedBuilder [/usr/local/lib/python3.10/dist-packages/datasets/arrow_dataset.py](https://localhost:8080/#) in <module> 61 import pyarrow.compute as pc 62 from huggingface_hub import CommitOperationAdd, CommitOperationDelete, DatasetCard, DatasetCardData, HfApi ---> 63 from multiprocess import Pool 64 from requests import HTTPError 65 [/usr/local/lib/python3.10/dist-packages/multiprocess/__init__.py](https://localhost:8080/#) in <module> 31 32 import sys ---> 33 from . import context 34 35 # [/usr/local/lib/python3.10/dist-packages/multiprocess/context.py](https://localhost:8080/#) in <module> 4 5 from . import process ----> 6 from . import reduction 7 8 __all__ = () [/usr/local/lib/python3.10/dist-packages/multiprocess/reduction.py](https://localhost:8080/#) in <module> 14 import os 15 try: ---> 16 import dill as pickle 17 except ImportError: 18 import pickle [/usr/local/lib/python3.10/dist-packages/dill/__init__.py](https://localhost:8080/#) in <module> 24 25 ---> 26 from ._dill import ( 27 dump, dumps, load, loads, copy, 28 Pickler, Unpickler, register, pickle, pickles, check, [/usr/local/lib/python3.10/dist-packages/dill/_dill.py](https://localhost:8080/#) in <module> 166 try: 167 from _pyio import open as _open --> 168 PyTextWrapperType = get_file_type('r', buffering=-1, open=_open) 169 PyBufferedRandomType = get_file_type('r+b', buffering=-1, open=_open) 170 PyBufferedReaderType = get_file_type('rb', buffering=-1, open=_open) [/usr/local/lib/python3.10/dist-packages/dill/_dill.py](https://localhost:8080/#) in get_file_type(*args, **kwargs) 154 def get_file_type(*args, **kwargs): 155 open = kwargs.pop("open", __builtin__.open) --> 156 f = open(os.devnull, *args, **kwargs) 157 t = type(f) 158 f.close() [/usr/lib/python3.10/_pyio.py](https://localhost:8080/#) in open(file, mode, buffering, encoding, errors, newline, closefd, opener) 280 return result 281 encoding = text_encoding(encoding) --> 282 text = TextIOWrapper(buffer, encoding, errors, newline, line_buffering) 283 result = text 284 text.mode = mode [/usr/lib/python3.10/_pyio.py](https://localhost:8080/#) in __init__(self, buffer, encoding, errors, newline, line_buffering, write_through) 2043 encoding = "utf-8" 2044 else: -> 2045 encoding = locale.getpreferredencoding(False) 2046 2047 if not isinstance(encoding, str): TypeError: <lambda>() takes 0 positional arguments but 1 was given ``` or ``` --------------------------------------------------------------------------- TypeError Traceback (most recent call last) [<ipython-input-36-652e886d387f>](https://localhost:8080/#) in <cell line: 1>() ----> 1 import datasets 9 frames [/usr/local/lib/python3.10/dist-packages/datasets/__init__.py](https://localhost:8080/#) in <module> 20 __version__ = "2.15.0" 21 ---> 22 from .arrow_dataset import Dataset 23 from .arrow_reader import ReadInstruction 24 from .builder import ArrowBasedBuilder, BeamBasedBuilder, BuilderConfig, DatasetBuilder, GeneratorBasedBuilder [/usr/local/lib/python3.10/dist-packages/datasets/arrow_dataset.py](https://localhost:8080/#) in <module> 61 import pyarrow.compute as pc 62 from huggingface_hub import CommitOperationAdd, CommitOperationDelete, DatasetCard, DatasetCardData, HfApi ---> 63 from multiprocess import Pool 64 from requests import HTTPError 65 [/usr/local/lib/python3.10/dist-packages/multiprocess/__init__.py](https://localhost:8080/#) in <module> 31 32 import sys ---> 33 from . import context 34 35 # [/usr/local/lib/python3.10/dist-packages/multiprocess/context.py](https://localhost:8080/#) in <module> 4 5 from . import process ----> 6 from . import reduction 7 8 __all__ = () [/usr/local/lib/python3.10/dist-packages/multiprocess/reduction.py](https://localhost:8080/#) in <module> 14 import os 15 try: ---> 16 import dill as pickle 17 except ImportError: 18 import pickle [/usr/local/lib/python3.10/dist-packages/dill/__init__.py](https://localhost:8080/#) in <module> 24 25 ---> 26 from ._dill import ( 27 dump, dumps, load, loads, copy, 28 Pickler, Unpickler, register, pickle, pickles, check, [/usr/local/lib/python3.10/dist-packages/dill/_dill.py](https://localhost:8080/#) in <module> 166 try: 167 from _pyio import open as _open --> 168 PyTextWrapperType = get_file_type('r', buffering=-1, open=_open) 169 PyBufferedRandomType = get_file_type('r+b', buffering=-1, open=_open) 170 PyBufferedReaderType = get_file_type('rb', buffering=-1, open=_open) [/usr/local/lib/python3.10/dist-packages/dill/_dill.py](https://localhost:8080/#) in get_file_type(*args, **kwargs) 154 def get_file_type(*args, **kwargs): 155 open = kwargs.pop("open", __builtin__.open) --> 156 f = open(os.devnull, *args, **kwargs) 157 t = type(f) 158 f.close() [/usr/lib/python3.10/_pyio.py](https://localhost:8080/#) in open(file, mode, buffering, encoding, errors, newline, closefd, opener) 280 return result 281 encoding = text_encoding(encoding) --> 282 text = TextIOWrapper(buffer, encoding, errors, newline, line_buffering) 283 result = text 284 text.mode = mode [/usr/lib/python3.10/_pyio.py](https://localhost:8080/#) in __init__(self, buffer, encoding, errors, newline, line_buffering, write_through) 2043 encoding = "utf-8" 2044 else: -> 2045 encoding = locale.getpreferredencoding(False) 2046 2047 if not isinstance(encoding, str): TypeError: <lambda>() takes 0 positional arguments but 1 was given ``` ### Steps to reproduce the bug `import datasets` on colab ### Expected behavior work fine ### Environment info colab `!pip install datasets`
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6436/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6436/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6435
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6435/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6435/comments
https://api.github.com/repos/huggingface/datasets/issues/6435/events
https://github.com/huggingface/datasets/issues/6435
2,000,690,513
I_kwDODunzps53QB1R
6,435
Cannot re-initialize CUDA in forked subprocess. To use CUDA with multiprocessing, you must use the 'spawn' start method
{ "login": "kopyl", "id": 17604849, "node_id": "MDQ6VXNlcjE3NjA0ODQ5", "avatar_url": "https://avatars.githubusercontent.com/u/17604849?v=4", "gravatar_id": "", "url": "https://api.github.com/users/kopyl", "html_url": "https://github.com/kopyl", "followers_url": "https://api.github.com/users/kopyl/followers", "following_url": "https://api.github.com/users/kopyl/following{/other_user}", "gists_url": "https://api.github.com/users/kopyl/gists{/gist_id}", "starred_url": "https://api.github.com/users/kopyl/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kopyl/subscriptions", "organizations_url": "https://api.github.com/users/kopyl/orgs", "repos_url": "https://api.github.com/users/kopyl/repos", "events_url": "https://api.github.com/users/kopyl/events{/privacy}", "received_events_url": "https://api.github.com/users/kopyl/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "[This doc section](https://huggingface.co/docs/datasets/main/en/process#multiprocessing) explains how to modify the script to avoid this error.", "@mariosasko thank you very much, i'll check it", "@mariosasko no it does not\r\n\r\n`Dataset.filter() got an unexpected keyword argument 'with_rank'`" ]
2023-11-19T04:21:16
2024-01-27T17:14:20
2023-12-04T16:57:43
NONE
null
null
null
### Describe the bug 1. I ran dataset mapping with `num_proc=6` in it and got this error: `RuntimeError: Cannot re-initialize CUDA in forked subprocess. To use CUDA with multiprocessing, you must use the 'spawn' start method` I can't actually find a way to run multi-GPU dataset mapping. Can you help? ### Steps to reproduce the bug 1. Rund SDXL training with `num_proc=6`: https://github.com/huggingface/diffusers/blob/main/examples/text_to_image/train_text_to_image_sdxl.py ### Expected behavior Should work well ### Environment info 6x A100 SXM, Linux
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6435/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6435/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6432
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6432/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6432/comments
https://api.github.com/repos/huggingface/datasets/issues/6432/events
https://github.com/huggingface/datasets/issues/6432
1,999,258,140
I_kwDODunzps53KkIc
6,432
load_dataset does not load all of the data in my input file
{ "login": "demongolem-biz2", "id": 121301001, "node_id": "U_kgDOBzroCQ", "avatar_url": "https://avatars.githubusercontent.com/u/121301001?v=4", "gravatar_id": "", "url": "https://api.github.com/users/demongolem-biz2", "html_url": "https://github.com/demongolem-biz2", "followers_url": "https://api.github.com/users/demongolem-biz2/followers", "following_url": "https://api.github.com/users/demongolem-biz2/following{/other_user}", "gists_url": "https://api.github.com/users/demongolem-biz2/gists{/gist_id}", "starred_url": "https://api.github.com/users/demongolem-biz2/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/demongolem-biz2/subscriptions", "organizations_url": "https://api.github.com/users/demongolem-biz2/orgs", "repos_url": "https://api.github.com/users/demongolem-biz2/repos", "events_url": "https://api.github.com/users/demongolem-biz2/events{/privacy}", "received_events_url": "https://api.github.com/users/demongolem-biz2/received_events", "type": "User", "site_admin": false }
[]
open
false
null
[]
null
[ "You should use `datasets.load_dataset` instead of `nlp.load_dataset`, as the `nlp` package is outdated.\r\n\r\nIf switching to `datasets.load_dataset` doesn't fix the issue, sharing the JSON file (feel free to replace the data with dummy data) would be nice so that we can reproduce it ourselves." ]
2023-11-17T14:28:50
2023-11-22T17:34:58
null
NONE
null
null
null
### Describe the bug I have 127 elements in my input dataset. When I do a len on the dataset after loaded, it is only 124 elements. ### Steps to reproduce the bug train_dataset = nlp.load_dataset(data_args.dataset_path, name=data_args.qg_format, split=nlp.Split.TRAIN) valid_dataset = nlp.load_dataset(data_args.dataset_path, name=data_args.qg_format, split=nlp.Split.VALIDATION) logger.info(len(train_dataset)) logger.info(len(valid_dataset)) Both train and valid input are 127 items. However, they both only load 124 items. The input format is in json. At the end of the day, I am trying to create .pt files. ### Expected behavior I see all 127 elements in my dataset when performing len ### Environment info Python 3.10. CentOS operating system. nlp==0.40, datasets==2.14.5, transformers==4.26.1
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6432/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6432/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6422
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6422/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6422/comments
https://api.github.com/repos/huggingface/datasets/issues/6422/events
https://github.com/huggingface/datasets/issues/6422
1,994,579,267
I_kwDODunzps524t1D
6,422
Allow to choose the `writer_batch_size` when using `save_to_disk`
{ "login": "NathanGodey", "id": 38216711, "node_id": "MDQ6VXNlcjM4MjE2NzEx", "avatar_url": "https://avatars.githubusercontent.com/u/38216711?v=4", "gravatar_id": "", "url": "https://api.github.com/users/NathanGodey", "html_url": "https://github.com/NathanGodey", "followers_url": "https://api.github.com/users/NathanGodey/followers", "following_url": "https://api.github.com/users/NathanGodey/following{/other_user}", "gists_url": "https://api.github.com/users/NathanGodey/gists{/gist_id}", "starred_url": "https://api.github.com/users/NathanGodey/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/NathanGodey/subscriptions", "organizations_url": "https://api.github.com/users/NathanGodey/orgs", "repos_url": "https://api.github.com/users/NathanGodey/repos", "events_url": "https://api.github.com/users/NathanGodey/events{/privacy}", "received_events_url": "https://api.github.com/users/NathanGodey/received_events", "type": "User", "site_admin": false }
[ { "id": 1935892871, "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement", "name": "enhancement", "color": "a2eeef", "default": true, "description": "New feature or request" } ]
open
false
null
[]
null
[ "We have a config variable that controls the batch size in `save_to_disk`:\r\n```python\r\nimport datasets\r\ndatasets.config.DEFAULT_MAX_BATCH_SIZE = <smaller_batch_size>\r\n...\r\nds.save_to_disk(...)\r\n```", "Thank you for your answer!\r\n\r\nFrom what I am reading in `https://github.com/huggingface/datasets/blob/2.14.5/src/datasets/arrow_dataset.py`, every function involved (`select`, `shard`, ...) has a default hardcoded batch size of 1000, as such:\r\n```python\r\ndef select(\r\n self,\r\n indices: Iterable,\r\n keep_in_memory: bool = False,\r\n indices_cache_file_name: Optional[str] = None,\r\n writer_batch_size: Optional[int] = 1000,\r\n new_fingerprint: Optional[str] = None,\r\n ) -> \"Dataset\":\r\n...\r\n```\r\nThen, `ArrowWriter` is instantiated with the specified `writer_batch_size`. In `ArrowWriter`, `writer_batch_size` is set to `datasets.config.DEFAULT_MAX_BATCH_SIZE` if it is `None`(https://github.com/huggingface/datasets/blob/main/src/datasets/arrow_writer.py#L345C14-L345C31). However, in our case, it is already set to 1000 by \"parent\" methods, so it won't happen.\r\n\r\nNevertheless, due to this: \r\n```python\r\ndef _save_to_disk_single(job_id: int, shard: \"Dataset\", fpath: str, storage_options: Optional[dict]):\r\n batch_size = config.DEFAULT_MAX_BATCH_SIZE\r\n...\r\n```\r\nit seems to work. I will use it as such, but it should maybe be added to documentation? And maybe improved in next versions?" ]
2023-11-15T11:18:34
2023-11-16T10:00:21
null
NONE
null
null
null
### Feature request Add an argument in `save_to_disk` regarding batch size, which would be passed to `shard` and other methods. ### Motivation The `Dataset.save_to_disk` method currently calls `shard` without passing a `writer_batch_size` argument, thus implicitly using the default value (1000). This can result in RAM saturation when using a lot of processes on long text sequences or other modalities, or for specific IO configs. ### Your contribution I would be glad to submit a PR, as long as it does not imply extensive tests refactoring.
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6422/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6422/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6417
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6417/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6417/comments
https://api.github.com/repos/huggingface/datasets/issues/6417/events
https://github.com/huggingface/datasets/issues/6417
1,993,149,416
I_kwDODunzps52zQvo
6,417
Bug: LayoutLMv3 finetuning on FUNSD Notebook; Arrow Error
{ "login": "Davo00", "id": 57496007, "node_id": "MDQ6VXNlcjU3NDk2MDA3", "avatar_url": "https://avatars.githubusercontent.com/u/57496007?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Davo00", "html_url": "https://github.com/Davo00", "followers_url": "https://api.github.com/users/Davo00/followers", "following_url": "https://api.github.com/users/Davo00/following{/other_user}", "gists_url": "https://api.github.com/users/Davo00/gists{/gist_id}", "starred_url": "https://api.github.com/users/Davo00/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Davo00/subscriptions", "organizations_url": "https://api.github.com/users/Davo00/orgs", "repos_url": "https://api.github.com/users/Davo00/repos", "events_url": "https://api.github.com/users/Davo00/events{/privacy}", "received_events_url": "https://api.github.com/users/Davo00/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "Very strange: `datasets-cli env`\r\n> \r\n> Copy-and-paste the text below in your GitHub issue.\r\n> \r\n> - `datasets` version: 2.9.0\r\n> - Platform: macOS-14.0-arm64-arm-64bit\r\n> - Python version: 3.9.13\r\n> - PyArrow version: 8.0.0\r\n> - Pandas version: 1.3.5\r\n\r\nAfter updating datasets and pyarrow on base environment, although I am using a different one called layoutLM\r\n\r\n> Copy-and-paste the text below in your GitHub issue.\r\n> \r\n> - `datasets` version: 2.14.6\r\n> - Platform: macOS-14.0-arm64-arm-64bit\r\n> - Python version: 3.9.18\r\n> - Huggingface_hub version: 0.17.3\r\n> - PyArrow version: 14.0.1\r\n> - Pandas version: 2.1.3", "Hi! The latest (patch) release (published a few hours ago) includes a fix for this [PyArrow security issue](https://github.com/advisories/GHSA-5wvp-7f3h-6wmm). To install it, run `pip install -U datasets`.", "> Hi! The latest (patch) release (published a few hours ago) includes a fix for this [PyArrow security issue](https://github.com/advisories/GHSA-5wvp-7f3h-6wmm). To install it, run `pip install -U datasets`.\r\n\r\nThanks for the info and the latest release, it seems this has also solved my issue. First run after the update worked and I am training right now :D\r\nWill close the Issu" ]
2023-11-14T16:53:20
2023-11-16T20:23:41
2023-11-16T20:23:41
NONE
null
null
null
### Describe the bug Arrow issues when running the example Notebook laptop locally on Mac with M1. Works on Google Collab. **Notebook**: https://github.com/NielsRogge/Transformers-Tutorials/blob/master/LayoutLMv3/Fine_tune_LayoutLMv3_on_FUNSD_(HuggingFace_Trainer).ipynb **Error**: `ValueError: Arrow type extension<arrow.py_extension_type<pyarrow.lib.UnknownExtensionType>> does not have a datasets dtype equivalent.` **Caused by**: ``` # we need to define custom features for `set_format` (used later on) to work properly features = Features({ 'pixel_values': Array3D(dtype="float32", shape=(3, 224, 224)), 'input_ids': Sequence(feature=Value(dtype='int64')), 'attention_mask': Sequence(Value(dtype='int64')), 'bbox': Array2D(dtype="int64", shape=(512, 4)), 'labels': Sequence(feature=Value(dtype='int64')), }) ``` ### Steps to reproduce the bug Run the notebook provided, locally. If possible also on M1. ### Expected behavior The cell where features are mapped to Array2D and Array3D should work without any issues. ### Environment info Tried with Python 3.9 and 3.10 conda envs. Running Mac M1. `pip show datasets` > Name: datasets Version: 2.14.6 Summary: HuggingFace community-driven open-source library of datasets `pip list` > Package Version > ------------------------- ------------ > accelerate 0.24.1 > aiohttp 3.8.6 > aiosignal 1.3.1 > anyio 3.5.0 > appnope 0.1.2 > argon2-cffi 21.3.0 > argon2-cffi-bindings 21.2.0 > asttokens 2.0.5 > async-timeout 4.0.3 > attrs 23.1.0 > backcall 0.2.0 > beautifulsoup4 4.12.2 > bleach 4.1.0 > certifi 2023.7.22 > cffi 1.15.1 > charset-normalizer 3.3.2 > comm 0.1.2 > datasets 2.14.6 > debugpy 1.6.7 > decorator 5.1.1 > defusedxml 0.7.1 > dill 0.3.7 > entrypoints 0.4 > exceptiongroup 1.0.4 > executing 0.8.3 > fastjsonschema 2.16.2 > filelock 3.13.1 > frozenlist 1.4.0 > fsspec 2023.10.0 > huggingface-hub 0.17.3 > idna 3.4 > importlib-metadata 6.0.0 > IProgress 0.4 > ipykernel 6.25.0 > ipython 8.15.0 > ipython-genutils 0.2.0 > jedi 0.18.1 > Jinja2 3.1.2 > joblib 1.3.2 > jsonschema 4.19.2 > jsonschema-specifications 2023.7.1 > jupyter_client 7.4.9 > jupyter_core 5.5.0 > jupyter-server 1.23.4 > jupyterlab-pygments 0.1.2 > MarkupSafe 2.1.1 > matplotlib-inline 0.1.6 > mistune 2.0.4 > mpmath 1.3.0 > multidict 6.0.4 > multiprocess 0.70.15 > nbclassic 1.0.0 > nbclient 0.8.0 > nbconvert 7.10.0 > nbformat 5.9.2 > nest-asyncio 1.5.6 > networkx 3.2.1 > notebook 6.5.4 > notebook_shim 0.2.3 > numpy 1.26.1 > packaging 23.1 > pandas 2.1.3 > pandocfilters 1.5.0 > parso 0.8.3 > pexpect 4.8.0 > pickleshare 0.7.5 > Pillow 10.1.0 > pip 23.3 > platformdirs 3.10.0 > prometheus-client 0.14.1 > prompt-toolkit 3.0.36 > psutil 5.9.0 > ptyprocess 0.7.0 > pure-eval 0.2.2 > pyarrow 14.0.1 > pycparser 2.21 > Pygments 2.15.1 > python-dateutil 2.8.2 > pytz 2023.3.post1 > PyYAML 6.0.1 > pyzmq 23.2.0 > referencing 0.30.2 > regex 2023.10.3 > requests 2.31.0 > rpds-py 0.10.6 > safetensors 0.4.0 > scikit-learn 1.3.2 > scipy 1.11.3 > Send2Trash 1.8.2 > seqeval 1.2.2 > setuptools 68.0.0 > six 1.16.0 > sniffio 1.2.0 > soupsieve 2.5 > stack-data 0.2.0 > sympy 1.12 > terminado 0.17.1 > threadpoolctl 3.2.0 > tinycss2 1.2.1 > tokenizers 0.14.1 > torch 2.1.0 > tornado 6.3.3 > tqdm 4.66.1 > traitlets 5.7.1 > transformers 4.36.0.dev0 > typing_extensions 4.7.1 > tzdata 2023.3 > urllib3 2.0.7 > wcwidth 0.2.5 > webencodings 0.5.1 > websocket-client 0.58.0 > wheel 0.41.2 > xxhash 3.4.1 > yarl 1.9.2 > zipp 3.11.0
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6417/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6417/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6412
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6412/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6412/comments
https://api.github.com/repos/huggingface/datasets/issues/6412/events
https://github.com/huggingface/datasets/issues/6412
1,992,401,594
I_kwDODunzps52waK6
6,412
User token is printed out!
{ "login": "mohsen-goodarzi", "id": 25702692, "node_id": "MDQ6VXNlcjI1NzAyNjky", "avatar_url": "https://avatars.githubusercontent.com/u/25702692?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mohsen-goodarzi", "html_url": "https://github.com/mohsen-goodarzi", "followers_url": "https://api.github.com/users/mohsen-goodarzi/followers", "following_url": "https://api.github.com/users/mohsen-goodarzi/following{/other_user}", "gists_url": "https://api.github.com/users/mohsen-goodarzi/gists{/gist_id}", "starred_url": "https://api.github.com/users/mohsen-goodarzi/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mohsen-goodarzi/subscriptions", "organizations_url": "https://api.github.com/users/mohsen-goodarzi/orgs", "repos_url": "https://api.github.com/users/mohsen-goodarzi/repos", "events_url": "https://api.github.com/users/mohsen-goodarzi/events{/privacy}", "received_events_url": "https://api.github.com/users/mohsen-goodarzi/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "Indeed, this is not a good practice. I've opened a PR that removes the token value from the (deprecation) warning." ]
2023-11-14T10:01:34
2023-11-14T22:19:46
2023-11-14T22:19:46
NONE
null
null
null
This line prints user token on command line! Is it safe? https://github.com/huggingface/datasets/blob/12ebe695b4748c5a26e08b44ed51955f74f5801d/src/datasets/load.py#L2091
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6412/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6412/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6410
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6410/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6410/comments
https://api.github.com/repos/huggingface/datasets/issues/6410/events
https://github.com/huggingface/datasets/issues/6410
1,992,100,209
I_kwDODunzps52vQlx
6,410
Datasets does not load HuggingFace Repository properly
{ "login": "MikeDoes", "id": 40600201, "node_id": "MDQ6VXNlcjQwNjAwMjAx", "avatar_url": "https://avatars.githubusercontent.com/u/40600201?v=4", "gravatar_id": "", "url": "https://api.github.com/users/MikeDoes", "html_url": "https://github.com/MikeDoes", "followers_url": "https://api.github.com/users/MikeDoes/followers", "following_url": "https://api.github.com/users/MikeDoes/following{/other_user}", "gists_url": "https://api.github.com/users/MikeDoes/gists{/gist_id}", "starred_url": "https://api.github.com/users/MikeDoes/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/MikeDoes/subscriptions", "organizations_url": "https://api.github.com/users/MikeDoes/orgs", "repos_url": "https://api.github.com/users/MikeDoes/repos", "events_url": "https://api.github.com/users/MikeDoes/events{/privacy}", "received_events_url": "https://api.github.com/users/MikeDoes/received_events", "type": "User", "site_admin": false }
[]
open
false
null
[]
null
[ "Hi! You can avoid the error by requesting only the `jsonl` files. `dataset = load_dataset(\"ai4privacy/pii-masking-200k\", data_files=[\"*.jsonl\"])`.\r\n\r\nOur data file inference does not filter out (incompatible) `json` files because `json` and `jsonl` use the same builder. Still, I think the inference should differentiate these extensions because it's safe to assume that loading them together will lead to an error. WDYT @lhoestq? ", "Raising an error if there is a mix of json and jsonl in the builder makes sense yea" ]
2023-11-14T06:50:49
2023-11-16T06:54:36
null
NONE
null
null
null
### Describe the bug Dear Datasets team, We just have published a dataset on Huggingface: https://huggingface.co/ai4privacy However, when trying to read it using the Dataset library we get an error. As I understand jsonl files are compatible, could you please clarify how we can solve the issue? Please let me know and we would be more than happy to adapt the structure of the repository or meta data so it works easier: ```python from datasets import load_dataset dataset = load_dataset("ai4privacy/pii-masking-200k") ``` ``` Downloading readme: 100% 11.8k/11.8k [00:00<00:00, 512kB/s] Downloading data files: 100% 1/1 [00:11<00:00, 11.16s/it] Downloading data: 100% 64.3M/64.3M [00:02<00:00, 32.9MB/s] Downloading data: 100% 113M/113M [00:03<00:00, 35.0MB/s] Downloading data: 100% 97.7M/97.7M [00:02<00:00, 46.1MB/s] Downloading data: 100% 90.8M/90.8M [00:02<00:00, 44.9MB/s] Downloading data: 100% 7.63k/7.63k [00:00<00:00, 41.0kB/s] Downloading data: 100% 1.03k/1.03k [00:00<00:00, 9.44kB/s] Extracting data files: 100% 1/1 [00:00<00:00, 29.26it/s] Generating train split: 209261/0 [00:05<00:00, 41201.25 examples/s] --------------------------------------------------------------------------- ValueError Traceback (most recent call last) [/usr/local/lib/python3.10/dist-packages/datasets/builder.py](https://localhost:8080/#) in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, job_id) 1939 ) -> 1940 writer.write_table(table) 1941 num_examples_progress_update += len(table) 8 frames [/usr/local/lib/python3.10/dist-packages/datasets/arrow_writer.py](https://localhost:8080/#) in write_table(self, pa_table, writer_batch_size) 571 pa_table = pa_table.combine_chunks() --> 572 pa_table = table_cast(pa_table, self._schema) 573 if self.embed_local_files: [/usr/local/lib/python3.10/dist-packages/datasets/table.py](https://localhost:8080/#) in table_cast(table, schema) 2327 if table.schema != schema: -> 2328 return cast_table_to_schema(table, schema) 2329 elif table.schema.metadata != schema.metadata: [/usr/local/lib/python3.10/dist-packages/datasets/table.py](https://localhost:8080/#) in cast_table_to_schema(table, schema) 2285 if sorted(table.column_names) != sorted(features): -> 2286 raise ValueError(f"Couldn't cast\n{table.schema}\nto\n{features}\nbecause column names don't match") 2287 arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] ValueError: Couldn't cast JOBTYPE: int64 PHONEIMEI: int64 ACCOUNTNAME: int64 VEHICLEVIN: int64 GENDER: int64 CURRENCYCODE: int64 CREDITCARDISSUER: int64 JOBTITLE: int64 SEX: int64 CURRENCYSYMBOL: int64 IP: int64 EYECOLOR: int64 MASKEDNUMBER: int64 SECONDARYADDRESS: int64 JOBAREA: int64 ACCOUNTNUMBER: int64 language: string BITCOINADDRESS: int64 MAC: int64 SSN: int64 EMAIL: int64 ETHEREUMADDRESS: int64 DOB: int64 VEHICLEVRM: int64 IPV6: int64 AMOUNT: int64 URL: int64 PHONENUMBER: int64 PIN: int64 TIME: int64 CREDITCARDNUMBER: int64 FIRSTNAME: int64 IBAN: int64 BIC: int64 COUNTY: int64 STATE: int64 LASTNAME: int64 ZIPCODE: int64 HEIGHT: int64 ORDINALDIRECTION: int64 MIDDLENAME: int64 STREET: int64 USERNAME: int64 CURRENCY: int64 PREFIX: int64 USERAGENT: int64 CURRENCYNAME: int64 LITECOINADDRESS: int64 CREDITCARDCVV: int64 AGE: int64 CITY: int64 PASSWORD: int64 BUILDINGNUMBER: int64 IPV4: int64 NEARBYGPSCOORDINATE: int64 DATE: int64 COMPANYNAME: int64 to {'masked_text': Value(dtype='string', id=None), 'unmasked_text': Value(dtype='string', id=None), 'privacy_mask': Value(dtype='string', id=None), 'span_labels': Value(dtype='string', id=None), 'bio_labels': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), 'tokenised_text': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None)} because column names don't match The above exception was the direct cause of the following exception: DatasetGenerationError Traceback (most recent call last) [<ipython-input-2-f1c6811e9c83>](https://localhost:8080/#) in <cell line: 3>() 1 from datasets import load_dataset 2 ----> 3 dataset = load_dataset("ai4privacy/pii-masking-200k") [/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) 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) 2151 2152 # Download and prepare data -> 2153 builder_instance.download_and_prepare( 2154 download_config=download_config, 2155 download_mode=download_mode, [/usr/local/lib/python3.10/dist-packages/datasets/builder.py](https://localhost:8080/#) in download_and_prepare(self, output_dir, download_config, download_mode, verification_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, num_proc, storage_options, **download_and_prepare_kwargs) 952 if num_proc is not None: 953 prepare_split_kwargs["num_proc"] = num_proc --> 954 self._download_and_prepare( 955 dl_manager=dl_manager, 956 verification_mode=verification_mode, [/usr/local/lib/python3.10/dist-packages/datasets/builder.py](https://localhost:8080/#) in _download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs) 1047 try: 1048 # Prepare split will record examples associated to the split -> 1049 self._prepare_split(split_generator, **prepare_split_kwargs) 1050 except OSError as e: 1051 raise OSError( [/usr/local/lib/python3.10/dist-packages/datasets/builder.py](https://localhost:8080/#) in _prepare_split(self, split_generator, file_format, num_proc, max_shard_size) 1811 job_id = 0 1812 with pbar: -> 1813 for job_id, done, content in self._prepare_split_single( 1814 gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args 1815 ): [/usr/local/lib/python3.10/dist-packages/datasets/builder.py](https://localhost:8080/#) in _prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, job_id) 1956 if isinstance(e, SchemaInferenceError) and e.__context__ is not None: 1957 e = e.__context__ -> 1958 raise DatasetGenerationError("An error occurred while generating the dataset") from e 1959 1960 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths) DatasetGenerationError: An error occurred while generating the dataset ``` Thank you and have a great day ahead ### Steps to reproduce the bug Open Google Colab Notebook: Run command: !pip3 install datasets Run code: from datasets import load_dataset dataset = load_dataset("ai4privacy/pii-masking-200k") ### Expected behavior Download the dataset successfully from HuggingFace to the notebook so that we can start working with it ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.15.120+-x86_64-with-glibc2.35 - Python version: 3.10.12 - Huggingface_hub version: 0.19.1 - PyArrow version: 9.0.0 - Pandas version: 1.5.3
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6410/reactions", "total_count": 2, "+1": 2, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6410/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6409
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6409/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6409/comments
https://api.github.com/repos/huggingface/datasets/issues/6409/events
https://github.com/huggingface/datasets/issues/6409
1,991,960,865
I_kwDODunzps52uukh
6,409
using DownloadManager to download from local filesystem and disable_progress_bar, there will be an exception
{ "login": "neiblegy", "id": 16574677, "node_id": "MDQ6VXNlcjE2NTc0Njc3", "avatar_url": "https://avatars.githubusercontent.com/u/16574677?v=4", "gravatar_id": "", "url": "https://api.github.com/users/neiblegy", "html_url": "https://github.com/neiblegy", "followers_url": "https://api.github.com/users/neiblegy/followers", "following_url": "https://api.github.com/users/neiblegy/following{/other_user}", "gists_url": "https://api.github.com/users/neiblegy/gists{/gist_id}", "starred_url": "https://api.github.com/users/neiblegy/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/neiblegy/subscriptions", "organizations_url": "https://api.github.com/users/neiblegy/orgs", "repos_url": "https://api.github.com/users/neiblegy/repos", "events_url": "https://api.github.com/users/neiblegy/events{/privacy}", "received_events_url": "https://api.github.com/users/neiblegy/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[]
2023-11-14T04:21:01
2023-11-22T16:42:09
2023-11-22T16:42:09
NONE
null
null
null
### Describe the bug i'm using datasets.download.download_manager.DownloadManager to download files like "file:///a/b/c.txt", and i disable_progress_bar() to disable bar. there will be an exception as follows: `AttributeError: 'function' object has no attribute 'close' Exception ignored in: <function TqdmCallback.__del__ at 0x7fa8683d84c0> Traceback (most recent call last): File "/home/protoss.gao/.local/lib/python3.9/site-packages/fsspec/callbacks.py", line 233, in __del__ self.tqdm.close()` i check your source code in datasets/utils/file_utils.py:348 you define TqdmCallback derive from fsspec.callbacks.TqdmCallback but in the newest fsspec code [https://github.com/fsspec/filesystem_spec/blob/master/fsspec/callbacks.py](url) , line 146, in this case, _DEFAULT_CALLBACK will take effect, but in line 234, it calls "close()" function which _DEFAULT_CALLBACK don't have such thing. so i think the class "TqdmCallback" in datasets/utils/file_utils.py may override "__del__" function or report this bug to fsspec. ### Steps to reproduce the bug as i said ### Expected behavior no exception ### Environment info datasets: 2.14.4 python: 3.9 platform: x86_64
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6409/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6409/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6408
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6408/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6408/comments
https://api.github.com/repos/huggingface/datasets/issues/6408/events
https://github.com/huggingface/datasets/issues/6408
1,991,902,972
I_kwDODunzps52ugb8
6,408
`IterableDataset` lost but not keep columns when map function adding columns with names in `remove_columns`
{ "login": "shmily326", "id": 24571857, "node_id": "MDQ6VXNlcjI0NTcxODU3", "avatar_url": "https://avatars.githubusercontent.com/u/24571857?v=4", "gravatar_id": "", "url": "https://api.github.com/users/shmily326", "html_url": "https://github.com/shmily326", "followers_url": "https://api.github.com/users/shmily326/followers", "following_url": "https://api.github.com/users/shmily326/following{/other_user}", "gists_url": "https://api.github.com/users/shmily326/gists{/gist_id}", "starred_url": "https://api.github.com/users/shmily326/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/shmily326/subscriptions", "organizations_url": "https://api.github.com/users/shmily326/orgs", "repos_url": "https://api.github.com/users/shmily326/repos", "events_url": "https://api.github.com/users/shmily326/events{/privacy}", "received_events_url": "https://api.github.com/users/shmily326/received_events", "type": "User", "site_admin": false }
[]
open
false
null
[]
null
[]
2023-11-14T03:12:08
2023-11-16T06:24:10
null
NONE
null
null
null
### Describe the bug IterableDataset lost but not keep columns when map function adding columns with names in remove_columns, Dataset not. May be related to the code below: https://github.com/huggingface/datasets/blob/06c3ffb8d068b6307b247164b10f7c7311cefed4/src/datasets/iterable_dataset.py#L750-L756 ### Steps to reproduce the bug ```python dataset: IterableDataset = load_dataset("Anthropic/hh-rlhf", streaming=True, split="train") column_names = list(next(iter(dataset)).keys()) # ['chosen', 'rejected'] # map_fn will return dict {"chosen": xxx, "rejected": xxx, "prompt": xxx, "history": xxxx} dataset = dataset.map(map_fn, batched=True, remove_columns=column_names) next(iter(dataset)) # output # {'prompt': 'xxx, 'history': xxx} ``` ```python # when load_dataset with streaming=False, the column_names are kept: dataset: Dataset = load_dataset("Anthropic/hh-rlhf", streaming=False, split="train") column_names = list(next(iter(dataset)).keys()) # ['chosen', 'rejected'] # map_fn will return dict {"chosen": xxx, "rejected": xxx, "prompt": xxx, "history": xxxx} dataset = dataset.map(map_fn, batched=True, remove_columns=column_names) next(iter(dataset)) # output # {'prompt': 'xxx, 'history': xxx, "chosen": xxx, "rejected": xxx} ``` ### Expected behavior IterableDataset keep columns when map function adding columns with names in remove_columns ### Environment info datasets==2.14.6
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6408/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6408/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6407
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6407/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6407/comments
https://api.github.com/repos/huggingface/datasets/issues/6407/events
https://github.com/huggingface/datasets/issues/6407
1,991,514,079
I_kwDODunzps52tBff
6,407
Loading the dataset from private S3 bucket gives "TypeError: cannot pickle '_contextvars.Context' object"
{ "login": "eawer", "id": 1741779, "node_id": "MDQ6VXNlcjE3NDE3Nzk=", "avatar_url": "https://avatars.githubusercontent.com/u/1741779?v=4", "gravatar_id": "", "url": "https://api.github.com/users/eawer", "html_url": "https://github.com/eawer", "followers_url": "https://api.github.com/users/eawer/followers", "following_url": "https://api.github.com/users/eawer/following{/other_user}", "gists_url": "https://api.github.com/users/eawer/gists{/gist_id}", "starred_url": "https://api.github.com/users/eawer/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/eawer/subscriptions", "organizations_url": "https://api.github.com/users/eawer/orgs", "repos_url": "https://api.github.com/users/eawer/repos", "events_url": "https://api.github.com/users/eawer/events{/privacy}", "received_events_url": "https://api.github.com/users/eawer/received_events", "type": "User", "site_admin": false }
[]
open
false
null
[]
null
[]
2023-11-13T21:27:43
2023-11-13T21:27:43
null
NONE
null
null
null
### Describe the bug I'm trying to read the parquet file from the private s3 bucket using the `load_dataset` function, but I receive `TypeError: cannot pickle '_contextvars.Context' object` error I'm working on a machine with `~/.aws/credentials` file. I can't give credentials and the path to a file in a private bucket for obvious reasons, but I'll try to give all possible outputs. ### Steps to reproduce the bug ```python import s3fs from datasets import load_dataset from aiobotocore.session import get_session DATA_PATH = "s3://bucket_name/path/validation.parquet" fs = s3fs.S3FileSystem(session=get_session()) ``` `fs.stat` returns the data, so we can say that fs is working and we have all permissions ```python fs.stat(DATA_PATH) # Returns: # {'ETag': '"123123a-19"', # 'LastModified': datetime.datetime(2023, 11, 1, 10, 16, 57, tzinfo=tzutc()), # 'size': 312237170, # 'name': 'bucket_name/path/validation.parquet', # 'type': 'file', # 'StorageClass': 'STANDARD', # 'VersionId': 'Abc.HtmsC9h.as', # 'ContentType': 'binary/octet-stream'} ``` ```python fs.storage_options # Returns: # {'session': <aiobotocore.session.AioSession at 0x7f9193fa53c0>} ``` ```python ds = load_dataset("parquet", data_files={"train": DATA_PATH}, storage_options=fs.storage_options) ``` <details> <summary>Returns such error (expandable)</summary> ```python --------------------------------------------------------------------------- TypeError Traceback (most recent call last) Cell In[88], line 1 ----> 1 ds = load_dataset("parquet", data_files={"train": DATA_PATH}, storage_options=fs.storage_options) File ~/miniconda3/envs/test-env/lib/python3.10/site-packages/datasets/load.py:2153, 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) 2150 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES 2152 # Download and prepare data -> 2153 builder_instance.download_and_prepare( 2154 download_config=download_config, 2155 download_mode=download_mode, 2156 verification_mode=verification_mode, 2157 try_from_hf_gcs=try_from_hf_gcs, 2158 num_proc=num_proc, 2159 storage_options=storage_options, 2160 ) 2162 # Build dataset for splits 2163 keep_in_memory = ( 2164 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size) 2165 ) File ~/miniconda3/envs/test-env/lib/python3.10/site-packages/datasets/builder.py:954, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, verification_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, num_proc, storage_options, **download_and_prepare_kwargs) 952 if num_proc is not None: 953 prepare_split_kwargs["num_proc"] = num_proc --> 954 self._download_and_prepare( 955 dl_manager=dl_manager, 956 verification_mode=verification_mode, 957 **prepare_split_kwargs, 958 **download_and_prepare_kwargs, 959 ) 960 # Sync info 961 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values()) File ~/miniconda3/envs/test-env/lib/python3.10/site-packages/datasets/builder.py:1027, in DatasetBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs) 1025 split_dict = SplitDict(dataset_name=self.dataset_name) 1026 split_generators_kwargs = self._make_split_generators_kwargs(prepare_split_kwargs) -> 1027 split_generators = self._split_generators(dl_manager, **split_generators_kwargs) 1029 # Checksums verification 1030 if verification_mode == VerificationMode.ALL_CHECKS and dl_manager.record_checksums: File ~/miniconda3/envs/test-env/lib/python3.10/site-packages/datasets/packaged_modules/parquet/parquet.py:34, in Parquet._split_generators(self, dl_manager) 32 if not self.config.data_files: 33 raise ValueError(f"At least one data file must be specified, but got data_files={self.config.data_files}") ---> 34 data_files = dl_manager.download_and_extract(self.config.data_files) 35 if isinstance(data_files, (str, list, tuple)): 36 files = data_files File ~/miniconda3/envs/test-env/lib/python3.10/site-packages/datasets/download/download_manager.py:565, in DownloadManager.download_and_extract(self, url_or_urls) 549 def download_and_extract(self, url_or_urls): 550 """Download and extract given `url_or_urls`. 551 552 Is roughly equivalent to: (...) 563 extracted_path(s): `str`, extracted paths of given URL(s). 564 """ --> 565 return self.extract(self.download(url_or_urls)) File ~/miniconda3/envs/test-env/lib/python3.10/site-packages/datasets/download/download_manager.py:420, in DownloadManager.download(self, url_or_urls) 401 def download(self, url_or_urls): 402 """Download given URL(s). 403 404 By default, only one process is used for download. Pass customized `download_config.num_proc` to change this behavior. (...) 418 ``` 419 """ --> 420 download_config = self.download_config.copy() 421 download_config.extract_compressed_file = False 422 if download_config.download_desc is None: File ~/miniconda3/envs/test-env/lib/python3.10/site-packages/datasets/download/download_config.py:94, in DownloadConfig.copy(self) 93 def copy(self) -> "DownloadConfig": ---> 94 return self.__class__(**{k: copy.deepcopy(v) for k, v in self.__dict__.items()}) File ~/miniconda3/envs/test-env/lib/python3.10/site-packages/datasets/download/download_config.py:94, in <dictcomp>(.0) 93 def copy(self) -> "DownloadConfig": ---> 94 return self.__class__(**{k: copy.deepcopy(v) for k, v in self.__dict__.items()}) File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:146, in deepcopy(x, memo, _nil) 144 copier = _deepcopy_dispatch.get(cls) 145 if copier is not None: --> 146 y = copier(x, memo) 147 else: 148 if issubclass(cls, type): File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:231, in _deepcopy_dict(x, memo, deepcopy) 229 memo[id(x)] = y 230 for key, value in x.items(): --> 231 y[deepcopy(key, memo)] = deepcopy(value, memo) 232 return y File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:172, in deepcopy(x, memo, _nil) 170 y = x 171 else: --> 172 y = _reconstruct(x, memo, *rv) 174 # If is its own copy, don't memoize. 175 if y is not x: File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:271, in _reconstruct(x, memo, func, args, state, listiter, dictiter, deepcopy) 269 if state is not None: 270 if deep: --> 271 state = deepcopy(state, memo) 272 if hasattr(y, '__setstate__'): 273 y.__setstate__(state) File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:146, in deepcopy(x, memo, _nil) 144 copier = _deepcopy_dispatch.get(cls) 145 if copier is not None: --> 146 y = copier(x, memo) 147 else: 148 if issubclass(cls, type): File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:231, in _deepcopy_dict(x, memo, deepcopy) 229 memo[id(x)] = y 230 for key, value in x.items(): --> 231 y[deepcopy(key, memo)] = deepcopy(value, memo) 232 return y File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:172, in deepcopy(x, memo, _nil) 170 y = x 171 else: --> 172 y = _reconstruct(x, memo, *rv) 174 # If is its own copy, don't memoize. 175 if y is not x: File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:271, in _reconstruct(x, memo, func, args, state, listiter, dictiter, deepcopy) 269 if state is not None: 270 if deep: --> 271 state = deepcopy(state, memo) 272 if hasattr(y, '__setstate__'): 273 y.__setstate__(state) [... skipping similar frames: _deepcopy_dict at line 231 (2 times), deepcopy at line 146 (2 times)] File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:172, in deepcopy(x, memo, _nil) 170 y = x 171 else: --> 172 y = _reconstruct(x, memo, *rv) 174 # If is its own copy, don't memoize. 175 if y is not x: File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:271, in _reconstruct(x, memo, func, args, state, listiter, dictiter, deepcopy) 269 if state is not None: 270 if deep: --> 271 state = deepcopy(state, memo) 272 if hasattr(y, '__setstate__'): 273 y.__setstate__(state) [... skipping similar frames: deepcopy at line 146 (1 times)] File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:231, in _deepcopy_dict(x, memo, deepcopy) 229 memo[id(x)] = y 230 for key, value in x.items(): --> 231 y[deepcopy(key, memo)] = deepcopy(value, memo) 232 return y File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:146, in deepcopy(x, memo, _nil) 144 copier = _deepcopy_dispatch.get(cls) 145 if copier is not None: --> 146 y = copier(x, memo) 147 else: 148 if issubclass(cls, type): File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:206, in _deepcopy_list(x, memo, deepcopy) 204 append = y.append 205 for a in x: --> 206 append(deepcopy(a, memo)) 207 return y File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:172, in deepcopy(x, memo, _nil) 170 y = x 171 else: --> 172 y = _reconstruct(x, memo, *rv) 174 # If is its own copy, don't memoize. 175 if y is not x: File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:271, in _reconstruct(x, memo, func, args, state, listiter, dictiter, deepcopy) 269 if state is not None: 270 if deep: --> 271 state = deepcopy(state, memo) 272 if hasattr(y, '__setstate__'): 273 y.__setstate__(state) File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:146, in deepcopy(x, memo, _nil) 144 copier = _deepcopy_dispatch.get(cls) 145 if copier is not None: --> 146 y = copier(x, memo) 147 else: 148 if issubclass(cls, type): File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:231, in _deepcopy_dict(x, memo, deepcopy) 229 memo[id(x)] = y 230 for key, value in x.items(): --> 231 y[deepcopy(key, memo)] = deepcopy(value, memo) 232 return y File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:146, in deepcopy(x, memo, _nil) 144 copier = _deepcopy_dispatch.get(cls) 145 if copier is not None: --> 146 y = copier(x, memo) 147 else: 148 if issubclass(cls, type): File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:238, in _deepcopy_method(x, memo) 237 def _deepcopy_method(x, memo): # Copy instance methods --> 238 return type(x)(x.__func__, deepcopy(x.__self__, memo)) File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:172, in deepcopy(x, memo, _nil) 170 y = x 171 else: --> 172 y = _reconstruct(x, memo, *rv) 174 # If is its own copy, don't memoize. 175 if y is not x: File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:271, in _reconstruct(x, memo, func, args, state, listiter, dictiter, deepcopy) 269 if state is not None: 270 if deep: --> 271 state = deepcopy(state, memo) 272 if hasattr(y, '__setstate__'): 273 y.__setstate__(state) File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:146, in deepcopy(x, memo, _nil) 144 copier = _deepcopy_dispatch.get(cls) 145 if copier is not None: --> 146 y = copier(x, memo) 147 else: 148 if issubclass(cls, type): File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:231, in _deepcopy_dict(x, memo, deepcopy) 229 memo[id(x)] = y 230 for key, value in x.items(): --> 231 y[deepcopy(key, memo)] = deepcopy(value, memo) 232 return y File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:146, in deepcopy(x, memo, _nil) 144 copier = _deepcopy_dispatch.get(cls) 145 if copier is not None: --> 146 y = copier(x, memo) 147 else: 148 if issubclass(cls, type): File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:231, in _deepcopy_dict(x, memo, deepcopy) 229 memo[id(x)] = y 230 for key, value in x.items(): --> 231 y[deepcopy(key, memo)] = deepcopy(value, memo) 232 return y File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:172, in deepcopy(x, memo, _nil) 170 y = x 171 else: --> 172 y = _reconstruct(x, memo, *rv) 174 # If is its own copy, don't memoize. 175 if y is not x: File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:271, in _reconstruct(x, memo, func, args, state, listiter, dictiter, deepcopy) 269 if state is not None: 270 if deep: --> 271 state = deepcopy(state, memo) 272 if hasattr(y, '__setstate__'): 273 y.__setstate__(state) [... skipping similar frames: _deepcopy_dict at line 231 (3 times), deepcopy at line 146 (3 times), deepcopy at line 172 (3 times), _reconstruct at line 271 (2 times)] File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:271, in _reconstruct(x, memo, func, args, state, listiter, dictiter, deepcopy) 269 if state is not None: 270 if deep: --> 271 state = deepcopy(state, memo) 272 if hasattr(y, '__setstate__'): 273 y.__setstate__(state) [... skipping similar frames: _deepcopy_dict at line 231 (1 times), deepcopy at line 146 (1 times)] File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:146, in deepcopy(x, memo, _nil) 144 copier = _deepcopy_dispatch.get(cls) 145 if copier is not None: --> 146 y = copier(x, memo) 147 else: 148 if issubclass(cls, type): File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:231, in _deepcopy_dict(x, memo, deepcopy) 229 memo[id(x)] = y 230 for key, value in x.items(): --> 231 y[deepcopy(key, memo)] = deepcopy(value, memo) 232 return y File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:172, in deepcopy(x, memo, _nil) 170 y = x 171 else: --> 172 y = _reconstruct(x, memo, *rv) 174 # If is its own copy, don't memoize. 175 if y is not x: File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:265, in _reconstruct(x, memo, func, args, state, listiter, dictiter, deepcopy) 263 if deep and args: 264 args = (deepcopy(arg, memo) for arg in args) --> 265 y = func(*args) 266 if deep: 267 memo[id(x)] = y File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:264, in <genexpr>(.0) 262 deep = memo is not None 263 if deep and args: --> 264 args = (deepcopy(arg, memo) for arg in args) 265 y = func(*args) 266 if deep: File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:146, in deepcopy(x, memo, _nil) 144 copier = _deepcopy_dispatch.get(cls) 145 if copier is not None: --> 146 y = copier(x, memo) 147 else: 148 if issubclass(cls, type): File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:211, in _deepcopy_tuple(x, memo, deepcopy) 210 def _deepcopy_tuple(x, memo, deepcopy=deepcopy): --> 211 y = [deepcopy(a, memo) for a in x] 212 # We're not going to put the tuple in the memo, but it's still important we 213 # check for it, in case the tuple contains recursive mutable structures. 214 try: File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:211, in <listcomp>(.0) 210 def _deepcopy_tuple(x, memo, deepcopy=deepcopy): --> 211 y = [deepcopy(a, memo) for a in x] 212 # We're not going to put the tuple in the memo, but it's still important we 213 # check for it, in case the tuple contains recursive mutable structures. 214 try: File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:172, in deepcopy(x, memo, _nil) 170 y = x 171 else: --> 172 y = _reconstruct(x, memo, *rv) 174 # If is its own copy, don't memoize. 175 if y is not x: File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:271, in _reconstruct(x, memo, func, args, state, listiter, dictiter, deepcopy) 269 if state is not None: 270 if deep: --> 271 state = deepcopy(state, memo) 272 if hasattr(y, '__setstate__'): 273 y.__setstate__(state) File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:146, in deepcopy(x, memo, _nil) 144 copier = _deepcopy_dispatch.get(cls) 145 if copier is not None: --> 146 y = copier(x, memo) 147 else: 148 if issubclass(cls, type): File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:211, in _deepcopy_tuple(x, memo, deepcopy) 210 def _deepcopy_tuple(x, memo, deepcopy=deepcopy): --> 211 y = [deepcopy(a, memo) for a in x] 212 # We're not going to put the tuple in the memo, but it's still important we 213 # check for it, in case the tuple contains recursive mutable structures. 214 try: File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:211, in <listcomp>(.0) 210 def _deepcopy_tuple(x, memo, deepcopy=deepcopy): --> 211 y = [deepcopy(a, memo) for a in x] 212 # We're not going to put the tuple in the memo, but it's still important we 213 # check for it, in case the tuple contains recursive mutable structures. 214 try: File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:146, in deepcopy(x, memo, _nil) 144 copier = _deepcopy_dispatch.get(cls) 145 if copier is not None: --> 146 y = copier(x, memo) 147 else: 148 if issubclass(cls, type): File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:231, in _deepcopy_dict(x, memo, deepcopy) 229 memo[id(x)] = y 230 for key, value in x.items(): --> 231 y[deepcopy(key, memo)] = deepcopy(value, memo) 232 return y File ~/miniconda3/envs/test-env/lib/python3.10/copy.py:161, in deepcopy(x, memo, _nil) 159 reductor = getattr(x, "__reduce_ex__", None) 160 if reductor is not None: --> 161 rv = reductor(4) 162 else: 163 reductor = getattr(x, "__reduce__", None) TypeError: cannot pickle '_contextvars.Context' object ``` </details> ### Expected behavior If I choose to load the file from the public bucket with `anon=True` passed - everything works, so I expected loading from the private bucket to work as well ### Environment info - `datasets` version: 2.14.6 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.10.13 - Huggingface_hub version: 0.19.1 - PyArrow version: 14.0.1 - Pandas version: 1.5.3 - s3fs version: 2023.10.0 - fsspec version: 2023.10.0 - aiobotocore version: 2.7.0
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6407/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6407/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6406
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6406/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6406/comments
https://api.github.com/repos/huggingface/datasets/issues/6406/events
https://github.com/huggingface/datasets/issues/6406
1,990,469,045
I_kwDODunzps52pCW1
6,406
CI Build PR Documentation is broken: ImportError: cannot import name 'TypeAliasType' from 'typing_extensions'
{ "login": "albertvillanova", "id": 8515462, "node_id": "MDQ6VXNlcjg1MTU0NjI=", "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "gravatar_id": "", "url": "https://api.github.com/users/albertvillanova", "html_url": "https://github.com/albertvillanova", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "repos_url": "https://api.github.com/users/albertvillanova/repos", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[]
2023-11-13T11:36:10
2023-11-14T10:05:36
2023-11-14T10:05:36
MEMBER
null
null
null
Our CI Build PR Documentation is broken. See: https://github.com/huggingface/datasets/actions/runs/6799554060/job/18486828777?pr=6390 ``` ImportError: cannot import name 'TypeAliasType' from 'typing_extensions' ```
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6406/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6406/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6405
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6405/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6405/comments
https://api.github.com/repos/huggingface/datasets/issues/6405/events
https://github.com/huggingface/datasets/issues/6405
1,990,358,743
I_kwDODunzps52onbX
6,405
ConfigNamesError on a simple CSV file
{ "login": "severo", "id": 1676121, "node_id": "MDQ6VXNlcjE2NzYxMjE=", "avatar_url": "https://avatars.githubusercontent.com/u/1676121?v=4", "gravatar_id": "", "url": "https://api.github.com/users/severo", "html_url": "https://github.com/severo", "followers_url": "https://api.github.com/users/severo/followers", "following_url": "https://api.github.com/users/severo/following{/other_user}", "gists_url": "https://api.github.com/users/severo/gists{/gist_id}", "starred_url": "https://api.github.com/users/severo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/severo/subscriptions", "organizations_url": "https://api.github.com/users/severo/orgs", "repos_url": "https://api.github.com/users/severo/repos", "events_url": "https://api.github.com/users/severo/events{/privacy}", "received_events_url": "https://api.github.com/users/severo/received_events", "type": "User", "site_admin": false }
[ { "id": 1935892857, "node_id": "MDU6TGFiZWwxOTM1ODkyODU3", "url": "https://api.github.com/repos/huggingface/datasets/labels/bug", "name": "bug", "color": "d73a4a", "default": true, "description": "Something isn't working" } ]
closed
false
null
[]
null
[ "The viewer is working now. \r\n\r\nBased on the repo commit history, the bug was due to the incorrect format of the `features` field in the README YAML (`Value` requires `dtype`, e.g., `Value(\"string\")`, but it was not specified)", "Feel free to close the issue", "Oh, OK! Thanks. So, there was no reason to open an issue" ]
2023-11-13T10:28:29
2023-11-13T20:01:24
2023-11-13T20:01:24
CONTRIBUTOR
null
null
null
See https://huggingface.co/datasets/Nguyendo1999/mmath/discussions/1 ``` Error code: ConfigNamesError Exception: TypeError Message: __init__() missing 1 required positional argument: 'dtype' Traceback: Traceback (most recent call last): File "/src/services/worker/src/worker/job_runners/dataset/config_names.py", line 65, in compute_config_names_response for config in sorted(get_dataset_config_names(path=dataset, token=hf_token)) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/inspect.py", line 351, in get_dataset_config_names dataset_module = dataset_module_factory( File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 1512, in dataset_module_factory raise e1 from None File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 1489, in dataset_module_factory return HubDatasetModuleFactoryWithoutScript( File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 1039, in get_module dataset_infos = DatasetInfosDict.from_dataset_card_data(dataset_card_data) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/info.py", line 468, in from_dataset_card_data dataset_info = DatasetInfo._from_yaml_dict(dataset_card_data["dataset_info"]) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/info.py", line 399, in _from_yaml_dict yaml_data["features"] = Features._from_yaml_list(yaml_data["features"]) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1838, in _from_yaml_list return cls.from_dict(from_yaml_inner(yaml_data)) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1690, in from_dict obj = generate_from_dict(dic) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1345, in generate_from_dict return {key: generate_from_dict(value) for key, value in obj.items()} File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1345, in <dictcomp> return {key: generate_from_dict(value) for key, value in obj.items()} File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1353, in generate_from_dict return class_type(**{k: v for k, v in obj.items() if k in field_names}) TypeError: __init__() missing 1 required positional argument: 'dtype' ``` This is the CSV file: https://huggingface.co/datasets/Nguyendo1999/mmath/blob/dbcdd7c2c6fc447f852ec136a7532292802bb46f/math_train.csv
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6405/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6405/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6403
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6403/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6403/comments
https://api.github.com/repos/huggingface/datasets/issues/6403/events
https://github.com/huggingface/datasets/issues/6403
1,990,098,817
I_kwDODunzps52nn-B
6,403
Cannot import datasets on google colab (python 3.10.12)
{ "login": "nabilaannisa", "id": 15389235, "node_id": "MDQ6VXNlcjE1Mzg5MjM1", "avatar_url": "https://avatars.githubusercontent.com/u/15389235?v=4", "gravatar_id": "", "url": "https://api.github.com/users/nabilaannisa", "html_url": "https://github.com/nabilaannisa", "followers_url": "https://api.github.com/users/nabilaannisa/followers", "following_url": "https://api.github.com/users/nabilaannisa/following{/other_user}", "gists_url": "https://api.github.com/users/nabilaannisa/gists{/gist_id}", "starred_url": "https://api.github.com/users/nabilaannisa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/nabilaannisa/subscriptions", "organizations_url": "https://api.github.com/users/nabilaannisa/orgs", "repos_url": "https://api.github.com/users/nabilaannisa/repos", "events_url": "https://api.github.com/users/nabilaannisa/events{/privacy}", "received_events_url": "https://api.github.com/users/nabilaannisa/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "You are most likely using an outdated version of `datasets` in the notebook, which can be verified with the `!datasets-cli env` command. You can run `!pip install -U datasets` to update the installation.", "okay, it works! thank you so much! 😄 " ]
2023-11-13T08:14:43
2023-11-16T05:04:22
2023-11-16T05:04:21
NONE
null
null
null
### Describe the bug I'm trying A full colab demo notebook of zero-shot-distillation from https://github.com/huggingface/transformers/tree/main/examples/research_projects/zero-shot-distillation but i got this type of error when importing datasets on my google colab (python version is 3.10.12) ![image](https://github.com/huggingface/datasets/assets/15389235/6f7758a2-681d-4436-87d0-5e557838e368) I found the same problem that have been solved in [#3326 ] but it seem still error on the google colab. I can't try on my local using jupyter notebook because of my laptop resource doesn't fulfill the requirements. Please can anyone help me solve this problem. Thank you 😅 ### Steps to reproduce the bug Error: ``` --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) [<ipython-input-8-b6e092f83978>](https://localhost:8080/#) in <cell line: 1>() ----> 1 from datasets import load_dataset 2 3 # Print all the available datasets 4 from huggingface_hub import list_datasets 5 print([dataset.id for dataset in list_datasets()]) 6 frames [/usr/lib/python3.10/functools.py](https://localhost:8080/#) in update_wrapper(wrapper, wrapped, assigned, updated) 59 # Issue #17482: set __wrapped__ last so we don't inadvertently copy it 60 # from the wrapped function when updating __dict__ ---> 61 wrapper.__wrapped__ = wrapped 62 # Return the wrapper so this can be used as a decorator via partial() 63 return wrapper AttributeError: readonly attribute ``` ### Expected behavior Run success on Google Colab (free) ### Environment info Windows 11 x64, Google Colab free
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6403/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6403/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6401
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6401/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6401/comments
https://api.github.com/repos/huggingface/datasets/issues/6401/events
https://github.com/huggingface/datasets/issues/6401
1,988,710,061
I_kwDODunzps52iU6t
6,401
dataset = load_dataset("Hyperspace-Technologies/scp-wiki-text") not working
{ "login": "userbox020", "id": 47074021, "node_id": "MDQ6VXNlcjQ3MDc0MDIx", "avatar_url": "https://avatars.githubusercontent.com/u/47074021?v=4", "gravatar_id": "", "url": "https://api.github.com/users/userbox020", "html_url": "https://github.com/userbox020", "followers_url": "https://api.github.com/users/userbox020/followers", "following_url": "https://api.github.com/users/userbox020/following{/other_user}", "gists_url": "https://api.github.com/users/userbox020/gists{/gist_id}", "starred_url": "https://api.github.com/users/userbox020/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/userbox020/subscriptions", "organizations_url": "https://api.github.com/users/userbox020/orgs", "repos_url": "https://api.github.com/users/userbox020/repos", "events_url": "https://api.github.com/users/userbox020/events{/privacy}", "received_events_url": "https://api.github.com/users/userbox020/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "Seems like it's a problem with the dataset, since in the [README](https://huggingface.co/datasets/Hyperspace-Technologies/scp-wiki-text/blob/main/README.md) the validation is not specified. Try cloning the dataset, removing the README (or validation split), and loading it locally/ ", "@VarunNSrivastava thanks brother, working beautiful now\r\n\r\n```\r\nC:\\_Work\\_datasets>py dataset.py\r\nDownloading data files: 100%|████████████████████████████████████████████████████████████████████| 3/3 [00:00<?, ?it/s]\r\nExtracting data files: 100%|████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 599.90it/s]\r\nGenerating train split: 314294 examples [00:00, 1293222.03 examples/s]\r\nGenerating validation split: 120 examples [00:00, 59053.91 examples/s]\r\nGenerating test split: 34922 examples [00:00, 1343275.84 examples/s]\r\n```" ]
2023-11-11T04:09:07
2023-11-20T17:45:20
2023-11-20T17:45:20
NONE
null
null
null
### Describe the bug ``` (datasets) mruserbox@guru-X99:/media/10TB_HHD/_LLM_DATASETS$ python dataset.py Downloading readme: 100%|███████████████████████████████████| 360/360 [00:00<00:00, 2.16MB/s] Downloading data: 100%|█████████████████████████████████| 65.1M/65.1M [00:19<00:00, 3.38MB/s] Downloading data: 100%|█████████████████████████████████| 6.35k/6.35k [00:00<00:00, 20.7kB/s] Downloading data: 100%|█████████████████████████████████| 7.29M/7.29M [00:01<00:00, 3.99MB/s] Downloading data files: 100%|██████████████████████████████████| 3/3 [00:21<00:00, 7.14s/it] Extracting data files: 100%|█████████████████████████████████| 3/3 [00:00<00:00, 1624.23it/s] Generating train split: 100%|█████████████| 314294/314294 [00:00<00:00, 668186.58 examples/s] Generating validation split: 120 examples [00:00, 100422.28 examples/s] Generating test split: 100%|████████████████| 34922/34922 [00:00<00:00, 754683.41 examples/s] Traceback (most recent call last): File "/media/10TB_HHD/_LLM_DATASETS/dataset.py", line 3, in <module> dataset = load_dataset("Hyperspace-Technologies/scp-wiki-text") File "/home/mruserbox/miniconda3/envs/datasets/lib/python3.10/site-packages/datasets/load.py", line 2153, in load_dataset builder_instance.download_and_prepare( File "/home/mruserbox/miniconda3/envs/datasets/lib/python3.10/site-packages/datasets/builder.py", line 954, in download_and_prepare self._download_and_prepare( File "/home/mruserbox/miniconda3/envs/datasets/lib/python3.10/site-packages/datasets/builder.py", line 1067, in _download_and_prepare verify_splits(self.info.splits, split_dict) File "/home/mruserbox/miniconda3/envs/datasets/lib/python3.10/site-packages/datasets/utils/info_utils.py", line 93, in verify_splits raise UnexpectedSplits(str(set(recorded_splits) - set(expected_splits))) datasets.utils.info_utils.UnexpectedSplits: {'validation'} ``` ### Steps to reproduce the bug Name: `dataset.py` Code: ``` from datasets import load_dataset dataset = load_dataset("Hyperspace-Technologies/scp-wiki-text") ``` ### Expected behavior Run without errors ### Environment info ``` name: datasets channels: - defaults dependencies: - _libgcc_mutex=0.1=main - _openmp_mutex=5.1=1_gnu - bzip2=1.0.8=h7b6447c_0 - ca-certificates=2023.08.22=h06a4308_0 - ld_impl_linux-64=2.38=h1181459_1 - libffi=3.4.4=h6a678d5_0 - libgcc-ng=11.2.0=h1234567_1 - libgomp=11.2.0=h1234567_1 - libstdcxx-ng=11.2.0=h1234567_1 - libuuid=1.41.5=h5eee18b_0 - ncurses=6.4=h6a678d5_0 - openssl=3.0.12=h7f8727e_0 - python=3.10.13=h955ad1f_0 - readline=8.2=h5eee18b_0 - setuptools=68.0.0=py310h06a4308_0 - sqlite=3.41.2=h5eee18b_0 - tk=8.6.12=h1ccaba5_0 - wheel=0.41.2=py310h06a4308_0 - xz=5.4.2=h5eee18b_0 - zlib=1.2.13=h5eee18b_0 - pip: - aiohttp==3.8.6 - aiosignal==1.3.1 - async-timeout==4.0.3 - attrs==23.1.0 - certifi==2023.7.22 - charset-normalizer==3.3.2 - click==8.1.7 - datasets==2.14.6 - dill==0.3.7 - filelock==3.13.1 - frozenlist==1.4.0 - fsspec==2023.10.0 - huggingface-hub==0.19.0 - idna==3.4 - multidict==6.0.4 - multiprocess==0.70.15 - numpy==1.26.1 - openai==0.27.8 - packaging==23.2 - pandas==2.1.3 - pip==23.3.1 - platformdirs==4.0.0 - pyarrow==14.0.1 - python-dateutil==2.8.2 - pytz==2023.3.post1 - pyyaml==6.0.1 - requests==2.31.0 - six==1.16.0 - tomli==2.0.1 - tqdm==4.66.1 - typer==0.9.0 - typing-extensions==4.8.0 - tzdata==2023.3 - urllib3==2.0.7 - xxhash==3.4.1 - yarl==1.9.2 prefix: /home/mruserbox/miniconda3/envs/datasets ```
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6401/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6401/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6400
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6400/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6400/comments
https://api.github.com/repos/huggingface/datasets/issues/6400/events
https://github.com/huggingface/datasets/issues/6400
1,988,571,317
I_kwDODunzps52hzC1
6,400
Safely load datasets by disabling execution of dataset loading script
{ "login": "irenedea", "id": 14367635, "node_id": "MDQ6VXNlcjE0MzY3NjM1", "avatar_url": "https://avatars.githubusercontent.com/u/14367635?v=4", "gravatar_id": "", "url": "https://api.github.com/users/irenedea", "html_url": "https://github.com/irenedea", "followers_url": "https://api.github.com/users/irenedea/followers", "following_url": "https://api.github.com/users/irenedea/following{/other_user}", "gists_url": "https://api.github.com/users/irenedea/gists{/gist_id}", "starred_url": "https://api.github.com/users/irenedea/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/irenedea/subscriptions", "organizations_url": "https://api.github.com/users/irenedea/orgs", "repos_url": "https://api.github.com/users/irenedea/repos", "events_url": "https://api.github.com/users/irenedea/events{/privacy}", "received_events_url": "https://api.github.com/users/irenedea/received_events", "type": "User", "site_admin": false }
[ { "id": 1935892871, "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement", "name": "enhancement", "color": "a2eeef", "default": true, "description": "New feature or request" } ]
open
false
{ "login": "lhoestq", "id": 42851186, "node_id": "MDQ6VXNlcjQyODUxMTg2", "avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4", "gravatar_id": "", "url": "https://api.github.com/users/lhoestq", "html_url": "https://github.com/lhoestq", "followers_url": "https://api.github.com/users/lhoestq/followers", "following_url": "https://api.github.com/users/lhoestq/following{/other_user}", "gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}", "starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions", "organizations_url": "https://api.github.com/users/lhoestq/orgs", "repos_url": "https://api.github.com/users/lhoestq/repos", "events_url": "https://api.github.com/users/lhoestq/events{/privacy}", "received_events_url": "https://api.github.com/users/lhoestq/received_events", "type": "User", "site_admin": false }
[ { "login": "lhoestq", "id": 42851186, "node_id": "MDQ6VXNlcjQyODUxMTg2", "avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4", "gravatar_id": "", "url": "https://api.github.com/users/lhoestq", "html_url": "https://github.com/lhoestq", "followers_url": "https://api.github.com/users/lhoestq/followers", "following_url": "https://api.github.com/users/lhoestq/following{/other_user}", "gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}", "starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions", "organizations_url": "https://api.github.com/users/lhoestq/orgs", "repos_url": "https://api.github.com/users/lhoestq/repos", "events_url": "https://api.github.com/users/lhoestq/events{/privacy}", "received_events_url": "https://api.github.com/users/lhoestq/received_events", "type": "User", "site_admin": false } ]
null
[ "great idea IMO\r\n\r\nthis could be a `trust_remote_code=True` flag like in transformers. We could also default to loading the Parquet conversion rather than executing code (for dataset repos that have both)", "@julien-c that would be great!", "We added the `trust_remote_code` argument to `load_dataset()` in `datasets` 2.16:\r\n- in the future users will have to pass trust_remote_code=True to use datasets with a script\r\n- for now we just show a warning when a dataset script is used\r\n- we fallback on the Hugging Face Parquet exports when possible (to keep compatibility with old datasets with scripts)\r\n\r\nSo feel free to use `trust_remote_code=False` in the meantime to disable loading from dataset loading scripts :)" ]
2023-11-10T23:48:29
2024-01-02T18:18:09
null
NONE
null
null
null
### Feature request Is there a way to disable execution of dataset loading script using `load_dataset`? This is a security vulnerability that could lead to arbitrary code execution. Any suggested workarounds are welcome as well. ### Motivation This is a security vulnerability that could lead to arbitrary code execution. ### Your contribution n/a
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6400/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6400/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6399
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6399/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6399/comments
https://api.github.com/repos/huggingface/datasets/issues/6399/events
https://github.com/huggingface/datasets/issues/6399
1,988,368,503
I_kwDODunzps52hBh3
6,399
TypeError: Cannot convert pyarrow.lib.ChunkedArray to pyarrow.lib.Array
{ "login": "y-hwang", "id": 76236359, "node_id": "MDQ6VXNlcjc2MjM2MzU5", "avatar_url": "https://avatars.githubusercontent.com/u/76236359?v=4", "gravatar_id": "", "url": "https://api.github.com/users/y-hwang", "html_url": "https://github.com/y-hwang", "followers_url": "https://api.github.com/users/y-hwang/followers", "following_url": "https://api.github.com/users/y-hwang/following{/other_user}", "gists_url": "https://api.github.com/users/y-hwang/gists{/gist_id}", "starred_url": "https://api.github.com/users/y-hwang/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/y-hwang/subscriptions", "organizations_url": "https://api.github.com/users/y-hwang/orgs", "repos_url": "https://api.github.com/users/y-hwang/repos", "events_url": "https://api.github.com/users/y-hwang/events{/privacy}", "received_events_url": "https://api.github.com/users/y-hwang/received_events", "type": "User", "site_admin": false }
[]
open
false
null
[]
null
[]
2023-11-10T20:48:46
2023-11-10T20:48:46
null
NONE
null
null
null
### Describe the bug Hi, I am preprocessing a large custom dataset with numpy arrays. I am running into this TypeError during writing in a dataset.map() function. I've tried decreasing writer batch size, but this error persists. This error does not occur for smaller datasets. Thank you! ### Steps to reproduce the bug Traceback (most recent call last): File "/n/home12/yhwang/.conda/envs/lib/python3.10/site-packages/multiprocess/pool.py", line 125, in worker result = (True, func(*args, **kwds)) File "/n/home12/yhwang/.conda/envs/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1354, in _write_generator_to_queue for i, result in enumerate(func(**kwargs)): File "/n/home12/yhwang/.conda/envs/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3493, in _map_single writer.write_batch(batch) File "/n/home12/yhwang/.conda/envs/lib/python3.10/site-packages/datasets/arrow_writer.py", line 555, in write_batch arrays.append(pa.array(typed_sequence)) File "pyarrow/array.pxi", line 243, in pyarrow.lib.array File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol File "/n/home12/yhwang/.conda/envs/lib/python3.10/site-packages/datasets/arrow_writer.py", line 184, in __arrow_array__ out = numpy_to_pyarrow_listarray(data) File "/n/home12/yhwang/.conda/envs/lib/python3.10/site-packages/datasets/features/features.py", line 1394, in numpy_to_pyarrow_listarray values = pa.ListArray.from_arrays(offsets, values) File "pyarrow/array.pxi", line 2004, in pyarrow.lib.ListArray.from_arrays TypeError: Cannot convert pyarrow.lib.ChunkedArray to pyarrow.lib.Array ### Expected behavior Type should not be a ChunkedArray ### Environment info datasets v2.14.5 arrow v1.2.3 pyarrow v12.0.1
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6399/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6399/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6397
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6397/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6397/comments
https://api.github.com/repos/huggingface/datasets/issues/6397/events
https://github.com/huggingface/datasets/issues/6397
1,987,622,152
I_kwDODunzps52eLUI
6,397
Raise a different exception for inexisting dataset vs files without known extension
{ "login": "severo", "id": 1676121, "node_id": "MDQ6VXNlcjE2NzYxMjE=", "avatar_url": "https://avatars.githubusercontent.com/u/1676121?v=4", "gravatar_id": "", "url": "https://api.github.com/users/severo", "html_url": "https://github.com/severo", "followers_url": "https://api.github.com/users/severo/followers", "following_url": "https://api.github.com/users/severo/following{/other_user}", "gists_url": "https://api.github.com/users/severo/gists{/gist_id}", "starred_url": "https://api.github.com/users/severo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/severo/subscriptions", "organizations_url": "https://api.github.com/users/severo/orgs", "repos_url": "https://api.github.com/users/severo/repos", "events_url": "https://api.github.com/users/severo/events{/privacy}", "received_events_url": "https://api.github.com/users/severo/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[]
2023-11-10T13:22:14
2023-11-22T15:12:34
2023-11-22T15:12:34
CONTRIBUTOR
null
null
null
See https://github.com/huggingface/datasets-server/issues/2082#issuecomment-1805716557 We have the same error for: - https://huggingface.co/datasets/severo/a_dataset_that_does_not_exist: a dataset that does not exist - https://huggingface.co/datasets/severo/test_files_without_extension: a dataset with files without a known extension ``` >>> import datasets >>> datasets.get_dataset_config_names('severo/a_dataset_that_does_not_exist') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/slesage/hf/datasets-server/services/worker/.venv/lib/python3.9/site-packages/datasets/inspect.py", line 351, in get_dataset_config_names dataset_module = dataset_module_factory( File "/home/slesage/hf/datasets-server/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 1508, in dataset_module_factory raise FileNotFoundError( FileNotFoundError: Couldn't find a dataset script at /home/slesage/hf/datasets-server/services/worker/severo/a_dataset_that_does_not_exist/a_dataset_that_does_not_exist.py or any data file in the same directory. Couldn't find 'severo/a_dataset_that_does_not_exist' on the Hugging Face Hub either: FileNotFoundError: Dataset 'severo/a_dataset_that_does_not_exist' doesn't exist on the Hub. If the repo is private or gated, make sure to log in with `huggingface-cli login`. >>> datasets.get_dataset_config_names('severo/test_files_without_extension') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/slesage/hf/datasets-server/services/worker/.venv/lib/python3.9/site-packages/datasets/inspect.py", line 351, in get_dataset_config_names dataset_module = dataset_module_factory( File "/home/slesage/hf/datasets-server/services/worker/.venv/lib/python3.9/site-packages/datasets/load.py", line 1508, in dataset_module_factory raise FileNotFoundError( FileNotFoundError: Couldn't find a dataset script at /home/slesage/hf/datasets-server/services/worker/severo/test_files_without_extension/test_files_without_extension.py or any data file in the same directory. Couldn't find 'severo/test_files_without_extension' on the Hugging Face Hub either: FileNotFoundError: No (supported) data files or dataset script found in severo/test_files_without_extension. ``` To differentiate, we must parse the error message (only the end is different). We should have a different exception for these two errors.
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6397/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6397/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6396
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6396/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6396/comments
https://api.github.com/repos/huggingface/datasets/issues/6396/events
https://github.com/huggingface/datasets/issues/6396
1,987,308,077
I_kwDODunzps52c-ot
6,396
Issue with pyarrow 14.0.1
{ "login": "severo", "id": 1676121, "node_id": "MDQ6VXNlcjE2NzYxMjE=", "avatar_url": "https://avatars.githubusercontent.com/u/1676121?v=4", "gravatar_id": "", "url": "https://api.github.com/users/severo", "html_url": "https://github.com/severo", "followers_url": "https://api.github.com/users/severo/followers", "following_url": "https://api.github.com/users/severo/following{/other_user}", "gists_url": "https://api.github.com/users/severo/gists{/gist_id}", "starred_url": "https://api.github.com/users/severo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/severo/subscriptions", "organizations_url": "https://api.github.com/users/severo/orgs", "repos_url": "https://api.github.com/users/severo/repos", "events_url": "https://api.github.com/users/severo/events{/privacy}", "received_events_url": "https://api.github.com/users/severo/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "Looks like we should stop using `PyExtensionType` and use `ExtensionType` instead\r\n\r\nsee https://github.com/apache/arrow/commit/f14170976372436ec1d03a724d8d3f3925484ecf", "https://github.com/huggingface/datasets-server/pull/2089#pullrequestreview-1724449532\r\n\r\n> Yes, I understand now: they have disabled their `PyExtensionType` and we use it in `datasets` for arrays... ", "related?\r\n\r\nhttps://huggingface.co/datasets/ssbuild/tools_data/discussions/1#654e663b77c8ec680d10479c", "> related?\r\n>\r\n> https://huggingface.co/datasets/ssbuild/tools_data/discussions/1#654e663b77c8ec680d10479c\r\n\r\nNo, related to https://github.com/huggingface/datasets/issues/5706", "Running the following is a workaround:\r\n\r\n```\r\nimport pyarrow\r\npyarrow.PyExtensionType.set_auto_load(True)\r\n```" ]
2023-11-10T10:02:12
2023-11-14T10:23:30
2023-11-14T10:23:30
CONTRIBUTOR
null
null
null
See https://github.com/huggingface/datasets-server/pull/2089 for reference ``` from datasets import (Array2D, Dataset, Features) feature_type = Array2D(shape=(2, 2), dtype="float32") content = [[0.0, 0.0], [0.0, 0.0]] features = Features({"col": feature_type}) dataset = Dataset.from_dict({"col": [content]}, features=features) ``` generates ``` /home/slesage/hf/datasets-server/libs/libcommon/.venv/lib/python3.9/site-packages/datasets/features/features.py:648: FutureWarning: pyarrow.PyExtensionType is deprecated and will refuse deserialization by default. Instead, please derive from pyarrow.ExtensionType and implement your own serialization mechanism. pa.PyExtensionType.__init__(self, self.storage_dtype) /home/slesage/hf/datasets-server/libs/libcommon/.venv/lib/python3.9/site-packages/datasets/features/features.py:1661: RuntimeWarning: pickle-based deserialization of pyarrow.PyExtensionType subclasses is disabled by default; if you only ingest trusted data files, you may re-enable this using `pyarrow.PyExtensionType.set_auto_load(True)`. In the future, Python-defined extension subclasses should derive from pyarrow.ExtensionType (not pyarrow.PyExtensionType) and implement their own serialization mechanism. obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema} /home/slesage/hf/datasets-server/libs/libcommon/.venv/lib/python3.9/site-packages/datasets/features/features.py:1661: FutureWarning: pyarrow.PyExtensionType is deprecated and will refuse deserialization by default. Instead, please derive from pyarrow.ExtensionType and implement your own serialization mechanism. obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema} Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/slesage/hf/datasets-server/libs/libcommon/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 924, in from_dict return cls(pa_table, info=info, split=split) File "/home/slesage/hf/datasets-server/libs/libcommon/.venv/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 693, in __init__ inferred_features = Features.from_arrow_schema(arrow_table.schema) File "/home/slesage/hf/datasets-server/libs/libcommon/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1661, in from_arrow_schema obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema} File "/home/slesage/hf/datasets-server/libs/libcommon/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1661, in <dictcomp> obj = {field.name: generate_from_arrow_type(field.type) for field in pa_schema} File "/home/slesage/hf/datasets-server/libs/libcommon/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 1381, in generate_from_arrow_type return Value(dtype=_arrow_to_datasets_dtype(pa_type)) File "/home/slesage/hf/datasets-server/libs/libcommon/.venv/lib/python3.9/site-packages/datasets/features/features.py", line 111, in _arrow_to_datasets_dtype raise ValueError(f"Arrow type {arrow_type} does not have a datasets dtype equivalent.") ValueError: Arrow type extension<arrow.py_extension_type<pyarrow.lib.UnknownExtensionType>> does not have a datasets dtype equivalent. ```
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6396/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6396/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6395
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6395/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6395/comments
https://api.github.com/repos/huggingface/datasets/issues/6395/events
https://github.com/huggingface/datasets/issues/6395
1,986,484,124
I_kwDODunzps52Z1ec
6,395
Add ability to set lock type
{ "login": "leoleoasd", "id": 37735580, "node_id": "MDQ6VXNlcjM3NzM1NTgw", "avatar_url": "https://avatars.githubusercontent.com/u/37735580?v=4", "gravatar_id": "", "url": "https://api.github.com/users/leoleoasd", "html_url": "https://github.com/leoleoasd", "followers_url": "https://api.github.com/users/leoleoasd/followers", "following_url": "https://api.github.com/users/leoleoasd/following{/other_user}", "gists_url": "https://api.github.com/users/leoleoasd/gists{/gist_id}", "starred_url": "https://api.github.com/users/leoleoasd/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/leoleoasd/subscriptions", "organizations_url": "https://api.github.com/users/leoleoasd/orgs", "repos_url": "https://api.github.com/users/leoleoasd/repos", "events_url": "https://api.github.com/users/leoleoasd/events{/privacy}", "received_events_url": "https://api.github.com/users/leoleoasd/received_events", "type": "User", "site_admin": false }
[ { "id": 1935892871, "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement", "name": "enhancement", "color": "a2eeef", "default": true, "description": "New feature or request" } ]
closed
false
null
[]
null
[ "We've replaced our filelock implementation with the `filelock` package, so their repo is the right place to request this feature.\r\n\r\nIn the meantime, the following should work: \r\n```python\r\nimport filelock\r\nfilelock.FileLock = filelock.SoftFileLock\r\n\r\nimport datasets\r\n...\r\n```" ]
2023-11-09T22:12:30
2023-11-23T18:50:00
2023-11-23T18:50:00
NONE
null
null
null
### Feature request Allow setting file lock type, maybe from an environment variable Currently, it only depends on whether fnctl is available: https://github.com/huggingface/datasets/blob/12ebe695b4748c5a26e08b44ed51955f74f5801d/src/datasets/utils/filelock.py#L463-L470C16 ### Motivation In my environment, flock isn't supported on a network attached drive ### Your contribution I'll be happy to submit a pr.
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6395/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6395/timeline
null
not_planned
https://api.github.com/repos/huggingface/datasets/issues/6394
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6394/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6394/comments
https://api.github.com/repos/huggingface/datasets/issues/6394/events
https://github.com/huggingface/datasets/issues/6394
1,985,947,116
I_kwDODunzps52XyXs
6,394
TorchFormatter images (H, W, C) instead of (C, H, W) format
{ "login": "Modexus", "id": 37351874, "node_id": "MDQ6VXNlcjM3MzUxODc0", "avatar_url": "https://avatars.githubusercontent.com/u/37351874?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Modexus", "html_url": "https://github.com/Modexus", "followers_url": "https://api.github.com/users/Modexus/followers", "following_url": "https://api.github.com/users/Modexus/following{/other_user}", "gists_url": "https://api.github.com/users/Modexus/gists{/gist_id}", "starred_url": "https://api.github.com/users/Modexus/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Modexus/subscriptions", "organizations_url": "https://api.github.com/users/Modexus/orgs", "repos_url": "https://api.github.com/users/Modexus/repos", "events_url": "https://api.github.com/users/Modexus/events{/privacy}", "received_events_url": "https://api.github.com/users/Modexus/received_events", "type": "User", "site_admin": false }
[]
open
false
null
[]
null
[ "Here's a PR for that. https://github.com/huggingface/datasets/pull/6402\r\n\r\nIt's not backward compatible, unfortunately. ", "Just ran into this working on data lib that's attempting to achieve common interfaces across hf datasets, webdataset, native torch style datasets. The defacto standards for image tensors are numpy == HWC, torch.Tensor == CHW. \r\n\r\nI had to drop use of 'torch' formatting because as is (H, W, C) makes it incompatible with pretty much all standard torch vision processing (torchvision, etc) including model inputs themselves... not sure what the breakage scope would be, but might be worth considering a breaking change since I'm not aware of many use cases where a torch.Tensor image is expected to be in HWC form. And if I set the format to 'torch', I'd expect to be able to apply torchvision transforms, etc directly to the output...\r\n\r\nEDIT: For 'torch' output to be compatible with torch conventions (namely torchvision for images), should follow this https://pytorch.org/vision/0.17/transforms.html#supported-input-types-and-conventions\r\n\r\nattn @lhoestq \r\n\r\n", "We can define something like `.with_format(\"torch\", image_data_format=\"channels_first\")` and recommend using this in the docs maybe ? also cc @NielsRogge ", "Sounds good to me. I guess it's not allowed to use the channels first format by default for backwards compatibility purposes?", "This works, but am wondering how widespread the use of the function is for image datasets? My hunch would be that it's not used widely enough with image datasets to favour backwards compat (keeping default channels_last) over clumsiness of needing this to be 'correct' for typical use.. but don't have the data to back that up.", "I see. I just checked in the HF libraries and it shouldn't break anything. And to be consistent with them we should actually use C H W. For example `transformers` image processors use C H W by default too.\r\n\r\nSo I'm ok with doing a breaking change to make it consistent with `transformers`, `torchvision`, etc.", "Since it is quite connected, the proposed PR #6402 will not work for monochrome `PIL` images since they only have 2 dimensions as `numpy `arrays. [Torchvision ](https://pytorch.org/vision/stable/_modules/torchvision/transforms/functional.html#pil_to_tensor) adds a channel before permuting. Would that make sense here as well?", "@Modexus yes, indeed that would make sense as torch expects 1, H, W for monochrome, not H,W as you'd often see in numpy (via PIL), OpenCV, etc.\r\n\r\nThe reference should be the torchvision fn https://pytorch.org/vision/main/_modules/torchvision/transforms/functional.html#pil_to_tensor", "My PR now should handle monochrome PIL image. Thanks for the heads up :)" ]
2023-11-09T16:02:15
2024-03-11T22:29:49
null
NONE
null
null
null
### Describe the bug Using .set_format("torch") leads to images having shape (H, W, C), the same as in numpy. However, pytorch normally uses (C, H, W) format. Maybe I'm missing something but this makes the format a lot less useful as I then have to permute it anyways. If not using the format it is possible to directly use torchvision transforms but any non-transformed value will not be a tensor. Is there a reason for this choice? ### Steps to reproduce the bug ```python from datasets import Dataset, Features, Audio, Image images = ["path/to/image.png"] * 10 features = Features({"image": Image()}) ds = Dataset.from_dict({"image": images}, features=features) ds = ds.with_format("torch") ds[0]["image"].shape ``` ```python torch.Size([512, 512, 4]) ``` ### Expected behavior ```python from datasets import Dataset, Features, Audio, Image images = ["path/to/image.png"] * 10 features = Features({"image": Image()}) ds = Dataset.from_dict({"image": images}, features=features) ds = ds.with_format("torch") ds[0]["image"].shape ``` ```python torch.Size([4, 512, 512]) ``` ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-6.5.9-100.fc37.x86_64-x86_64-with-glibc2.31 - Python version: 3.11.6 - Huggingface_hub version: 0.18.0 - PyArrow version: 14.0.1 - Pandas version: 2.1.2
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6394/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6394/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6393
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6393/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6393/comments
https://api.github.com/repos/huggingface/datasets/issues/6393/events
https://github.com/huggingface/datasets/issues/6393
1,984,913,259
I_kwDODunzps52T19r
6,393
Filter occasionally hangs
{ "login": "dakinggg", "id": 43149077, "node_id": "MDQ6VXNlcjQzMTQ5MDc3", "avatar_url": "https://avatars.githubusercontent.com/u/43149077?v=4", "gravatar_id": "", "url": "https://api.github.com/users/dakinggg", "html_url": "https://github.com/dakinggg", "followers_url": "https://api.github.com/users/dakinggg/followers", "following_url": "https://api.github.com/users/dakinggg/following{/other_user}", "gists_url": "https://api.github.com/users/dakinggg/gists{/gist_id}", "starred_url": "https://api.github.com/users/dakinggg/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dakinggg/subscriptions", "organizations_url": "https://api.github.com/users/dakinggg/orgs", "repos_url": "https://api.github.com/users/dakinggg/repos", "events_url": "https://api.github.com/users/dakinggg/events{/privacy}", "received_events_url": "https://api.github.com/users/dakinggg/received_events", "type": "User", "site_admin": false }
[]
open
false
null
[]
null
[ "It looks like I may not be the first to encounter this: https://github.com/huggingface/datasets/issues/3172", "Adding some more information, it seems to occur more frequently with large (millions of samples) datasets.", "More information. My code is structured as (1) load (2) map (3) filter (4) filter. It was always the second filter that failed. Combining the two filters into one seems to reliably work.", "@lhoestq it'd be great if someone had a chance to look at this. I suspect it is impacting many users given the other issue that I linked.", "Hi ! Sorry for the late response. Was it happening after the first or the second filter ?\r\n\r\nIt looks like an issue with the garbage collector (which makes it random). Maybe datasets created with `filter` are not always handled properly ? cc @mariosasko", "It was after the second filter (and combining the two filters into one seemingly resolved it). I obviously haven't tried all settings to know that these details are causal, but it did work for me.", "Thanks, that's good to know.\r\n\r\nThe stacktrace suggests an issue when `del self._indices` is called, which happens when a filtered dataset falls out of scope. The indices are a PyArrow table memory mapped from disk, so I'm not quite sure how calling `del` on it can cause this issue. We do `del self._indices` to make sure the file on disk is not used anymore by the current process and avoid e.g. permission errors.\r\n\r\nHopefully we can find a way to reproduce this error, otherwise it will be quite hard to understand what happened", "Yeah, I have a reliable repro, but it is not even close to minimal and uses a dataset I can't share. Perhaps you could try getting close to my setting.\r\n\r\n(1) make a large (~20GB) jsonl with prompt/response pairs\r\n(2) load it on a linux machine (`dataset = load_dataset(...)`)\r\n(3) map a tokenizer to it, with multiprocessing (`tokenized_dataset = dataset.map(...)`)\r\n(4) filter it once based on something, with multiprocessing (`filtered_1 = tokenized_dataset.filter(...)`)\r\n(5) filter it again based on something, with multiprocessing (`filtered_2 = filtered_1.filter(...)`)\r\n\r\nI included the variable names just in case it is relevant that I was creating new datasets each time, not overwriting the same variable.", "@lhoestq I have another version of the repro that seems fairly reliably. I have lots of jsonl files, and I iteratively load each one with `load_dataset('json', data_files='path/to/my/file.jsonl', streaming=False, split='train')` and then `dataset.map(..., num_proc=<int>)`. This iteration hangs in a random place each time. So seems like there is a bug that hits with _some_ frequency.", "With `num_proc=None` it works fine.", "I am also having similar issue to #3172 when trying to tokenize the data. My dataset contains 10M samples. Is there anything that could be done without having to split up the processing into multiple datasets?" ]
2023-11-09T06:18:30
2024-03-05T16:03:12
null
NONE
null
null
null
### Describe the bug A call to `.filter` occasionally hangs (after the filter is complete, according to tqdm) There is a trace produced ``` Exception ignored in: <function Dataset.__del__ at 0x7efb48130c10> Traceback (most recent call last): File "/usr/lib/python3/dist-packages/datasets/arrow_dataset.py", line 1366, in __del__ if hasattr(self, "_indices"): File "/usr/lib/python3/dist-packages/composer/core/engine.py", line 123, in sigterm_handler sys.exit(128 + signal) SystemExit: 143 ``` but I'm not sure if the trace is actually from `datasets`, or from surrounding code that is trying to clean up after datasets gets stuck. Unfortunately I can't reproduce this issue anywhere close to reliably. It happens infrequently when using `num_procs > 1`. Anecdotally I started seeing it when using larger datasets (~10M samples). ### Steps to reproduce the bug N/A see description ### Expected behavior map/filter calls always complete sucessfully ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.4.0-137-generic-x86_64-with-glibc2.31 - Python version: 3.10.13 - Huggingface_hub version: 0.17.3 - PyArrow version: 13.0.0 - Pandas version: 2.1.2
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6393/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6393/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6392
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6392/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6392/comments
https://api.github.com/repos/huggingface/datasets/issues/6392/events
https://github.com/huggingface/datasets/issues/6392
1,984,369,545
I_kwDODunzps52RxOJ
6,392
`push_to_hub` is not robust to hub closing connection
{ "login": "msis", "id": 577139, "node_id": "MDQ6VXNlcjU3NzEzOQ==", "avatar_url": "https://avatars.githubusercontent.com/u/577139?v=4", "gravatar_id": "", "url": "https://api.github.com/users/msis", "html_url": "https://github.com/msis", "followers_url": "https://api.github.com/users/msis/followers", "following_url": "https://api.github.com/users/msis/following{/other_user}", "gists_url": "https://api.github.com/users/msis/gists{/gist_id}", "starred_url": "https://api.github.com/users/msis/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/msis/subscriptions", "organizations_url": "https://api.github.com/users/msis/orgs", "repos_url": "https://api.github.com/users/msis/repos", "events_url": "https://api.github.com/users/msis/events{/privacy}", "received_events_url": "https://api.github.com/users/msis/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "Hi! We made some improvements to `push_to_hub` to make it more robust a couple of weeks ago but haven't published a release in the meantime, so it would help if you could install `datasets` from `main` (`pip install https://github.com/huggingface/datasets`) and let us know if this improved version of `push_to_hub` resolves the issue (in case the `ConnectionError` happens, re-running `push_to_hub` should be faster now).\r\n\r\nAlso, note that the previous implementation retries the upload, but sometimes this is not enough, so re-running the op is the only option.", "The update helped push more data.\r\nHowever it still crashed a little later:\r\n\r\n```\r\nTraceback (most recent call last):\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py\", line 270, in hf_raise_for_status\r\n response.raise_for_status()\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/models.py\", line 1021, in raise_for_status\r\n raise HTTPError(http_error_msg, response=self)\r\nrequests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://hf-hub-lfs-us-east-1.s3.us-east-1.amazonaws.com/repos/6c/33/6c33b3be1463a656e43c7a4f2d43c4a1cdae6e9d81fff87f69167ef25ccb1b88/5f53cb57cf2a52ca0d4c2166a69a6714c64fcdbb7cb8936dfa5b11ac60058e5f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA2JU7TKAQFN2FTF47%2F20231110%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231110T011254Z&X-Amz-Expires=86400&X-Amz-Signature=74e3e33c09ac4e7c6ac887aaee8d489f068869abbe1ee6d58a910fb18d0601d4&X-Amz-SignedHeaders=host&partNumber=13&uploadId=kQwunNkunfmT9D8GulQu_ufw1BTZtRA6wEUI4hnYOjytfdf.GKxDETgMr4wm8_0WNF2yGaNco_0h3JAGm4l9KV1N0nqr5XXyUCbs1ROmHP475fn9FIhc1umWQLEDc97V&x-id=UploadPart\r\n\r\nThe above exception was the direct cause of the following exception:\r\n\r\nTraceback (most recent call last):\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py\", line 391, in _wrapped_lfs_upload\r\n lfs_upload(operation=operation, lfs_batch_action=batch_action, token=token)\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py\", line 223, in lfs_upload\r\n _upload_multi_part(operation=operation, header=header, chunk_size=chunk_size, upload_url=upload_action[\"href\"])\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py\", line 319, in _upload_multi_part\r\n else _upload_parts_iteratively(operation=operation, sorted_parts_urls=sorted_parts_urls, chunk_size=chunk_size)\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py\", line 376, in _upload_parts_iteratively\r\n hf_raise_for_status(part_upload_res)\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py\", line 330, in hf_raise_for_status\r\n raise HfHubHTTPError(str(e), response=response) from e\r\nhuggingface_hub.utils._errors.HfHubHTTPError: 500 Server Error: Internal Server Error for url: https://hf-hub-lfs-us-east-1.s3.us-east-1.amazonaws.com/repos/6c/33/6c33b3be1463a656e43c7a4f2d43c4a1cdae6e9d81fff87f69167ef25ccb1b88/5f53cb57cf2a52ca0d4c2166a69a6714c64fcdbb7cb8936dfa5b11ac60058e5f?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA2JU7TKAQFN2FTF47%2F20231110%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231110T011254Z&X-Amz-Expires=86400&X-Amz-Signature=74e3e33c09ac4e7c6ac887aaee8d489f068869abbe1ee6d58a910fb18d0601d4&X-Amz-SignedHeaders=host&partNumber=13&uploadId=kQwunNkunfmT9D8GulQu_ufw1BTZtRA6wEUI4hnYOjytfdf.GKxDETgMr4wm8_0WNF2yGaNco_0h3JAGm4l9KV1N0nqr5XXyUCbs1ROmHP475fn9FIhc1umWQLEDc97V&x-id=UploadPart\r\n\r\nThe above exception was the direct cause of the following exception:\r\n\r\nTraceback (most recent call last):\r\n File \"convert_to_hf.py\", line 121, in <module>\r\n main()\r\n File \"convert_to_hf.py\", line 109, in main\r\n audio_dataset.push_to_hub(\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/dataset_dict.py\", line 1699, in push_to_hub\r\n split_additions, uploaded_size, dataset_nbytes = self[split]._push_parquet_shards_to_hub(\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/arrow_dataset.py\", line 5215, in _push_parquet_shards_to_hub\r\n _retry(\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/utils/file_utils.py\", line 290, in _retry\r\n return func(*func_args, **func_kwargs)\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py\", line 3665, in preupload_lfs_files\r\n _upload_lfs_files(\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py\", line 118, in _inner_fn\r\n return fn(*args, **kwargs)\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py\", line 401, in _upload_lfs_files\r\n _wrapped_lfs_upload(filtered_actions[0])\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py\", line 393, in _wrapped_lfs_upload\r\n raise RuntimeError(f\"Error while uploading '{operation.path_in_repo}' to the Hub.\") from exc\r\nRuntimeError: Error while uploading 'batch_20/train-00206-of-00261.parquet' to the Hub.\r\n```", "I think the previous implementation was actually better: it pushes to the hub every shard. So if it fails, as long as the shards have the same checksum, it will skip the ones that have been pushed.\r\n\r\nThe implementation in `main` pushes commits at the end, so when it fails, there are no commits and therefore restarts from the beginning every time.\r\n\r\nBelow is the another error log from another run with `main`. I've reverting back to the current release as it does the job for me.\r\n\r\n```\r\nUploading the dataset shards: 86%|████████▌ | 224/261 [21:46<03:35, 5.83s/it]s]\r\nTraceback (most recent call last):\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py\", line 270, in hf_raise_for_status\r\n response.raise_for_status()\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/models.py\", line 1021, in raise_for_status\r\n raise HTTPError(http_error_msg, response=self)\r\nrequests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://hf-hub-lfs-us-east-1.s3.us-east-1.amazonaws.com/repos/6c/33/6c33b3be1463a656e43c7a4f2d43c4a1cdae6e9d81fff87f69167ef25ccb1b88/97e68d7a5d4a747ffaa249fc09798e961d621fe4170599e6100197f7733f321d?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA2JU7TKAQFN2FTF47%2F20231110%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231110T145155Z&X-Amz-Expires=86400&X-Amz-Signature=5341e4b34dc325737f92dc9005c4a31e4d3f9a3d3d853b267e01915260acf629&X-Amz-SignedHeaders=host&partNumber=27&uploadId=NRD0izEWv7MPtC2bYrm5VJ4XgIbHctKNguR7zS1UhGOOrXwBJvigrOywBvQBnS9sxiy0J0ma9sNog8S13nIdTdE9p60MIITTstUFeKvLHSxpU.a527QED1JVYzJ.9xA0&x-id=UploadPart\r\n\r\nThe above exception was the direct cause of the following exception:\r\n\r\nTraceback (most recent call last):\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py\", line 391, in _wrapped_lfs_upload\r\n lfs_upload(operation=operation, lfs_batch_action=batch_action, token=token)\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py\", line 223, in lfs_upload\r\n _upload_multi_part(operation=operation, header=header, chunk_size=chunk_size, upload_url=upload_action[\"href\"])\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py\", line 319, in _upload_multi_part\r\n else _upload_parts_iteratively(operation=operation, sorted_parts_urls=sorted_parts_urls, chunk_size=chunk_size)\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py\", line 376, in _upload_parts_iteratively\r\n hf_raise_for_status(part_upload_res)\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py\", line 330, in hf_raise_for_status\r\n raise HfHubHTTPError(str(e), response=response) from e\r\nhuggingface_hub.utils._errors.HfHubHTTPError: 500 Server Error: Internal Server Error for url: https://hf-hub-lfs-us-east-1.s3.us-east-1.amazonaws.com/repos/6c/33/6c33b3be1463a656e43c7a4f2d43c4a1cdae6e9d81fff87f69167ef25ccb1b88/97e68d7a5d4a747ffaa249fc09798e961d621fe4170599e6100197f7733f321d?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA2JU7TKAQFN2FTF47%2F20231110%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20231110T145155Z&X-Amz-Expires=86400&X-Amz-Signature=5341e4b34dc325737f92dc9005c4a31e4d3f9a3d3d853b267e01915260acf629&X-Amz-SignedHeaders=host&partNumber=27&uploadId=NRD0izEWv7MPtC2bYrm5VJ4XgIbHctKNguR7zS1UhGOOrXwBJvigrOywBvQBnS9sxiy0J0ma9sNog8S13nIdTdE9p60MIITTstUFeKvLHSxpU.a527QED1JVYzJ.9xA0&x-id=UploadPart\r\n\r\nThe above exception was the direct cause of the following exception:\r\n\r\nTraceback (most recent call last):\r\n File \"convert_to_hf.py\", line 121, in <module>\r\n main()\r\n File \"convert_to_hf.py\", line 109, in main\r\n audio_dataset.push_to_hub(\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/dataset_dict.py\", line 1699, in push_to_hub\r\n p, glob_pattern_to_regex(PUSH_TO_HUB_WITHOUT_METADATA_CONFIGS_SPLIT_PATTERN_SHARDED)\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/arrow_dataset.py\", line 5215, in _push_parquet_shards_to_hub\r\n token = token if token is not None else HfFolder.get_token()\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/utils/file_utils.py\", line 290, in _retry\r\n return func(*func_args, **func_kwargs)\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py\", line 3665, in preupload_lfs_files\r\n _upload_lfs_files(\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py\", line 118, in _inner_fn\r\n return fn(*args, **kwargs)\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py\", line 401, in _upload_lfs_files\r\n _wrapped_lfs_upload(filtered_actions[0])\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py\", line 393, in _wrapped_lfs_upload\r\n raise RuntimeError(f\"Error while uploading '{operation.path_in_repo}' to the Hub.\") from exc\r\nRuntimeError: Error while uploading 'batch_20/train-00224-of-00261.parquet' to the Hub.\r\n```", "There's a new error from the hub now:\r\n```\r\nPushing dataset shards to the dataset hub: 49%|████▉ | 128/261 [11:38<12:05, 5.45s/it]\r\nTraceback (most recent call last):\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py\", line 270, in hf_raise_for_status\r\n response.raise_for_status()\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/models.py\", line 1021, in raise_for_status\r\n raise HTTPError(http_error_msg, response=self)\r\nrequests.exceptions.HTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/api/datasets/tarteel-ai/tawseem/commit/main\r\n\r\nThe above exception was the direct cause of the following exception:\r\n\r\nTraceback (most recent call last):\r\n File \"convert_to_hf.py\", line 121, in <module>\r\n main()\r\n File \"convert_to_hf.py\", line 109, in main\r\n audio_dataset.push_to_hub(\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/dataset_dict.py\", line 1641, in push_to_hub\r\n repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub(\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/arrow_dataset.py\", line 5308, in _push_parquet_shards_to_hub\r\n _retry(\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/utils/file_utils.py\", line 293, in _retry\r\n raise err\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/utils/file_utils.py\", line 290, in _retry\r\n return func(*func_args, **func_kwargs)\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py\", line 118, in _inner_fn\r\n return fn(*args, **kwargs)\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py\", line 1045, in _inner\r\n return fn(self, *args, **kwargs)\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py\", line 3850, in upload_file\r\n commit_info = self.create_commit(\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py\", line 118, in _inner_fn\r\n return fn(*args, **kwargs)\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py\", line 1045, in _inner\r\n return fn(self, *args, **kwargs)\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py\", line 3237, in create_commit\r\n hf_raise_for_status(commit_resp, endpoint_name=\"commit\")\r\n File \"/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_errors.py\", line 330, in hf_raise_for_status\r\n raise HfHubHTTPError(str(e), response=response) from e\r\nhuggingface_hub.utils._errors.HfHubHTTPError: 429 Client Error: Too Many Requests for url: https://huggingface.co/api/datasets/tarteel-ai/tawseem/commit/main (Request ID: Root=1-654e48e6-598511b14413bb293fa67084;783522b4-66f9-4f8a-8a74-2accf7cabd17)\r\n\r\nYou have exceeded our hourly quotas for action: commit. We invite you to retry later.\r\n```\r\n\r\nAt least this is more explicit from the server side.", "> think the previous implementation was actually better: it pushes to the hub every shard. So if it fails, as long as the shards have the same checksum, it will skip the ones that have been pushed.\r\n>\r\n>The implementation in main pushes commits at the end, so when it fails, there are no commits and therefore restarts from the beginning every time.\r\n>\r\n>Below is the another error log from another run with main. I've reverting back to the current release as it does the job for me.\r\n\r\nThe `preupload` step is instant for the already uploaded shards, so only the Parquet conversion is repeated without uploading the actual Parquet data (only to check the SHAs). The previous implementation manually checks the Parquet shard's fingerprint to resume uploading, so the current implementation is cleaner.\r\n\r\n> You have exceeded our hourly quotas for action: commit. We invite you to retry later.\r\n\r\nThis is the problem with the previous implementation. If the number of shards is large, it creates too many commits for the Hub in a short period.", "But I agree that the `500 Server Error` returned by the Hub is annoying. Earlier today, I also got it on a small 5GB dataset (with 500 MB shards).\r\n\r\n@Wauplin @julien-c Is there something we can do about this?", "@mariosasko can't do much if AWS raises a HTTP 500 unfortunately (we are simply pushing data to a S3 bucket).\r\nWhat we can do is to add a retry mechanism in the multi-part upload logic here: https://github.com/huggingface/huggingface_hub/blob/c972cba1fecb456a7b3325cdd1fdbcc425f21f94/src/huggingface_hub/lfs.py#L370 :confused: ", "@Wauplin That code already retries the request using `http_backoff`, no?", "> That code already retries the request using http_backoff, no?\r\n\r\nCurrently only on HTTP 503 by default. We should add 500 as well (and hope it is a transient error from AWS)", "Opened a PR to retry in case S3 raises HTTP 500. Will also retry on any `ConnectionError` (connection reset by peer, connection lost,...). Hopefully this should make the upload process more robust to transient errors.", "I still get the same error, using `push_to_hub`. Using `git lfs` and pushing the files solved it for me.", "@BEpresent the fix has not been released yet. You can expect a release of `huggingface_hub` (with this fix) today or tomorrow :)" ]
2023-11-08T20:44:53
2023-12-20T07:28:24
2023-12-01T17:51:34
NONE
null
null
null
### Describe the bug Like to #6172, `push_to_hub` will crash if Hub resets the connection and raise the following error: ``` Pushing dataset shards to the dataset hub: 32%|███▏ | 54/171 [06:38<14:23, 7.38s/it] Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" http.client.RemoteDisconnected: Remote end closed connection without response During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 799, in urlopen retries = retries.increment( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/util/retry.py", line 550, in increment raise six.reraise(type(error), error, _stacktrace) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/packages/six.py", line 769, in reraise raise value.with_traceback(tb) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 715, in urlopen httplib_response = self._make_request( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 467, in _make_request six.raise_from(e, None) File "<string>", line 3, in raise_from File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/urllib3/connectionpool.py", line 462, in _make_request httplib_response = conn.getresponse() File "/usr/lib/python3.8/http/client.py", line 1348, in getresponse response.begin() File "/usr/lib/python3.8/http/client.py", line 316, in begin version, status, reason = self._read_status() File "/usr/lib/python3.8/http/client.py", line 285, in _read_status raise RemoteDisconnected("Remote end closed connection without" urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 383, in _wrapped_lfs_upload lfs_upload(operation=operation, lfs_batch_action=batch_action, token=token) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 223, in lfs_upload _upload_multi_part(operation=operation, header=header, chunk_size=chunk_size, upload_url=upload_action["href"]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 319, in _upload_multi_part else _upload_parts_iteratively(operation=operation, sorted_parts_urls=sorted_parts_urls, chunk_size=chunk_size) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/lfs.py", line 375, in _upload_parts_iteratively part_upload_res = http_backoff("PUT", part_upload_url, data=fileobj_slice) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 258, in http_backoff response = session.request(method=method, url=url, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_http.py", line 63, in send return super().send(request, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/requests/adapters.py", line 501, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: (ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')), '(Request ID: 2bab8c06-b701-4266-aead-fe2e0dc0e3ed)') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "convert_to_hf.py", line 116, in <module> main() File "convert_to_hf.py", line 108, in main audio_dataset.push_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/dataset_dict.py", line 1641, in push_to_hub repo_id, split, uploaded_size, dataset_nbytes, _, _ = self[split]._push_parquet_shards_to_hub( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 5308, in _push_parquet_shards_to_hub _retry( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 290, in _retry return func(*func_args, **func_kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 3221, in upload_file commit_info = self.create_commit( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 828, in _inner return fn(self, *args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/hf_api.py", line 2695, in create_commit upload_lfs_files( File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 118, in _inner_fn return fn(*args, **kwargs) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 393, in upload_lfs_files _wrapped_lfs_upload(filtered_actions[0]) File "/admin/home-piraka9011/.virtualenvs/w2v2/lib/python3.8/site-packages/huggingface_hub/_commit_api.py", line 385, in _wrapped_lfs_upload raise RuntimeError(f"Error while uploading '{operation.path_in_repo}' to the Hub.") from exc RuntimeError: Error while uploading 'batch_19/train-00054-of-00171-932beb4082c034bf.parquet' to the Hub. ``` The function should retry if the operations fails, or at least offer a way to recover after such a failure. Right now, calling the function again will start sending all the parquets files leading to duplicates in the repository, with no guarantee that it will actually be pushed. Previously, it would crash with an error 400 #4677 . ### Steps to reproduce the bug Any large dataset pushed the hub: ```py audio_dataset.push_to_hub( repo_id="org/dataset", ) ``` ### Expected behavior `push_to_hub` should have an option for max retries or resume. ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.15.0-1044-aws-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.16.4 - PyArrow version: 13.0.0 - Pandas version: 2.0.3
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6392/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6392/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6389
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6389/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6389/comments
https://api.github.com/repos/huggingface/datasets/issues/6389/events
https://github.com/huggingface/datasets/issues/6389
1,983,545,744
I_kwDODunzps52OoGQ
6,389
Index 339 out of range for dataset of size 339 <-- save_to_file()
{ "login": "jaggzh", "id": 20318973, "node_id": "MDQ6VXNlcjIwMzE4OTcz", "avatar_url": "https://avatars.githubusercontent.com/u/20318973?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jaggzh", "html_url": "https://github.com/jaggzh", "followers_url": "https://api.github.com/users/jaggzh/followers", "following_url": "https://api.github.com/users/jaggzh/following{/other_user}", "gists_url": "https://api.github.com/users/jaggzh/gists{/gist_id}", "starred_url": "https://api.github.com/users/jaggzh/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jaggzh/subscriptions", "organizations_url": "https://api.github.com/users/jaggzh/orgs", "repos_url": "https://api.github.com/users/jaggzh/repos", "events_url": "https://api.github.com/users/jaggzh/events{/privacy}", "received_events_url": "https://api.github.com/users/jaggzh/received_events", "type": "User", "site_admin": false }
[]
open
false
null
[]
null
[ "Hi! Can you make the above reproducer self-contained by adding code that generates the data?", "I managed a workaround eventually but I don't know what it was (I made a lot of changes to seq2seq). I'll try to include generating code in the future. (If I close, I don't know if you see it. Feel free to close; I'll re-open if I encounter it again (if I can))." ]
2023-11-08T12:52:09
2023-11-24T09:14:13
null
NONE
null
null
null
### Describe the bug When saving out some Audio() data. The data is audio recordings with associated 'sentences'. (They use the audio 'bytes' approach because they're clips within audio files). Code is below the traceback (I can't upload the voice audio/text (it's not even me)). ``` Traceback (most recent call last): File "/mnt/ddrive/prj/voice/voice-training-dataset-create/./dataset.py", line 156, in <module> create_dataset(args) File "/mnt/ddrive/prj/voice/voice-training-dataset-create/./dataset.py", line 138, in create_dataset hf_dataset.save_to_disk(args.outds, max_shard_size='50MB') File "/home/j/src/py/datasets/src/datasets/arrow_dataset.py", line 1531, in save_to_disk for kwargs in kwargs_per_job: File "/home/j/src/py/datasets/src/datasets/arrow_dataset.py", line 1508, in <genexpr> "shard": self.shard(num_shards=num_shards, index=shard_idx, contiguous=True), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/j/src/py/datasets/src/datasets/arrow_dataset.py", line 4609, in shard return self.select( ^^^^^^^^^^^^ File "/home/j/src/py/datasets/src/datasets/arrow_dataset.py", line 556, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/j/src/py/datasets/src/datasets/fingerprint.py", line 511, in wrapper out = func(dataset, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/j/src/py/datasets/src/datasets/arrow_dataset.py", line 3797, in select return self._select_contiguous(start, length, new_fingerprint=new_fingerprint) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/j/src/py/datasets/src/datasets/arrow_dataset.py", line 556, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/j/src/py/datasets/src/datasets/fingerprint.py", line 511, in wrapper out = func(dataset, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/j/src/py/datasets/src/datasets/arrow_dataset.py", line 3857, in _select_contiguous _check_valid_indices_value(start, len(self)) File "/home/j/src/py/datasets/src/datasets/arrow_dataset.py", line 648, in _check_valid_indices_value raise IndexError(f"Index {index} out of range for dataset of size {size}.") IndexError: Index 339 out of range for dataset of size 339. ``` ### Steps to reproduce the bug (I had to set the default max batch size down due to a different bug... or maybe it's related: https://github.com/huggingface/datasets/issues/5717) ```python3 #!/usr/bin/env python3 import argparse import os from pathlib import Path import soundfile as sf import datasets datasets.config.DEFAULT_MAX_BATCH_SIZE=35 from datasets import Features, Array2D, Value, Dataset, Sequence, Audio import numpy as np import librosa import sys import soundfile as sf import io import logging logging.basicConfig(level=logging.DEBUG, filename='debug.log', filemode='w', format='%(name)s - %(levelname)s - %(message)s') # Define the arguments for the command-line interface def parse_args(): parser = argparse.ArgumentParser(description="Create a Huggingface dataset from labeled audio files.") parser.add_argument("--indir_labeled", action="append", help="Directory containing labeled audio files.", required=True) parser.add_argument("--outds", help="Path to save the dataset file.", required=True) parser.add_argument("--max_clips", type=int, help="Max count of audio samples to add to the dataset.", default=None) parser.add_argument("-r", "--sr", type=int, help="Sample rate for the audio files.", default=16000) parser.add_argument("--no-resample", action="store_true", help="Disable resampling of the audio files.") parser.add_argument("--max_clip_secs", type=float, help="Max length of audio clips in seconds.", default=3.0) parser.add_argument("-v", "--verbose", action='count', default=1, help="Increase verbosity") return parser.parse_args() # Convert the NumPy arrays to audio bytes in WAV format def numpy_to_bytes(audio_array, sampling_rate=16000): with io.BytesIO() as bytes_io: sf.write(bytes_io, audio_array, samplerate=sampling_rate, format='wav', subtype='FLOAT') # float32 return bytes_io.getvalue() # Function to find audio and label files in a directory def find_audio_label_pairs(indir_labeled): audio_label_pairs = [] for root, _, files in os.walk(indir_labeled): for file in files: if file.endswith(('.mp3', '.wav', '.aac', '.flac')): audio_path = Path(root) / file if args.verbose>1: print(f'File: {audio_path}') label_path = audio_path.with_suffix('.labels.txt') if label_path.exists(): if args.verbose>0: print(f' Pair: {audio_path}') audio_label_pairs.append((audio_path, label_path)) return audio_label_pairs def process_audio_label_pair(audio_path, label_path, sampling_rate, no_resample, max_clip_secs): # Read the label file with open(label_path, 'r') as label_file: labels = label_file.readlines() # Load the full audio file full_audio, current_sr = sf.read(audio_path) if not no_resample and current_sr != sampling_rate: # You can use librosa.resample here if librosa is available full_audio = librosa.resample(full_audio, orig_sr=current_sr, target_sr=sampling_rate) audio_segments = [] sentences = [] # Process each label for label in labels: start_secs, end_secs, label_text = label.strip().split('\t') start_sample = int(float(start_secs) * sampling_rate) end_sample = int(float(end_secs) * sampling_rate) # Extract segment and truncate or pad to max_clip_secs audio_segment = full_audio[start_sample:end_sample] max_samples = int(max_clip_secs * sampling_rate) if len(audio_segment) > max_samples: # Truncate audio_segment = audio_segment[:max_samples] elif len(audio_segment) < max_samples: # Pad padding = np.zeros(max_samples - len(audio_segment), dtype=audio_segment.dtype) audio_segment = np.concatenate((audio_segment, padding)) audio_segment = numpy_to_bytes(audio_segment) audio_data = { 'path': str(audio_path), 'bytes': audio_segment, } audio_segments.append(audio_data) sentences.append(label_text) return audio_segments, sentences # Main function to create the dataset def create_dataset(args): audio_label_pairs = [] for indir in args.indir_labeled: audio_label_pairs.extend(find_audio_label_pairs(indir)) # Initialize our dataset data dataset_data = { 'path': [], # This will be a list of strings 'audio': [], # This will be a list of dictionaries 'sentence': [], # This will be a list of strings } # Process each audio-label pair and add the data to the dataset for audio_path, label_path in audio_label_pairs[:args.max_clips]: audio_segments, sentences = process_audio_label_pair(audio_path, label_path, args.sr, args.no_resample, args.max_clip_secs) if audio_segments and sentences: for audio_data, sentence in zip(audio_segments, sentences): if args.verbose>1: print(f'Appending {audio_data["path"]}') dataset_data['path'].append(audio_data['path']) dataset_data['audio'].append({ 'path': audio_data['path'], 'bytes': audio_data['bytes'], }) dataset_data['sentence'].append(sentence) features = Features({ 'path': Value('string'), # Path is redundant in common voice set also 'audio': Audio(sampling_rate=16000), 'sentence': Value('string'), }) hf_dataset = Dataset.from_dict(dataset_data, features=features) for key in dataset_data: for i, item in enumerate(dataset_data[key]): if item is None or (isinstance(item, bytes) and len(item) == 0): logging.error(f"Invalid {key} at index {i}: {item}") import ipdb; ipdb.set_trace(context=16); pass hf_dataset.save_to_disk(args.outds, max_shard_size='50MB') # try: # hf_dataset.save_to_disk(args.outds) # except TypeError as e: # # If there's a TypeError, log the exception and the dataset data that might have caused it # logging.exception("An error occurred while saving the dataset.") # import ipdb; ipdb.set_trace(context=16); pass # for key in dataset_data: # logging.debug(f"{key} length: {len(dataset_data[key])}") # if key == 'audio': # # Log the first 100 bytes of the audio data to avoid huge log files # for i, audio in enumerate(dataset_data[key]): # logging.debug(f"Audio {i}: {audio['bytes'][:100]}") # raise # Run the script if __name__ == "__main__": args = parse_args() create_dataset(args) ``` ### Expected behavior It shouldn't fail. ### Environment info - `datasets` version: 2.14.7.dev0 - Platform: Linux-6.1.0-13-amd64-x86_64-with-glibc2.36 - Python version: 3.11.2 - `huggingface_hub` version: 0.17.3 - PyArrow version: 13.0.0 - Pandas version: 2.1.2 - `fsspec` version: 2023.9.2
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6389/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6389/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6388
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6388/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6388/comments
https://api.github.com/repos/huggingface/datasets/issues/6388/events
https://github.com/huggingface/datasets/issues/6388
1,981,136,093
I_kwDODunzps52Fbzd
6,388
How to create 3d medical imgae dataset?
{ "login": "QingYunA", "id": 41177312, "node_id": "MDQ6VXNlcjQxMTc3MzEy", "avatar_url": "https://avatars.githubusercontent.com/u/41177312?v=4", "gravatar_id": "", "url": "https://api.github.com/users/QingYunA", "html_url": "https://github.com/QingYunA", "followers_url": "https://api.github.com/users/QingYunA/followers", "following_url": "https://api.github.com/users/QingYunA/following{/other_user}", "gists_url": "https://api.github.com/users/QingYunA/gists{/gist_id}", "starred_url": "https://api.github.com/users/QingYunA/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/QingYunA/subscriptions", "organizations_url": "https://api.github.com/users/QingYunA/orgs", "repos_url": "https://api.github.com/users/QingYunA/repos", "events_url": "https://api.github.com/users/QingYunA/events{/privacy}", "received_events_url": "https://api.github.com/users/QingYunA/received_events", "type": "User", "site_admin": false }
[ { "id": 1935892871, "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement", "name": "enhancement", "color": "a2eeef", "default": true, "description": "New feature or request" } ]
open
false
null
[]
null
[]
2023-11-07T11:27:36
2023-11-07T11:28:53
null
NONE
null
null
null
### Feature request I am newer to huggingface, after i look up `datasets` docs, I can't find how to create the dataset contains 3d medical image (ends with '.mhd', '.dcm', '.nii') ### Motivation help us to upload 3d medical dataset to huggingface! ### Your contribution I'll submit a PR if I find a way to add this feature
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6388/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6388/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6387
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6387/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6387/comments
https://api.github.com/repos/huggingface/datasets/issues/6387/events
https://github.com/huggingface/datasets/issues/6387
1,980,224,020
I_kwDODunzps52B9IU
6,387
How to load existing downloaded dataset ?
{ "login": "liming-ai", "id": 73068772, "node_id": "MDQ6VXNlcjczMDY4Nzcy", "avatar_url": "https://avatars.githubusercontent.com/u/73068772?v=4", "gravatar_id": "", "url": "https://api.github.com/users/liming-ai", "html_url": "https://github.com/liming-ai", "followers_url": "https://api.github.com/users/liming-ai/followers", "following_url": "https://api.github.com/users/liming-ai/following{/other_user}", "gists_url": "https://api.github.com/users/liming-ai/gists{/gist_id}", "starred_url": "https://api.github.com/users/liming-ai/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/liming-ai/subscriptions", "organizations_url": "https://api.github.com/users/liming-ai/orgs", "repos_url": "https://api.github.com/users/liming-ai/repos", "events_url": "https://api.github.com/users/liming-ai/events{/privacy}", "received_events_url": "https://api.github.com/users/liming-ai/received_events", "type": "User", "site_admin": false }
[ { "id": 1935892871, "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement", "name": "enhancement", "color": "a2eeef", "default": true, "description": "New feature or request" } ]
closed
false
null
[]
null
[ "Feel free to use `dataset.save_to_disk(...)`, then scp the directory containing the saved dataset and reload it on your other machine using `dataset = load_from_disk(...)`" ]
2023-11-06T22:51:44
2023-11-16T18:07:01
2023-11-16T18:07:01
NONE
null
null
null
Hi @mariosasko @lhoestq @katielink Thanks for your contribution and hard work. ### Feature request First, I download a dataset as normal by: ``` from datasets import load_dataset dataset = load_dataset('username/data_name', cache_dir='data') ``` The dataset format in `data` directory will be: ``` -data |-data_name |-test-00000-of-00001-bf4c733542e35fcb.parquet |-train-00000-of-00001-2a1df75c6bce91ab.parquet ``` Then I use SCP to clone this dataset into another machine, and then try: ``` from datasets import load_dataset dataset = load_dataset('data/data_name') # load from local path ``` This leads to re-generating training and validation split for each time, and the disk quota will be duplicated occupation. How can I just load the dataset without generating and saving these splits again? ### Motivation I do not want to download the same dataset in two machines, scp is much faster and better than HuggingFace API. I hope we can directly load the downloaded datasets (.parquest) ### Your contribution Please refer to the feature
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6387/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6387/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6386
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6386/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6386/comments
https://api.github.com/repos/huggingface/datasets/issues/6386/events
https://github.com/huggingface/datasets/issues/6386
1,979,878,014
I_kwDODunzps52Aop-
6,386
Formatting overhead
{ "login": "d-miketa", "id": 320321, "node_id": "MDQ6VXNlcjMyMDMyMQ==", "avatar_url": "https://avatars.githubusercontent.com/u/320321?v=4", "gravatar_id": "", "url": "https://api.github.com/users/d-miketa", "html_url": "https://github.com/d-miketa", "followers_url": "https://api.github.com/users/d-miketa/followers", "following_url": "https://api.github.com/users/d-miketa/following{/other_user}", "gists_url": "https://api.github.com/users/d-miketa/gists{/gist_id}", "starred_url": "https://api.github.com/users/d-miketa/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/d-miketa/subscriptions", "organizations_url": "https://api.github.com/users/d-miketa/orgs", "repos_url": "https://api.github.com/users/d-miketa/repos", "events_url": "https://api.github.com/users/d-miketa/events{/privacy}", "received_events_url": "https://api.github.com/users/d-miketa/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "Ah I think the `line-profiler` log is off-by-one and it is in fact the `extract_batch` method that's taking forever. Will investigate further.", "I tracked it down to a quirk of my setup. Apologies." ]
2023-11-06T19:06:38
2023-11-06T23:56:12
2023-11-06T23:56:12
NONE
null
null
null
### Describe the bug Hi! I very recently noticed that my training time is dominated by batch formatting. Using Lightning's profilers, I located the bottleneck within `datasets.formatting.formatting` and then narrowed it down with `line-profiler`. It turns out that almost all of the overhead is due to creating new instances of `self.python_arrow_extractor`. I admit I'm confused why that could be the case - as far as I can tell there's no complex `__init__` logic to execute. ![image](https://github.com/huggingface/datasets/assets/320321/5e022e0b-0d21-43d0-8e6f-9e641142e96b) ### Steps to reproduce the bug 1. Set up a dataset `ds` with potentially several (4+) columns (not sure if this is necessary, but it did at one point of the investigation make overhead worse) 2. Process it using a custom transform, `ds = ds.with_transform(transform_func)` 3. Decorate this function https://github.com/huggingface/datasets/blob/main/src/datasets/formatting/formatting.py#L512 with `@profile` from https://pypi.org/project/line-profiler/ 4. Profile with `$ kernprof -l script_to_profile.py` ### Expected behavior Batch formatting should have acceptable overhead. ### Environment info ``` datasets=2.14.6 pyarrow=14.0.0 ```
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6386/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6386/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6385
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6385/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6385/comments
https://api.github.com/repos/huggingface/datasets/issues/6385/events
https://github.com/huggingface/datasets/issues/6385
1,979,308,338
I_kwDODunzps51-dky
6,385
Get an error when i try to concatenate the squad dataset with my own dataset
{ "login": "CCDXDX", "id": 149378500, "node_id": "U_kgDOCOdVxA", "avatar_url": "https://avatars.githubusercontent.com/u/149378500?v=4", "gravatar_id": "", "url": "https://api.github.com/users/CCDXDX", "html_url": "https://github.com/CCDXDX", "followers_url": "https://api.github.com/users/CCDXDX/followers", "following_url": "https://api.github.com/users/CCDXDX/following{/other_user}", "gists_url": "https://api.github.com/users/CCDXDX/gists{/gist_id}", "starred_url": "https://api.github.com/users/CCDXDX/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/CCDXDX/subscriptions", "organizations_url": "https://api.github.com/users/CCDXDX/orgs", "repos_url": "https://api.github.com/users/CCDXDX/repos", "events_url": "https://api.github.com/users/CCDXDX/events{/privacy}", "received_events_url": "https://api.github.com/users/CCDXDX/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "The `answers.text` field in the JSON dataset needs to be a list of strings, not a string.\r\n\r\nSo, here is the fixed code:\r\n```python\r\nfrom huggingface_hub import notebook_login\r\nfrom datasets import load_dataset\r\n\r\n\r\n\r\nnotebook_login(\"mymailadresse\", \"mypassword\")\r\nsquad = load_dataset(\"squad\", split=\"train[:5000]\")\r\nsquad = squad.train_test_split(test_size=0.2)\r\ndataset1 = squad[\"train\"]\r\n\r\n\r\n\r\n\r\nimport json\r\n\r\nmybase = [\r\n {\r\n \"id\": \"1\",\r\n \"context\": \"She lives in Nantes\",\r\n \"question\": \"Where does she live?\",\r\n \"answers\": {\r\n \"text\": [\"Nantes\"],\r\n \"answer_start\": [13],\r\n }\r\n }\r\n]\r\n\r\n\r\n\r\n\r\n# Save the data to a JSON file\r\njson_file_path = r\"data\"\r\nwith open(json_file_path, \"w\", encoding= \"utf-8\") as json_file:\r\n json.dump(mybase, json_file, indent=4)\r\n\r\n\r\n\r\n\r\n# Load the JSON file as a dataset\r\ncustom_dataset = load_dataset(\"json\", data_files=json_file_path, features=dataset1.features)\r\n\r\n\r\n# Access the train split\r\ntrain_dataset = custom_dataset[\"train\"]\r\n\r\n\r\nfrom datasets import concatenate_datasets\r\n\r\n\r\n# Concatenate the datasets\r\nconcatenated_dataset = concatenate_datasets([train_dataset, dataset1])\r\n```", "Thank you @mariosasko for your help ! It works !" ]
2023-11-06T14:29:22
2023-11-06T16:50:45
2023-11-06T16:50:45
NONE
null
null
null
### Describe the bug Hello, I'm new here and I need to concatenate the squad dataset with my own dataset i created. I find the following error when i try to do it: Traceback (most recent call last): Cell In[9], line 1 concatenated_dataset = concatenate_datasets([train_dataset, dataset1]) File ~\anaconda3\Lib\site-packages\datasets\combine.py:213 in concatenate_datasets return _concatenate_map_style_datasets(dsets, info=info, split=split, axis=axis) File ~\anaconda3\Lib\site-packages\datasets\arrow_dataset.py:6002 in _concatenate_map_style_datasets _check_if_features_can_be_aligned([dset.features for dset in dsets]) File ~\anaconda3\Lib\site-packages\datasets\features\features.py:2122 in _check_if_features_can_be_aligned raise ValueError( ValueError: The features can't be aligned because the key answers of features {'id': Value(dtype='string', id=None), 'title': Value(dtype='string', id=None), 'context': Value(dtype='string', id=None), 'question': Value(dtype='string', id=None), 'answers': Sequence(feature={'text': Value(dtype='string', id=None), 'answer_start': Value(dtype='int32', id=None)}, length=-1, id=None)} has unexpected type - Sequence(feature={'text': Value(dtype='string', id=None), 'answer_start': Value(dtype='int32', id=None)}, length=-1, id=None) (expected either {'answer_start': Sequence(feature=Value(dtype='int64', id=None), length=-1, id=None), 'text': Value(dtype='string', id=None)} or Value("null"). ### Steps to reproduce the bug ```python from huggingface_hub import notebook_login from datasets import load_dataset notebook_login("mymailadresse", "mypassword") squad = load_dataset("squad", split="train[:5000]") squad = squad.train_test_split(test_size=0.2) dataset1 = squad["train"] import json mybase = [ { "id": "1", "context": "She lives in Nantes", "question": "Where does she live?", "answers": { "text": "Nantes", "answer_start": [13], } } ] # Save the data to a JSON file json_file_path = r"C:\Users\mypath\thefile.json" with open(json_file_path, "w", encoding= "utf-8") as json_file: json.dump(mybase, json_file, indent=4) # Load the JSON file as a dataset custom_dataset = load_dataset("json", data_files=json_file_path) # Access the train split train_dataset = custom_dataset["train"] from datasets import concatenate_datasets # Concatenate the datasets concatenated_dataset = concatenate_datasets([train_dataset, dataset1]) ``` ### Expected behavior I would expect the two datasets to be concatenated without error. The len(dataset1) is equal to 4000 and the len(train_dataset) is equal to 1 so I would exepect concatenated_dataset to be created and having lenght 4001. ### Environment info Python 3.11.4 and using windows Thank you for your help
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6385/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6385/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6384
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6384/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6384/comments
https://api.github.com/repos/huggingface/datasets/issues/6384/events
https://github.com/huggingface/datasets/issues/6384
1,979,117,069
I_kwDODunzps519u4N
6,384
Load the local dataset folder from other place
{ "login": "OrangeSodahub", "id": 54439582, "node_id": "MDQ6VXNlcjU0NDM5NTgy", "avatar_url": "https://avatars.githubusercontent.com/u/54439582?v=4", "gravatar_id": "", "url": "https://api.github.com/users/OrangeSodahub", "html_url": "https://github.com/OrangeSodahub", "followers_url": "https://api.github.com/users/OrangeSodahub/followers", "following_url": "https://api.github.com/users/OrangeSodahub/following{/other_user}", "gists_url": "https://api.github.com/users/OrangeSodahub/gists{/gist_id}", "starred_url": "https://api.github.com/users/OrangeSodahub/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/OrangeSodahub/subscriptions", "organizations_url": "https://api.github.com/users/OrangeSodahub/orgs", "repos_url": "https://api.github.com/users/OrangeSodahub/repos", "events_url": "https://api.github.com/users/OrangeSodahub/events{/privacy}", "received_events_url": "https://api.github.com/users/OrangeSodahub/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "Solved" ]
2023-11-06T13:07:04
2023-11-19T05:42:06
2023-11-19T05:42:05
NONE
null
null
null
This is from https://github.com/huggingface/diffusers/issues/5573
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6384/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6384/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6383
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6383/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6383/comments
https://api.github.com/repos/huggingface/datasets/issues/6383/events
https://github.com/huggingface/datasets/issues/6383
1,978,189,389
I_kwDODunzps516MZN
6,383
imagenet-1k downloads over and over
{ "login": "seann999", "id": 6847529, "node_id": "MDQ6VXNlcjY4NDc1Mjk=", "avatar_url": "https://avatars.githubusercontent.com/u/6847529?v=4", "gravatar_id": "", "url": "https://api.github.com/users/seann999", "html_url": "https://github.com/seann999", "followers_url": "https://api.github.com/users/seann999/followers", "following_url": "https://api.github.com/users/seann999/following{/other_user}", "gists_url": "https://api.github.com/users/seann999/gists{/gist_id}", "starred_url": "https://api.github.com/users/seann999/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/seann999/subscriptions", "organizations_url": "https://api.github.com/users/seann999/orgs", "repos_url": "https://api.github.com/users/seann999/repos", "events_url": "https://api.github.com/users/seann999/events{/privacy}", "received_events_url": "https://api.github.com/users/seann999/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[]
2023-11-06T02:58:58
2023-11-06T06:02:39
2023-11-06T06:02:39
NONE
null
null
null
### Describe the bug What could be causing this? ``` $ python3 Python 3.8.13 (default, Mar 28 2022, 11:38:47) [GCC 7.5.0] :: Anaconda, Inc. on linux Type "help", "copyright", "credits" or "license" for more information. >>> from datasets import load_dataset >>> load_dataset("imagenet-1k") Downloading builder script: 100%|██████████| 4.72k/4.72k [00:00<00:00, 7.51MB/s] Downloading readme: 100%|███████████████████| 85.4k/85.4k [00:00<00:00, 510kB/s] Downloading extra modules: 100%|████████████| 46.4k/46.4k [00:00<00:00, 300kB/s] Downloading data: 100%|████████████████████| 29.1G/29.1G [19:36<00:00, 24.8MB/s] Downloading data: 100%|████████████████████| 29.3G/29.3G [08:38<00:00, 56.5MB/s] Downloading data: 100%|████████████████████| 29.0G/29.0G [09:26<00:00, 51.2MB/s] Downloading data: 100%|████████████████████| 29.2G/29.2G [09:38<00:00, 50.6MB/s] Downloading data: 100%|███████████████████▉| 29.2G/29.2G [09:37<00:00, 44.1MB/s^Downloading data: 0%| | 106M/29.1G [00:05<23:49, 20.3MB/s] ``` ### Steps to reproduce the bug See above commands/code ### Expected behavior imagenet-1k is downloaded ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-6.2.0-34-generic-x86_64-with-glibc2.17 - Python version: 3.8.13 - Huggingface_hub version: 0.15.1 - PyArrow version: 14.0.0 - Pandas version: 1.5.2
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6383/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6383/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6382
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6382/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6382/comments
https://api.github.com/repos/huggingface/datasets/issues/6382/events
https://github.com/huggingface/datasets/issues/6382
1,977,400,799
I_kwDODunzps513L3f
6,382
Add CheXpert dataset for vision
{ "login": "SauravMaheshkar", "id": 61241031, "node_id": "MDQ6VXNlcjYxMjQxMDMx", "avatar_url": "https://avatars.githubusercontent.com/u/61241031?v=4", "gravatar_id": "", "url": "https://api.github.com/users/SauravMaheshkar", "html_url": "https://github.com/SauravMaheshkar", "followers_url": "https://api.github.com/users/SauravMaheshkar/followers", "following_url": "https://api.github.com/users/SauravMaheshkar/following{/other_user}", "gists_url": "https://api.github.com/users/SauravMaheshkar/gists{/gist_id}", "starred_url": "https://api.github.com/users/SauravMaheshkar/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/SauravMaheshkar/subscriptions", "organizations_url": "https://api.github.com/users/SauravMaheshkar/orgs", "repos_url": "https://api.github.com/users/SauravMaheshkar/repos", "events_url": "https://api.github.com/users/SauravMaheshkar/events{/privacy}", "received_events_url": "https://api.github.com/users/SauravMaheshkar/received_events", "type": "User", "site_admin": false }
[ { "id": 1935892871, "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement", "name": "enhancement", "color": "a2eeef", "default": true, "description": "New feature or request" }, { "id": 2067376369, "node_id": "MDU6TGFiZWwyMDY3Mzc2MzY5", "url": "https://api.github.com/repos/huggingface/datasets/labels/dataset%20request", "name": "dataset request", "color": "e99695", "default": false, "description": "Requesting to add a new dataset" } ]
open
false
null
[]
null
[ "Hey @SauravMaheshkar ! Just responded to your email.\r\n\r\n_For transparency, copying part of my response here:_\r\nI agree, it would be really great to have this and other BenchMD datasets easily accessible on the hub.\r\n\r\nI think the main limiting factor is that the ChexPert dataset is currently hosted on the Stanford AIMI Shared Datasets website, with a license that does not permit redistribution IIRC. Thus, I believe we would need to create a [dataset loading script](https://huggingface.co/docs/datasets/image_dataset#loading-script) that would check authentication with the Stanford AIMI site before downloading and extracting the data. \r\n\r\nI've started a HF dataset repo [here](https://huggingface.co/datasets/katielink/CheXpert), in case you want to collaborate on writing up this loading script! I'm also happy to take a stab when I have some more time next week.", "Hey @katielink I would love to try this out. Please guide me.", "Hi @katielink , I would also love to be on board and contribute to this loading script/project if it is still being developed. I'm interested because I personally would like to gain access to the CheXpert dataset and am facing some weird issues, so I'd like to sort it out for me, and potentially others. Please keep me updated and guide me on this as well!!!" ]
2023-11-04T15:36:11
2024-01-10T11:53:52
null
NONE
null
null
null
### Feature request ### Name **CheXpert: A Large Chest Radiograph Dataset with Uncertainty Labels and Expert Comparison** ### Paper https://arxiv.org/abs/1901.07031 ### Data https://stanfordaimi.azurewebsites.net/datasets/8cbd9ed4-2eb9-4565-affc-111cf4f7ebe2 ### Motivation CheXpert is one of the fundamental models in medical image classification and can serve as a viable pre-training dataset for radiology classification or low-scale ablation / exploratory studies. This could also serve as a good pre-training dataset for Kaggle competitions. ### Your contribution Would love to make a PR and pre-process / get this into 🤗
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6382/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6382/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6377
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6377/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6377/comments
https://api.github.com/repos/huggingface/datasets/issues/6377/events
https://github.com/huggingface/datasets/issues/6377
1,973,937,612
I_kwDODunzps51p-XM
6,377
Support pyarrow 14.0.0
{ "login": "albertvillanova", "id": 8515462, "node_id": "MDQ6VXNlcjg1MTU0NjI=", "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "gravatar_id": "", "url": "https://api.github.com/users/albertvillanova", "html_url": "https://github.com/albertvillanova", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "repos_url": "https://api.github.com/users/albertvillanova/repos", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "type": "User", "site_admin": false }
[]
closed
false
{ "login": "albertvillanova", "id": 8515462, "node_id": "MDQ6VXNlcjg1MTU0NjI=", "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "gravatar_id": "", "url": "https://api.github.com/users/albertvillanova", "html_url": "https://github.com/albertvillanova", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "repos_url": "https://api.github.com/users/albertvillanova/repos", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "type": "User", "site_admin": false }
[ { "login": "albertvillanova", "id": 8515462, "node_id": "MDQ6VXNlcjg1MTU0NjI=", "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "gravatar_id": "", "url": "https://api.github.com/users/albertvillanova", "html_url": "https://github.com/albertvillanova", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "repos_url": "https://api.github.com/users/albertvillanova/repos", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "type": "User", "site_admin": false } ]
null
[]
2023-11-02T10:22:08
2023-11-02T15:15:45
2023-11-02T15:15:45
MEMBER
null
null
null
Support pyarrow 14.0.0 by fixing the root cause of: - #6374 and revert: - #6375
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6377/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6377/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6376
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6376/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6376/comments
https://api.github.com/repos/huggingface/datasets/issues/6376/events
https://github.com/huggingface/datasets/issues/6376
1,973,927,468
I_kwDODunzps51p74s
6,376
Caching problem when deleting a dataset
{ "login": "clefourrier", "id": 22726840, "node_id": "MDQ6VXNlcjIyNzI2ODQw", "avatar_url": "https://avatars.githubusercontent.com/u/22726840?v=4", "gravatar_id": "", "url": "https://api.github.com/users/clefourrier", "html_url": "https://github.com/clefourrier", "followers_url": "https://api.github.com/users/clefourrier/followers", "following_url": "https://api.github.com/users/clefourrier/following{/other_user}", "gists_url": "https://api.github.com/users/clefourrier/gists{/gist_id}", "starred_url": "https://api.github.com/users/clefourrier/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/clefourrier/subscriptions", "organizations_url": "https://api.github.com/users/clefourrier/orgs", "repos_url": "https://api.github.com/users/clefourrier/repos", "events_url": "https://api.github.com/users/clefourrier/events{/privacy}", "received_events_url": "https://api.github.com/users/clefourrier/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "Thanks for reporting! Can you also share the error message printed in step 5?", "I did not store it at the time but I'll try to re-do a mwe next week to get it again", "I haven't managed to reproduce this issue using a [notebook](https://colab.research.google.com/drive/1m6eduYun7pFTkigrCJAFgw0BghlbvXIL?usp=sharing) that follows the steps to reproduce the bug. So, I'm closing it.\r\n\r\nBut feel free to re-open it if you have a better reproducer." ]
2023-11-02T10:15:58
2023-12-04T16:53:34
2023-12-04T16:53:33
MEMBER
null
null
null
### Describe the bug Pushing a dataset with n + m features to a repo which was deleted, but contained n features, will fail. ### Steps to reproduce the bug 1. Create a dataset with n features per row 2. `dataset.push_to_hub(YOUR_PATH, SPLIT, token=TOKEN)` 3. Go on the hub, delete the repo at `YOUR_PATH` 4. Update your local dataset to have n + m features per row 5. `dataset.push_to_hub(YOUR_PATH, SPLIT, token=TOKEN)` will fail because of a mismatch in features number ### Expected behavior Step 5 should work or display a message to indicate the cache has not been cleared ### Environment info - `datasets` version: 2.12.0 - Platform: Linux-5.15.0-88-generic-x86_64-with-glibc2.31 - Python version: 3.10.10 - Huggingface_hub version: 0.16.4 - PyArrow version: 11.0.0 - Pandas version: 2.0.0
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6376/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6376/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6374
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6374/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6374/comments
https://api.github.com/repos/huggingface/datasets/issues/6374/events
https://github.com/huggingface/datasets/issues/6374
1,973,857,428
I_kwDODunzps51pqyU
6,374
CI is broken: TypeError: Couldn't cast array
{ "login": "albertvillanova", "id": 8515462, "node_id": "MDQ6VXNlcjg1MTU0NjI=", "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "gravatar_id": "", "url": "https://api.github.com/users/albertvillanova", "html_url": "https://github.com/albertvillanova", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "repos_url": "https://api.github.com/users/albertvillanova/repos", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "type": "User", "site_admin": false }
[]
closed
false
{ "login": "albertvillanova", "id": 8515462, "node_id": "MDQ6VXNlcjg1MTU0NjI=", "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "gravatar_id": "", "url": "https://api.github.com/users/albertvillanova", "html_url": "https://github.com/albertvillanova", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "repos_url": "https://api.github.com/users/albertvillanova/repos", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "type": "User", "site_admin": false }
[ { "login": "albertvillanova", "id": 8515462, "node_id": "MDQ6VXNlcjg1MTU0NjI=", "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "gravatar_id": "", "url": "https://api.github.com/users/albertvillanova", "html_url": "https://github.com/albertvillanova", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "repos_url": "https://api.github.com/users/albertvillanova/repos", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "type": "User", "site_admin": false } ]
null
[]
2023-11-02T09:37:06
2023-11-02T10:11:20
2023-11-02T10:11:20
MEMBER
null
null
null
See: https://github.com/huggingface/datasets/actions/runs/6730567226/job/18293518039 ``` FAILED tests/test_table.py::test_cast_sliced_fixed_size_array_to_features - TypeError: Couldn't cast array of type fixed_size_list<item: int32>[3] to Sequence(feature=Value(dtype='int64', id=None), length=3, id=None) ```
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6374/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6374/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6371
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6371/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6371/comments
https://api.github.com/repos/huggingface/datasets/issues/6371/events
https://github.com/huggingface/datasets/issues/6371
1,972,807,579
I_kwDODunzps51lqeb
6,371
`Dataset.from_generator` should not try to download from HF GCS
{ "login": "yundai424", "id": 43726198, "node_id": "MDQ6VXNlcjQzNzI2MTk4", "avatar_url": "https://avatars.githubusercontent.com/u/43726198?v=4", "gravatar_id": "", "url": "https://api.github.com/users/yundai424", "html_url": "https://github.com/yundai424", "followers_url": "https://api.github.com/users/yundai424/followers", "following_url": "https://api.github.com/users/yundai424/following{/other_user}", "gists_url": "https://api.github.com/users/yundai424/gists{/gist_id}", "starred_url": "https://api.github.com/users/yundai424/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yundai424/subscriptions", "organizations_url": "https://api.github.com/users/yundai424/orgs", "repos_url": "https://api.github.com/users/yundai424/repos", "events_url": "https://api.github.com/users/yundai424/events{/privacy}", "received_events_url": "https://api.github.com/users/yundai424/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "Indeed, setting `try_from_gcs` to `False` makes sense for `from_generator`.\r\n\r\nWe plan to deprecate and remove `try_from_hf_gcs` soon, as we can use Hub for file hosting now, but this is a good temporary fix.\r\n" ]
2023-11-01T17:36:17
2023-11-02T15:52:10
2023-11-02T15:52:10
CONTRIBUTOR
null
null
null
### Describe the bug When using [`Dataset.from_generator`](https://github.com/huggingface/datasets/blob/c9c1166e1cf81d38534020f9c167b326585339e5/src/datasets/arrow_dataset.py#L1072) with `streaming=False`, the internal logic will call [`download_and_prepare`](https://github.com/huggingface/datasets/blob/main/src/datasets/io/generator.py#L47) which will attempt to download from HF GCS which is redundant, because user has already provided the generator from which the data should be drawn. If someone attempts to call `Dataset.from_generator` from an environment that doesn't have external internet access (for example internal production machine) and doesn't set `HF_DATASETS_OFFLINE=1`, this will result in process being stuck at building connection. ### Steps to reproduce the bug ```python import datasets def gen(): for _ in range(100): yield {"text": "dummy text"} dataset = datasets.Dataset.from_generator(gen) ``` A minimum example executed on any environment that doesn't have access to HF GCS can result in the error ### Expected behavior `try_from_hf_gcs` should be set to False here https://github.com/huggingface/datasets/blob/c9c1166e1cf81d38534020f9c167b326585339e5/src/datasets/io/generator.py#L51 ### Environment info - `datasets` version: 2.14.4 - Platform: Linux-3.10.0-1160.90.1.el7.x86_64-x86_64-with-glibc2.17 - Python version: 3.10.12 - Huggingface_hub version: 0.17.1 - PyArrow version: 12.0.1 - Pandas version: 2.0.3
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6371/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6371/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6370
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6370/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6370/comments
https://api.github.com/repos/huggingface/datasets/issues/6370/events
https://github.com/huggingface/datasets/issues/6370
1,972,073,909
I_kwDODunzps51i3W1
6,370
TensorDataset format does not work with Trainer from transformers
{ "login": "jinzzasol", "id": 49014051, "node_id": "MDQ6VXNlcjQ5MDE0MDUx", "avatar_url": "https://avatars.githubusercontent.com/u/49014051?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jinzzasol", "html_url": "https://github.com/jinzzasol", "followers_url": "https://api.github.com/users/jinzzasol/followers", "following_url": "https://api.github.com/users/jinzzasol/following{/other_user}", "gists_url": "https://api.github.com/users/jinzzasol/gists{/gist_id}", "starred_url": "https://api.github.com/users/jinzzasol/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jinzzasol/subscriptions", "organizations_url": "https://api.github.com/users/jinzzasol/orgs", "repos_url": "https://api.github.com/users/jinzzasol/repos", "events_url": "https://api.github.com/users/jinzzasol/events{/privacy}", "received_events_url": "https://api.github.com/users/jinzzasol/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "I figured it out. I found that `Trainer` does not work with TensorDataset even though the document says it uses it. Instead, I ended up creating a dictionary and converting it to a dataset using `dataset.Dataset.from_dict()`.\r\n\r\nI will leave this post open for a while. If someone knows a better approach, please leave a comment.", "Only issues directly related to the HF datasets library should be reported here. ~So, I'm transferring this issue to the `transformers` repo.~ I'm not a `transformers` maintainer, so GitHub doesn't let me transfer it there :(. This means you need to do it manually." ]
2023-11-01T10:09:54
2023-11-29T16:31:08
2023-11-29T16:31:08
NONE
null
null
null
### Describe the bug The model was built to do fine tunning on BERT model for relation extraction. trainer.train() returns an error message ```TypeError: vars() argument must have __dict__ attribute``` when it has `train_dataset` generated from `torch.utils.data.TensorDataset` However, in the document, the required data format is `torch.utils.data.TensorDataset`. ![image](https://github.com/huggingface/datasets/assets/49014051/36fa34ac-3127-4c64-9580-9ab736136d83) Transformers trainer is supposed to accept the train_dataset in the format of torch.utils.data.TensorDataset, but it returns error message *"TypeError: vars() argument must have __dict__ attribute"* ``` --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-30-5df728c929a2> in <cell line: 1>() ----> 1 trainer.train() 2 trainer.evaluate(test_dataset) 9 frames /usr/local/lib/python3.10/dist-packages/transformers/data/data_collator.py in <listcomp>(.0) 107 108 if not isinstance(features[0], Mapping): --> 109 features = [vars(f) for f in features] 110 first = features[0] 111 batch = {} TypeError: vars() argument must have __dict__ attribute ``` ### Steps to reproduce the bug Create train_dataset using `torch.utils.data.TensorDataset`, for instance, ```train_dataset = torch.utils.data.TensorDataset(train_input_ids, train_attention_masks, train_labels)``` Feed this `train_dataset` to your trainer and run trainer.train ``` trainer = Trainer(model, training_args, train_dataset=train_dataset, eval_dataset=dev_dataset, compute_metrics=compute_metrics, ) ``` ### Expected behavior Trainer should start training ### Environment info It is running on Google Colab - `datasets` version: 2.14.6 - Platform: Linux-5.15.120+-x86_64-with-glibc2.35 - Python version: 3.10.12 - Huggingface_hub version: 0.17.3 - PyArrow version: 9.0.0 - Pandas version: 1.5.3
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6370/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6370/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6369
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6369/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6369/comments
https://api.github.com/repos/huggingface/datasets/issues/6369/events
https://github.com/huggingface/datasets/issues/6369
1,971,794,108
I_kwDODunzps51hzC8
6,369
Multi process map did not load cache file correctly
{ "login": "enze5088", "id": 14285786, "node_id": "MDQ6VXNlcjE0Mjg1Nzg2", "avatar_url": "https://avatars.githubusercontent.com/u/14285786?v=4", "gravatar_id": "", "url": "https://api.github.com/users/enze5088", "html_url": "https://github.com/enze5088", "followers_url": "https://api.github.com/users/enze5088/followers", "following_url": "https://api.github.com/users/enze5088/following{/other_user}", "gists_url": "https://api.github.com/users/enze5088/gists{/gist_id}", "starred_url": "https://api.github.com/users/enze5088/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/enze5088/subscriptions", "organizations_url": "https://api.github.com/users/enze5088/orgs", "repos_url": "https://api.github.com/users/enze5088/repos", "events_url": "https://api.github.com/users/enze5088/events{/privacy}", "received_events_url": "https://api.github.com/users/enze5088/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "The inconsistency may be caused by the usage of \"update_fingerprint\" and setting \"trust_remote_code\" to \"True.\"\r\nWhen the tokenizer employs \"trust_remote_code,\" the behavior of the map function varies with each code execution. Even if the remote code of the tokenizer remains the same, the result of \"asher.hexdigest()\" is found to be inconsistent each time.\r\nThis may result in different processes executing multiple maps\r\n![1698841094290](https://github.com/huggingface/datasets/assets/14285786/21fc3c65-e9fd-4a79-b12e-a1d4b9c6cf32)\r\n![1698841117416](https://github.com/huggingface/datasets/assets/14285786/c3e5a530-54d2-4ae6-b902-ce9f85de373b)\r\n\r\n", "The issue may be related to problems previously discussed in GitHub issues [#3847](https://github.com/huggingface/datasets/issues/3847) and [#6318](https://github.com/huggingface/datasets/pull/6318). \r\nThis arises from the fact that tokenizer.tokens_trie._tokens is an unordered set, leading to varying hash results:\r\n`value = hash_bytes(dumps(tokenizer.tokens_trie._tokens))`\r\nConsequently, this results in different outcomes each time for:\r\n`new_fingerprint = update_fingerprint(datasets._fingerprint, transform, kwargs_for_fingerprint)`\r\n\r\nTo address this issue, it's essential to make `Trie._tokens` a deterministic set while ensuring a consistent order after the final update of `_tokens`.\r\n", "We now sort `set` and `dict` items to make their hashes deterministic (install from `main` with `pip install git+https://github.com/huggingface/datasets` to test this). Consequently, this should also make the `tokenizer.tokens_trie`'s hash deterministic. Feel free to re-open the issue if this is not the case." ]
2023-11-01T06:36:54
2023-11-30T16:04:46
2023-11-30T16:04:45
NONE
null
null
null
### Describe the bug When I was training model on Multiple GPUs by DDP, the dataset is tokenized multiple times after main process. ![1698820541284](https://github.com/huggingface/datasets/assets/14285786/0b2fe054-54d8-4e00-96e6-6ca5b69e662b) ![1698820501568](https://github.com/huggingface/datasets/assets/14285786/dd62bf6f-a58f-41bf-9848-ea4fb3b62b9b) Code is modified from [run_clm.py](https://github.com/huggingface/transformers/blob/7d8ff3629b2725ec43ace99c1a6e87ac1978d433/examples/pytorch/language-modeling/run_clm.py#L484) ### Steps to reproduce the bug ``` block_size = data_args.block_size IGNORE_INDEX = -100 Ignore_Input = False def tokenize_function(examples): sources = [] targets = [] for instruction, inputs, output in zip(examples['instruction'], examples['input'], examples['output']): source = instruction + inputs target = f"{output}{tokenizer.eos_token}" sources.append(source) targets.append(target) tokenized_sources = tokenizer(sources, return_attention_mask=False) tokenized_targets = tokenizer(targets, return_attention_mask=False, add_special_tokens=False ) all_input_ids = [] all_labels = [] for s, t in zip(tokenized_sources['input_ids'], tokenized_targets['input_ids']): if len(s) > block_size and Ignore_Input == False: # print(s) continue input_ids = torch.LongTensor(s + t)[:block_size] if Ignore_Input: labels = torch.LongTensor([IGNORE_INDEX] * len(s) + t)[:block_size] else: labels = input_ids assert len(input_ids) == len(labels) all_input_ids.append(input_ids) all_labels.append(labels) results = { 'input_ids': all_input_ids, 'labels': all_labels, } return results with training_args.main_process_first(desc="dataset map tokenization ", local=False): # print('local_rank',training_args.local_rank) if not data_args.streaming: tokenized_datasets = raw_datasets.map( tokenize_function, batched=True, num_proc=data_args.preprocessing_num_workers, remove_columns=column_names, load_from_cache_file=not data_args.overwrite_cache, desc="Running tokenizer on dataset ", ) else: tokenized_datasets = raw_datasets.map( tokenize_function, batched=True, remove_columns=column_names, desc="Running tokenizer on dataset " ) ``` ### Expected behavior This code should only tokenize the dataset in the main process, and the other processes load the dataset after waiting ### Environment info transformers == 4.34.1 datasets == 2.14.5
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6369/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6369/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6366
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6366/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6366/comments
https://api.github.com/repos/huggingface/datasets/issues/6366/events
https://github.com/huggingface/datasets/issues/6366
1,970,213,490
I_kwDODunzps51bxJy
6,366
with_format() function returns bytes instead of PIL images even when image column is not part of "columns"
{ "login": "leot13", "id": 17809020, "node_id": "MDQ6VXNlcjE3ODA5MDIw", "avatar_url": "https://avatars.githubusercontent.com/u/17809020?v=4", "gravatar_id": "", "url": "https://api.github.com/users/leot13", "html_url": "https://github.com/leot13", "followers_url": "https://api.github.com/users/leot13/followers", "following_url": "https://api.github.com/users/leot13/following{/other_user}", "gists_url": "https://api.github.com/users/leot13/gists{/gist_id}", "starred_url": "https://api.github.com/users/leot13/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/leot13/subscriptions", "organizations_url": "https://api.github.com/users/leot13/orgs", "repos_url": "https://api.github.com/users/leot13/repos", "events_url": "https://api.github.com/users/leot13/events{/privacy}", "received_events_url": "https://api.github.com/users/leot13/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "Thanks for reporting! I've opened a PR with a fix." ]
2023-10-31T11:10:48
2023-11-02T14:21:17
2023-11-02T14:21:17
NONE
null
null
null
### Describe the bug When using the with_format() function on a dataset containing images, even if the image column is not part of the columns provided in the function, its type will be changed to bytes. Here is a minimal reproduction of the bug: https://colab.research.google.com/drive/1hyaOspgyhB41oiR1-tXE3k_gJCdJUQCf?usp=sharing ### Steps to reproduce the bug 1. Load the image dataset 2. apply with_format(columns=["text"]) 3. Check the type of images in the "image" column before and after applying with_format ### Expected behavior The type should stay the same, but it does not ### Environment info datasets==2.14.6
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6366/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6366/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6365
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6365/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6365/comments
https://api.github.com/repos/huggingface/datasets/issues/6365/events
https://github.com/huggingface/datasets/issues/6365
1,970,140,392
I_kwDODunzps51bfTo
6,365
Parquet size grows exponential for categorical data
{ "login": "aseganti", "id": 82567957, "node_id": "MDQ6VXNlcjgyNTY3OTU3", "avatar_url": "https://avatars.githubusercontent.com/u/82567957?v=4", "gravatar_id": "", "url": "https://api.github.com/users/aseganti", "html_url": "https://github.com/aseganti", "followers_url": "https://api.github.com/users/aseganti/followers", "following_url": "https://api.github.com/users/aseganti/following{/other_user}", "gists_url": "https://api.github.com/users/aseganti/gists{/gist_id}", "starred_url": "https://api.github.com/users/aseganti/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/aseganti/subscriptions", "organizations_url": "https://api.github.com/users/aseganti/orgs", "repos_url": "https://api.github.com/users/aseganti/repos", "events_url": "https://api.github.com/users/aseganti/events{/privacy}", "received_events_url": "https://api.github.com/users/aseganti/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "Wrong repo." ]
2023-10-31T10:29:02
2023-10-31T10:49:17
2023-10-31T10:49:17
NONE
null
null
null
### Describe the bug It seems that when saving a data frame with a categorical column inside the size can grow exponentially. This seems to happen because when we save the categorical data to parquet, we are saving the data + all the categories existing in the original data. This happens even when the categories are not present in the original data. ### Steps to reproduce the bug To reproduce the bug, it is enough to run this script: ``` import pandas as pd import os if __name__ == "__main__": for n in [10, 1e2, 1e3, 1e4, 1e5]: for n_col in [1, 10, 100, 1000, 10000]: input = pd.DataFrame([{"{i}": f"{i}_cat" for col in range(n_col)} for i in range(int(n))]) input.iloc[0:100].to_parquet("a.parquet") for col in input.columns: input[col] = input[col].astype("category") input.iloc[0:100].to_parquet("b.parquet") a_size_mb = os.stat("a.parquet").st_size / (1024 * 1024) b_size_mb = os.stat("b.parquet").st_size / (1024 * 1024) print(f"{n} {n_col} {a_size_mb} {b_size_mb} {100*b_size_mb/a_size_mb:.2f}") ``` That produces this output: <img width="464" alt="Screenshot 2023-10-31 at 11 25 25" src="https://github.com/huggingface/datasets/assets/82567957/2b8a9284-7f9e-4c10-a006-0a27236ebd15"> ### Expected behavior In my opinion either: 1. The two file should have (almost) the same size 2. There should be warning telling the user that such difference in size is possible ### Environment info Python 3.8.18 pandas==2.0.3 numpy==1.24.4
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6365/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6365/timeline
null
not_planned
https://api.github.com/repos/huggingface/datasets/issues/6364
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6364/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6364/comments
https://api.github.com/repos/huggingface/datasets/issues/6364/events
https://github.com/huggingface/datasets/issues/6364
1,969,136,106
I_kwDODunzps51XqHq
6,364
ArrowNotImplementedError: Unsupported cast from string to list using function cast_list
{ "login": "divyakrishna-devisetty", "id": 32887094, "node_id": "MDQ6VXNlcjMyODg3MDk0", "avatar_url": "https://avatars.githubusercontent.com/u/32887094?v=4", "gravatar_id": "", "url": "https://api.github.com/users/divyakrishna-devisetty", "html_url": "https://github.com/divyakrishna-devisetty", "followers_url": "https://api.github.com/users/divyakrishna-devisetty/followers", "following_url": "https://api.github.com/users/divyakrishna-devisetty/following{/other_user}", "gists_url": "https://api.github.com/users/divyakrishna-devisetty/gists{/gist_id}", "starred_url": "https://api.github.com/users/divyakrishna-devisetty/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/divyakrishna-devisetty/subscriptions", "organizations_url": "https://api.github.com/users/divyakrishna-devisetty/orgs", "repos_url": "https://api.github.com/users/divyakrishna-devisetty/repos", "events_url": "https://api.github.com/users/divyakrishna-devisetty/events{/privacy}", "received_events_url": "https://api.github.com/users/divyakrishna-devisetty/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "You can use the following code to load this CSV with the list values preserved:\r\n```python\r\nfrom datasets import load_dataset\r\nimport ast\r\n\r\nconverters = {\r\n \"contexts\" : ast.literal_eval,\r\n \"ground_truths\" : ast.literal_eval,\r\n}\r\n\r\nds = load_dataset(\"csv\", data_files=\"golden_dataset.csv\", converters=converters)\r\n```", "Thank you! it worked :)" ]
2023-10-30T20:14:01
2023-10-31T19:21:23
2023-10-31T19:21:23
NONE
null
null
null
Hi, I am trying to load a local csv dataset(similar to explodinggradients_fiqa) using load_dataset. When I try to pass features, I am facing the mentioned issue. CSV Data sample(golden_dataset.csv): Question | Context | answer | groundtruth "what is abc?" | "abc is this and that" | "abc is this " | "abc is this and that" ``` import csv # built it based on https://huggingface.co/datasets/explodinggradients/fiqa/viewer/ragas_eval?row=0 mydict = [ {'question' : "what is abc?", 'contexts': ["abc is this and that"], 'answer': "abc is this " , 'groundtruth': ["abc is this and that"]}, {'question' : "what is abc?", 'contexts': ["abc is this and that"], 'answer': "abc is this " , 'groundtruth': ["abc is this and that"]}, {'question' : "what is abc?", 'contexts': ["abc is this and that"], 'answer': "abc is this " , 'groundtruth': ["abc is this and that"]} ] fields = ['question', 'contexts', 'answer', 'ground_truths'] with open('golden_dataset.csv', 'w', newline='\n') as file: writer = csv.DictWriter(file, fieldnames = fields) writer.writeheader() for row in mydict: writer.writerow(row) ``` Retrieved dataset: DatasetDict({ train: Dataset({ features: ['question', 'contexts', 'answer', 'ground_truths'], num_rows: 1 }) }) Code to reproduce issue: ``` from datasets import load_dataset, Features, Sequence, Value encode_features = Features( { "question": Value(dtype='string', id=0), "contexts": Sequence(feature=Value(dtype='string', id=1)), "answer": Value(dtype='string', id=2), "ground_truths": Sequence(feature=Value(dtype='string',id=3)), } ) eval_dataset = load_dataset('csv', data_files='/golden_dataset.csv', features = encode_features ) ``` Error trace: ``` --------------------------------------------------------------------------- ArrowNotImplementedError Traceback (most recent call last) File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/builder.py:1925, in ArrowBasedBuilder._prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, job_id) 1924 _time = time.time() -> 1925 for _, table in generator: 1926 if max_shard_size is not None and writer._num_bytes > max_shard_size: File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/packaged_modules/csv/csv.py:192, in Csv._generate_tables(self, files) 189 # Uncomment for debugging (will print the Arrow table size and elements) 190 # logger.warning(f"pa_table: {pa_table} num rows: {pa_table.num_rows}") 191 # logger.warning('\n'.join(str(pa_table.slice(i, 1).to_pydict()) for i in range(pa_table.num_rows))) --> 192 yield (file_idx, batch_idx), self._cast_table(pa_table) 193 except ValueError as e: File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/packaged_modules/csv/csv.py:167, in Csv._cast_table(self, pa_table) 165 if all(not require_storage_cast(feature) for feature in self.config.features.values()): 166 # cheaper cast --> 167 pa_table = pa.Table.from_arrays([pa_table[field.name] for field in schema], schema=schema) 168 else: 169 # more expensive cast; allows str <-> int/float or str to Audio for example File ~/anaconda3/envs/python3/lib/python3.10/site-packages/pyarrow/table.pxi:3781, in pyarrow.lib.Table.from_arrays() File ~/anaconda3/envs/python3/lib/python3.10/site-packages/pyarrow/table.pxi:1449, in pyarrow.lib._sanitize_arrays() File ~/anaconda3/envs/python3/lib/python3.10/site-packages/pyarrow/array.pxi:354, in pyarrow.lib.asarray() File ~/anaconda3/envs/python3/lib/python3.10/site-packages/pyarrow/table.pxi:551, in pyarrow.lib.ChunkedArray.cast() File ~/anaconda3/envs/python3/lib/python3.10/site-packages/pyarrow/compute.py:400, in cast(arr, target_type, safe, options, memory_pool) 399 options = CastOptions.safe(target_type) --> 400 return call_function("cast", [arr], options, memory_pool) File ~/anaconda3/envs/python3/lib/python3.10/site-packages/pyarrow/_compute.pyx:572, in pyarrow._compute.call_function() File ~/anaconda3/envs/python3/lib/python3.10/site-packages/pyarrow/_compute.pyx:367, in pyarrow._compute.Function.call() File ~/anaconda3/envs/python3/lib/python3.10/site-packages/pyarrow/error.pxi:144, in pyarrow.lib.pyarrow_internal_check_status() File ~/anaconda3/envs/python3/lib/python3.10/site-packages/pyarrow/error.pxi:121, in pyarrow.lib.check_status() ArrowNotImplementedError: Unsupported cast from string to list using function cast_list The above exception was the direct cause of the following exception: DatasetGenerationError Traceback (most recent call last) Cell In[57], line 1 ----> 1 eval_dataset = load_dataset('csv', data_files='/golden_dataset.csv', features = encode_features ) File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/load.py:2153, 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) 2150 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES 2152 # Download and prepare data -> 2153 builder_instance.download_and_prepare( 2154 download_config=download_config, 2155 download_mode=download_mode, 2156 verification_mode=verification_mode, 2157 try_from_hf_gcs=try_from_hf_gcs, 2158 num_proc=num_proc, 2159 storage_options=storage_options, 2160 ) 2162 # Build dataset for splits 2163 keep_in_memory = ( 2164 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size) 2165 ) File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/builder.py:954, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, verification_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, num_proc, storage_options, **download_and_prepare_kwargs) 952 if num_proc is not None: 953 prepare_split_kwargs["num_proc"] = num_proc --> 954 self._download_and_prepare( 955 dl_manager=dl_manager, 956 verification_mode=verification_mode, 957 **prepare_split_kwargs, 958 **download_and_prepare_kwargs, 959 ) 960 # Sync info 961 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values()) File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/builder.py:1049, in DatasetBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs) 1045 split_dict.add(split_generator.split_info) 1047 try: 1048 # Prepare split will record examples associated to the split -> 1049 self._prepare_split(split_generator, **prepare_split_kwargs) 1050 except OSError as e: 1051 raise OSError( 1052 "Cannot find data file. " 1053 + (self.manual_download_instructions or "") 1054 + "\nOriginal error:\n" 1055 + str(e) 1056 ) from None File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/builder.py:1813, in ArrowBasedBuilder._prepare_split(self, split_generator, file_format, num_proc, max_shard_size) 1811 job_id = 0 1812 with pbar: -> 1813 for job_id, done, content in self._prepare_split_single( 1814 gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args 1815 ): 1816 if done: 1817 result = content File ~/anaconda3/envs/python3/lib/python3.10/site-packages/datasets/builder.py:1958, in ArrowBasedBuilder._prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, job_id) 1956 if isinstance(e, SchemaInferenceError) and e.__context__ is not None: 1957 e = e.__context__ -> 1958 raise DatasetGenerationError("An error occurred while generating the dataset") from e 1960 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths) DatasetGenerationError: An error occurred while generating the dataset ``` Environment Info: datasets version: 2.14.5 Python version: 3.10.8 PyArrow version: 12.0.1 Pandas version: 2.0.3 I have also tried to load dataset first and then use cast_column, or save_to_disk and load_from_disk.
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6364/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6364/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6363
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6363/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6363/comments
https://api.github.com/repos/huggingface/datasets/issues/6363/events
https://github.com/huggingface/datasets/issues/6363
1,968,891,277
I_kwDODunzps51WuWN
6,363
dataset.transform() hangs indefinitely while finetuning the stable diffusion XL
{ "login": "bhosalems", "id": 10846405, "node_id": "MDQ6VXNlcjEwODQ2NDA1", "avatar_url": "https://avatars.githubusercontent.com/u/10846405?v=4", "gravatar_id": "", "url": "https://api.github.com/users/bhosalems", "html_url": "https://github.com/bhosalems", "followers_url": "https://api.github.com/users/bhosalems/followers", "following_url": "https://api.github.com/users/bhosalems/following{/other_user}", "gists_url": "https://api.github.com/users/bhosalems/gists{/gist_id}", "starred_url": "https://api.github.com/users/bhosalems/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/bhosalems/subscriptions", "organizations_url": "https://api.github.com/users/bhosalems/orgs", "repos_url": "https://api.github.com/users/bhosalems/repos", "events_url": "https://api.github.com/users/bhosalems/events{/privacy}", "received_events_url": "https://api.github.com/users/bhosalems/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "I think the code hangs on the `accelerator.main_process_first()` context manager exit. To verify this, you can append a print statement to the end of the `accelerator.main_process_first()` block. \r\n\r\n\r\nIf the problem is in `with_transform`, it would help if you could share the error stack trace printed when you interrupt the process (while it hangs)", "@bhosalems Were you able to fix that ? I face this issue as well", "@matankley No I am not able to resolve this issue yet.", "@mariosasko yes the problem seems to be to exit from accelerator.main_process_first(). Is there any known problem?", "NCCL debug info I get below output, if it helps.\r\n```\r\n11/09/2023 13:36:44 - INFO - __main__ - Distributed environment: MULTI_GPU Backend: nccl\r\nNum processes: 2\r\nProcess index: 1\r\nLocal process index: 1\r\nDevice: cuda:1\r\n\r\nMixed precision type: fp16\r\n\r\nDetected kernel version 5.4.0, which is below the recommended minimum of 5.5.0; this can cause the process to hang. It is recommended to upgrade the kernel to the minimum version or higher.\r\n11/09/2023 13:36:44 - INFO - __main__ - Distributed environment: MULTI_GPU Backend: nccl\r\nNum processes: 2\r\nProcess index: 0\r\nLocal process index: 0\r\nDevice: cuda:0\r\n\r\nMixed precision type: fp16\r\n\r\n{'timestep_spacing', 'thresholding', 'variance_type', 'clip_sample_range', 'prediction_type', 'dynamic_thresholding_ratio', 'sample_max_value'} was not found in config. Values will be initialized to default values.\r\n{'norm_num_groups', 'force_upcast'} was not found in config. Values will be initialized to default values.\r\n{'num_attention_heads', 'projection_class_embeddings_input_dim', 'addition_embed_type_num_heads', 'mid_block_only_cross_attention', 'addition_embed_type', 'num_class_embeds', 'upcast_attention', 'cross_attention_norm', 'addition_time_embed_dim', 'time_embedding_dim', 'class_embeddings_concat', 'encoder_hid_dim', 'encoder_hid_dim_type', 'resnet_out_scale_factor', 'attention_type', 'conv_out_kernel', 'only_cross_attention', 'resnet_time_scale_shift', 'resnet_skip_time_act', 'reverse_transformer_layers_per_block', 'conv_in_kernel', 'time_cond_proj_dim', 'use_linear_projection', 'mid_block_type', 'time_embedding_act_fn', 'dropout', 'timestep_post_act', 'dual_cross_attention', 'class_embed_type', 'transformer_layers_per_block', 'time_embedding_type'} was not found in config. Values will be initialized to default values.\r\n{'num_attention_heads', 'projection_class_embeddings_input_dim', 'addition_embed_type_num_heads', 'mid_block_only_cross_attention', 'addition_embed_type', 'num_class_embeds', 'upcast_attention', 'cross_attention_norm', 'addition_time_embed_dim', 'time_embedding_dim', 'class_embeddings_concat', 'encoder_hid_dim', 'encoder_hid_dim_type', 'resnet_out_scale_factor', 'attention_type', 'conv_out_kernel', 'only_cross_attention', 'resnet_time_scale_shift', 'resnet_skip_time_act', 'reverse_transformer_layers_per_block', 'conv_in_kernel', 'time_cond_proj_dim', 'use_linear_projection', 'mid_block_type', 'time_embedding_act_fn', 'dropout', 'timestep_post_act', 'dual_cross_attention', 'class_embed_type', 'transformer_layers_per_block', 'time_embedding_type'} was not found in config. Values will be initialized to default values.\r\ndeepbull5:1311249:1311249 [0] NCCL INFO Bootstrap : Using enp194s0f0:128.205.43.171<0>\r\ndeepbull5:1311249:1311249 [0] NCCL INFO NET/Plugin : No plugin found (libnccl-net.so), using internal implementation\r\ndeepbull5:1311249:1311249 [0] NCCL INFO cudaDriverVersion 11070\r\nNCCL version 2.14.3+cuda11.7\r\ndeepbull5:1311250:1311250 [1] NCCL INFO cudaDriverVersion 11070\r\ndeepbull5:1311249:1311365 [0] NCCL INFO NET/IB : No device found.\r\ndeepbull5:1311249:1311365 [0] NCCL INFO NET/Socket : Using [0]enp194s0f0:128.205.43.171<0>\r\ndeepbull5:1311249:1311365 [0] NCCL INFO Using network Socket\r\ndeepbull5:1311250:1311250 [1] NCCL INFO Bootstrap : Using enp194s0f0:128.205.43.171<0>\r\ndeepbull5:1311250:1311250 [1] NCCL INFO NET/Plugin : No plugin found (libnccl-net.so), using internal implementation\r\ndeepbull5:1311250:1311366 [1] NCCL INFO NET/IB : No device found.\r\ndeepbull5:1311250:1311366 [1] NCCL INFO NET/Socket : Using [0]enp194s0f0:128.205.43.171<0>\r\ndeepbull5:1311250:1311366 [1] NCCL INFO Using network Socket\r\ndeepbull5:1311250:1311366 [1] NCCL INFO Setting affinity for GPU 1 to ff,ffff0000,00ffffff\r\ndeepbull5:1311249:1311365 [0] NCCL INFO Setting affinity for GPU 0 to ff,ffff0000,00ffffff\r\ndeepbull5:1311249:1311365 [0] NCCL INFO Channel 00/04 : 0 1\r\ndeepbull5:1311250:1311366 [1] NCCL INFO Trees [0] -1/-1/-1->1->0 [1] 0/-1/-1->1->-1 [2] -1/-1/-1->1->0 [3] 0/-1/-1->1->-1\r\ndeepbull5:1311249:1311365 [0] NCCL INFO Channel 01/04 : 0 1\r\ndeepbull5:1311249:1311365 [0] NCCL INFO Channel 02/04 : 0 1\r\ndeepbull5:1311249:1311365 [0] NCCL INFO Channel 03/04 : 0 1\r\ndeepbull5:1311249:1311365 [0] NCCL INFO Trees [0] 1/-1/-1->0->-1 [1] -1/-1/-1->0->1 [2] 1/-1/-1->0->-1 [3] -1/-1/-1->0->1\r\ndeepbull5:1311249:1311365 [0] NCCL INFO Channel 00/0 : 0[1000] -> 1[24000] via P2P/IPC\r\ndeepbull5:1311250:1311366 [1] NCCL INFO Channel 00/0 : 1[24000] -> 0[1000] via P2P/IPC\r\ndeepbull5:1311249:1311365 [0] NCCL INFO Channel 01/0 : 0[1000] -> 1[24000] via P2P/IPC\r\ndeepbull5:1311250:1311366 [1] NCCL INFO Channel 01/0 : 1[24000] -> 0[1000] via P2P/IPC\r\ndeepbull5:1311250:1311366 [1] NCCL INFO Channel 02/0 : 1[24000] -> 0[1000] via P2P/IPC\r\ndeepbull5:1311249:1311365 [0] NCCL INFO Channel 02/0 : 0[1000] -> 1[24000] via P2P/IPC\r\ndeepbull5:1311250:1311366 [1] NCCL INFO Channel 03/0 : 1[24000] -> 0[1000] via P2P/IPC\r\ndeepbull5:1311249:1311365 [0] NCCL INFO Channel 03/0 : 0[1000] -> 1[24000] via P2P/IPC\r\ndeepbull5:1311249:1311365 [0] NCCL INFO Connected all rings\r\ndeepbull5:1311249:1311365 [0] NCCL INFO Connected all trees\r\ndeepbull5:1311249:1311365 [0] NCCL INFO threadThresholds 8/8/64 | 16/8/64 | 512 | 512\r\ndeepbull5:1311249:1311365 [0] NCCL INFO 4 coll channels, 4 p2p channels, 2 p2p channels per peer\r\ndeepbull5:1311250:1311366 [1] NCCL INFO Connected all rings\r\ndeepbull5:1311250:1311366 [1] NCCL INFO Connected all trees\r\ndeepbull5:1311250:1311366 [1] NCCL INFO threadThresholds 8/8/64 | 16/8/64 | 512 | 512\r\ndeepbull5:1311250:1311366 [1] NCCL INFO 4 coll channels, 4 p2p channels, 2 p2p channels per peer\r\ndeepbull5:1311249:1311365 [0] NCCL INFO comm 0x88a84ee0 rank 0 nranks 2 cudaDev 0 busId 1000 - Init COMPLETE\r\ndeepbull5:1311250:1311366 [1] NCCL INFO comm 0x89a42f60 rank 1 nranks 2 cudaDev 1 busId 24000 - Init COMPLETE\r\n\r\n```", "Maybe @muellerzr can help as an `accelerate` maintainer.", "I don't know what the issue was, but after going through the thread here I loved the issue with https://github.com/huggingface/accelerate/issues/314#issuecomment-1565259831" ]
2023-10-30T17:34:05
2023-11-22T00:29:21
2023-11-22T00:29:21
NONE
null
null
null
### Describe the bug Multi-GPU fine-tuning the stable diffusion X by following https://github.com/huggingface/diffusers/blob/main/examples/text_to_image/README_sdxl.md hangs indefinitely. ### Steps to reproduce the bug accelerate launch train_text_to_image_sdxl.py --pretrained_model_name_or_path=$MODEL_NAME --pretrained_vae_model_name_or_path=$VAE_NAME --dataset_name=$DATASET_NAME --enable_xformers_memory_efficient_attention --resolution=512 --center_crop --random_flip --proportion_empty_prompts=0.2 --train_batch_size=1 --gradient_accumulation_steps=4 --gradient_checkpointing --max_train_steps=10000 --use_8bit_adam --learning_rate=1e-06 --lr_scheduler="constant" --lr_warmup_steps=0 --mixed_precision="fp16" --report_to="wandb" --validation_prompt="a cute Sundar Pichai creature" --validation_epochs 5 --checkpointing_steps=5000 --output_dir="sdxl-pokemon-model" ### Expected behavior It should start the training as it does for the single GPU training. I opened the issue in diffusers **https://github.com/huggingface/diffusers/issues/5534 but it does seem to be an issue with the Pokemon dataset. I added some debug prints ``` print("==========HERE3=============") with accelerator.main_process_first(): print(accelerator.is_main_process) print("===========Here3.1===========") if args.max_train_samples is not None: dataset["train"] = dataset["train"].shuffle(seed=args.seed).select(range(args.max_train_samples)) print("===========Here3.2===========") # Set the training transforms train_dataset = dataset["train"].with_transform(preprocess_train) print("==========HERE4=============") Corresponding Output Detected kernel version 5.4.0, which is below the recommended minimum of 5.5.0; this can cause the process to hang. It is recommended to upgrade the kernel to the minimum version or higher. 10/25/2023 21:18:04 - INFO - main - Distributed environment: MULTI_GPU Backend: nccl Num processes: 3 Process index: 1 Local process index: 1 Device: cuda:1 Mixed precision type: fp16 10/25/2023 21:18:04 - INFO - main - Distributed environment: MULTI_GPU Backend: nccl Num processes: 3 Process index: 2 Local process index: 2 Device: cuda:2 Mixed precision type: fp16 10/25/2023 21:18:04 - INFO - main - Distributed environment: MULTI_GPU Backend: nccl Num processes: 3 Process index: 0 Local process index: 0 Device: cuda:0 Mixed precision type: fp16 You are using a model of type clip_text_model to instantiate a model of type . This is not supported for all configurations of models and can yield errors. You are using a model of type clip_text_model to instantiate a model of type . This is not supported for all configurations of models and can yield errors. {‘variance_type’, ‘clip_sample_range’, ‘thresholding’, ‘dynamic_thresholding_ratio’} was not found in config. Values will be initialized to default values. {‘attention_type’, ‘reverse_transformer_layers_per_block’, ‘dropout’} was not found in config. Values will be initialized to default values. ==========HERE1============= ==========HERE1============= ==========HERE1============= ==========HERE2============= ==========HERE2============= ==========HERE2============= ==========HERE3============= True ===========Here3.1=========== ===========Here3.2=========== ==========HERE3============= ==========HERE3========= ``` ### Environment info _libgcc_mutex 0.1 conda_forge conda-forge _openmp_mutex 4.5 2_kmp_llvm conda-forge absl-py 2.0.0 pypi_0 pypi accelerate 0.24.0 pypi_0 pypi aiohttp 3.8.6 pypi_0 pypi aiosignal 1.3.1 pypi_0 pypi appdirs 1.4.4 pyh9f0ad1d_0 conda-forge async-timeout 4.0.3 pypi_0 pypi attrs 23.1.0 pypi_0 pypi bitsandbytes 0.41.1 pypi_0 pypi blas 1.0 mkl blessings 1.7 py39h06a4308_1002 brotli-python 1.0.9 py39h6a678d5_7 bzip2 1.0.8 h7b6447c_0 ca-certificates 2023.08.22 h06a4308_0 cachetools 5.3.2 pypi_0 pypi certifi 2023.7.22 py39h06a4308_0 cffi 1.15.1 py39h5eee18b_3 charset-normalizer 2.0.4 pyhd3eb1b0_0 click 8.1.7 unix_pyh707e725_0 conda-forge cryptography 41.0.3 py39hdda0065_0 cuda-cudart 11.7.99 0 nvidia cuda-cupti 11.7.101 0 nvidia cuda-libraries 11.7.1 0 nvidia cuda-nvrtc 11.7.99 0 nvidia cuda-nvtx 11.7.91 0 nvidia cuda-runtime 11.7.1 0 nvidia datasets 2.14.6 pypi_0 pypi diffusers 0.22.0.dev0 pypi_0 pypi dill 0.3.7 pypi_0 pypi docker-pycreds 0.4.0 py_0 conda-forge ffmpeg 4.3 hf484d3e_0 pytorch filelock 3.12.4 pypi_0 pypi freetype 2.12.1 h4a9f257_0 frozenlist 1.4.0 pypi_0 pypi fsspec 2023.10.0 pypi_0 pypi ftfy 6.1.1 pypi_0 pypi giflib 5.2.1 h5eee18b_3 gitdb 4.0.11 pyhd8ed1ab_0 conda-forge gitpython 3.1.40 pyhd8ed1ab_0 conda-forge gmp 6.2.1 h295c915_3 gnutls 3.6.15 he1e5248_0 google-auth 2.23.3 pypi_0 pypi google-auth-oauthlib 1.1.0 pypi_0 pypi gpustat 0.6.0 pyhd3eb1b0_1 grpcio 1.59.0 pypi_0 pypi huggingface-hub 0.17.3 pypi_0 pypi idna 3.4 py39h06a4308_0 importlib-metadata 6.8.0 pypi_0 pypi intel-openmp 2023.1.0 hdb19cb5_46305 jinja2 3.1.2 pypi_0 pypi jpeg 9e h5eee18b_1 lame 3.100 h7b6447c_0 lcms2 2.12 h3be6417_0 ld_impl_linux-64 2.38 h1181459_1 lerc 3.0 h295c915_0 libcublas 11.10.3.66 0 nvidia libcufft 10.7.2.124 h4fbf590_0 nvidia libcufile 1.8.0.34 0 nvidia libcurand 10.3.4.52 0 nvidia libcusolver 11.4.0.1 0 nvidia libcusparse 11.7.4.91 0 nvidia libdeflate 1.17 h5eee18b_1 libffi 3.4.4 h6a678d5_0 libgcc-ng 13.2.0 h807b86a_2 conda-forge libgfortran-ng 13.2.0 h69a702a_2 conda-forge libgfortran5 13.2.0 ha4646dd_2 conda-forge libiconv 1.16 h7f8727e_2 libidn2 2.3.4 h5eee18b_0 libnpp 11.7.4.75 0 nvidia libnvjpeg 11.8.0.2 0 nvidia libpng 1.6.39 h5eee18b_0 libprotobuf 3.20.3 he621ea3_0 libstdcxx-ng 13.2.0 h7e041cc_2 conda-forge libtasn1 4.19.0 h5eee18b_0 libtiff 4.5.1 h6a678d5_0 libunistring 0.9.10 h27cfd23_0 libwebp 1.3.2 h11a3e52_0 libwebp-base 1.3.2 h5eee18b_0 llvm-openmp 14.0.6 h9e868ea_0 lz4-c 1.9.4 h6a678d5_0 markdown 3.5 pypi_0 pypi markupsafe 2.1.3 pypi_0 pypi mkl 2023.1.0 h213fc3f_46343 mkl-service 2.4.0 py39h5eee18b_1 mkl_fft 1.3.8 py39h5eee18b_0 mkl_random 1.2.4 py39hdb19cb5_0 multidict 6.0.4 pypi_0 pypi multiprocess 0.70.15 pypi_0 pypi ncurses 6.4 h6a678d5_0 nettle 3.7.3 hbbd107a_1 numpy 1.26.0 py39h5f9d8c6_0 numpy-base 1.26.0 py39hb5e798b_0 nvidia-ml 7.352.0 pyhd3eb1b0_0 oauthlib 3.2.2 pypi_0 pypi openh264 2.1.1 h4ff587b_0 openjpeg 2.4.0 h3ad879b_0 openssl 3.0.11 h7f8727e_2 packaging 23.2 pypi_0 pypi pandas 2.1.1 pypi_0 pypi pathtools 0.1.2 py_1 conda-forge pillow 10.0.1 py39ha6cbd5a_0 pip 23.3 py39h06a4308_0 protobuf 4.23.4 pypi_0 pypi psutil 5.9.6 pypi_0 pypi pyarrow 13.0.0 pypi_0 pypi pyasn1 0.5.0 pypi_0 pypi pyasn1-modules 0.3.0 pypi_0 pypi pycparser 2.21 pyhd3eb1b0_0 pyopenssl 23.2.0 py39h06a4308_0 pysocks 1.7.1 py39h06a4308_0 python 3.9.18 h955ad1f_0 python-dateutil 2.8.2 pypi_0 pypi python_abi 3.9 2_cp39 conda-forge pytorch 1.13.1 py3.9_cuda11.7_cudnn8.5.0_0 pytorch pytorch-cuda 11.7 h778d358_5 pytorch pytorch-mutex 1.0 cuda pytorch pytz 2023.3.post1 pypi_0 pypi pyyaml 6.0.1 pypi_0 pypi readline 8.2 h5eee18b_0 regex 2023.10.3 pypi_0 pypi requests 2.31.0 py39h06a4308_0 requests-oauthlib 1.3.1 pypi_0 pypi rsa 4.9 pypi_0 pypi safetensors 0.4.0 pypi_0 pypi scipy 1.11.3 py39h5f9d8c6_0 sentry-sdk 1.32.0 pyhd8ed1ab_0 conda-forge setproctitle 1.1.10 py39h3811e60_1004 conda-forge setuptools 68.0.0 py39h06a4308_0 six 1.16.0 pyh6c4a22f_0 conda-forge smmap 5.0.0 pyhd8ed1ab_0 conda-forge sqlite 3.41.2 h5eee18b_0 tbb 2021.8.0 hdb19cb5_0 tensorboard 2.15.0 pypi_0 pypi tensorboard-data-server 0.7.2 pypi_0 pypi tk 8.6.12 h1ccaba5_0 tokenizers 0.14.1 pypi_0 pypi torchaudio 0.13.1 py39_cu117 pytorch torchtriton 2.1.0 py39 pytorch torchvision 0.14.1 py39_cu117 pytorch tqdm 4.66.1 pypi_0 pypi transformers 4.34.1 pypi_0 pypi typing_extensions 4.7.1 py39h06a4308_0 tzdata 2023.3 pypi_0 pypi urllib3 1.26.18 py39h06a4308_0 wandb 0.15.12 pyhd8ed1ab_0 conda-forge wcwidth 0.2.8 pypi_0 pypi werkzeug 3.0.1 pypi_0 pypi wheel 0.41.2 py39h06a4308_0 xformers 0.0.22.post7 py39_cu11.7.1_pyt1.13.1 xformers xxhash 3.4.1 pypi_0 pypi xz 5.4.2 h5eee18b_0 yaml 0.2.5 h7f98852_2 conda-forge yarl 1.9.2 pypi_0 pypi zipp 3.17.0 pypi_0 pypi zlib 1.2.13 h5eee18b_0 zstd 1.5.5 hc292b87_0
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6363/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6363/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6360
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6360/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6360/comments
https://api.github.com/repos/huggingface/datasets/issues/6360/events
https://github.com/huggingface/datasets/issues/6360
1,965,672,950
I_kwDODunzps51Kcn2
6,360
Add support for `Sequence(Audio/Image)` feature in `push_to_hub`
{ "login": "Laurent2916", "id": 21087104, "node_id": "MDQ6VXNlcjIxMDg3MTA0", "avatar_url": "https://avatars.githubusercontent.com/u/21087104?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Laurent2916", "html_url": "https://github.com/Laurent2916", "followers_url": "https://api.github.com/users/Laurent2916/followers", "following_url": "https://api.github.com/users/Laurent2916/following{/other_user}", "gists_url": "https://api.github.com/users/Laurent2916/gists{/gist_id}", "starred_url": "https://api.github.com/users/Laurent2916/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Laurent2916/subscriptions", "organizations_url": "https://api.github.com/users/Laurent2916/orgs", "repos_url": "https://api.github.com/users/Laurent2916/repos", "events_url": "https://api.github.com/users/Laurent2916/events{/privacy}", "received_events_url": "https://api.github.com/users/Laurent2916/received_events", "type": "User", "site_admin": false }
[ { "id": 1935892871, "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement", "name": "enhancement", "color": "a2eeef", "default": true, "description": "New feature or request" } ]
closed
false
{ "login": "mariosasko", "id": 47462742, "node_id": "MDQ6VXNlcjQ3NDYyNzQy", "avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mariosasko", "html_url": "https://github.com/mariosasko", "followers_url": "https://api.github.com/users/mariosasko/followers", "following_url": "https://api.github.com/users/mariosasko/following{/other_user}", "gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}", "starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions", "organizations_url": "https://api.github.com/users/mariosasko/orgs", "repos_url": "https://api.github.com/users/mariosasko/repos", "events_url": "https://api.github.com/users/mariosasko/events{/privacy}", "received_events_url": "https://api.github.com/users/mariosasko/received_events", "type": "User", "site_admin": false }
[ { "login": "mariosasko", "id": 47462742, "node_id": "MDQ6VXNlcjQ3NDYyNzQy", "avatar_url": "https://avatars.githubusercontent.com/u/47462742?v=4", "gravatar_id": "", "url": "https://api.github.com/users/mariosasko", "html_url": "https://github.com/mariosasko", "followers_url": "https://api.github.com/users/mariosasko/followers", "following_url": "https://api.github.com/users/mariosasko/following{/other_user}", "gists_url": "https://api.github.com/users/mariosasko/gists{/gist_id}", "starred_url": "https://api.github.com/users/mariosasko/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/mariosasko/subscriptions", "organizations_url": "https://api.github.com/users/mariosasko/orgs", "repos_url": "https://api.github.com/users/mariosasko/repos", "events_url": "https://api.github.com/users/mariosasko/events{/privacy}", "received_events_url": "https://api.github.com/users/mariosasko/received_events", "type": "User", "site_admin": false } ]
null
[ "This issue stems from https://github.com/huggingface/datasets/blob/6d2f2a5e0fea3827eccfd1717d8021c15fc4292a/src/datasets/table.py#L2203-L2205\r\n\r\nI'll address it as part of https://github.com/huggingface/datasets/pull/6283.\r\n\r\nIn the meantime, this should work\r\n\r\n```python\r\nimport pyarrow as pa\r\nfrom datasets import Image\r\n\r\ndataset = dataset.with_format(\"arrow\")\r\n\r\ndef embed_images(pa_table):\r\n images_arr = pa.chunked_array(\r\n [\r\n pa.ListArray.from_arrays(chunk.offsets, Image().embed_storage(chunk.values), mask=chunk.is_null())\r\n for chunk in pa_table[\"images\"].chunks\r\n ]\r\n )\r\n return pa_table.set_column(pa_table.schema.get_field_index(\"images\"), \"images\", images_arr)\r\n\r\ndataset = dataset.map(embed_images, batched=True)\r\n\r\ndataset = dataset.with_format(\"python\")\r\n\r\ndataset.push_to_hub(...)\r\n```" ]
2023-10-27T14:39:57
2024-02-06T19:24:20
2024-02-06T19:24:20
CONTRIBUTOR
null
null
null
### Feature request Allow for `Sequence` of `Image` (or `Audio`) to be embedded inside the shards. ### Motivation Currently, thanks to #3685, when `embed_external_files` is set to True (which is the default) in `push_to_hub`, features of type `Image` and `Audio` are embedded inside the arrow/parquet shards, instead of only storing paths to the files. I've noticed that this behavior does not extend to `Sequence` of `Image`, when working with a [dataset of timelapse images](https://huggingface.co/datasets/1aurent/Human-Embryo-Timelapse). ### Your contribution I'll submit a PR if I find a way to add this feature
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6360/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6360/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6359
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6359/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6359/comments
https://api.github.com/repos/huggingface/datasets/issues/6359/events
https://github.com/huggingface/datasets/issues/6359
1,965,378,583
I_kwDODunzps51JUwX
6,359
Stuck in "Resolving data files..."
{ "login": "Luciennnnnnn", "id": 20135317, "node_id": "MDQ6VXNlcjIwMTM1MzE3", "avatar_url": "https://avatars.githubusercontent.com/u/20135317?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Luciennnnnnn", "html_url": "https://github.com/Luciennnnnnn", "followers_url": "https://api.github.com/users/Luciennnnnnn/followers", "following_url": "https://api.github.com/users/Luciennnnnnn/following{/other_user}", "gists_url": "https://api.github.com/users/Luciennnnnnn/gists{/gist_id}", "starred_url": "https://api.github.com/users/Luciennnnnnn/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Luciennnnnnn/subscriptions", "organizations_url": "https://api.github.com/users/Luciennnnnnn/orgs", "repos_url": "https://api.github.com/users/Luciennnnnnn/repos", "events_url": "https://api.github.com/users/Luciennnnnnn/events{/privacy}", "received_events_url": "https://api.github.com/users/Luciennnnnnn/received_events", "type": "User", "site_admin": false }
[]
open
false
null
[]
null
[ "Most likely, the data file inference logic is the problem here.\r\n\r\nYou can run the following code to verify this:\r\n```python\r\nimport time\r\nfrom datasets.data_files import get_data_patterns\r\nstart_time = time.time()\r\nget_data_patterns(\"/path/to/img_dir\")\r\nend_time = time.time()\r\nprint(f\"Elapsed time: {end_time - start_time:.2f}s\")\r\n```\r\n \r\nWe plan to optimize this for the next version (or version after that). In the meantime, specifying the split patterns manually should give better performance:\r\n```python\r\nds = load_dataset(\"imagefolder\", data_files={\"train\": \"path/to/img_dir/train/**\", ...}, split=\"train\")\r\n```", "Hi, @mariosasko, you are right; data file inference logic is extremely slow.\r\n\r\nI have done a similar test, that is I modify the source code of datasets/load.py to measure the cost of two suspicious operations:\r\n```python\r\ndef get_module(self) -> DatasetModule:\r\n base_path = Path(self.data_dir or \"\").expanduser().resolve().as_posix()\r\n start = time.time()\r\n patterns = sanitize_patterns(self.data_files) if self.data_files is not None else get_data_patterns(base_path)\r\n print(f\"patterns: {time.time() - start}\")\r\n start = time.time()\r\n data_files = DataFilesDict.from_patterns(\r\n patterns,\r\n download_config=self.download_config,\r\n base_path=base_path,\r\n )\r\n print(f\"data_files: {time.time() - start}\")\r\n```\r\nIt gaves:\r\npatterns: 3062.2050700187683\r\ndata_files: 413.9576675891876\r\n\r\nThus, these two operations contribute to almost all of load time. What's going on in them?", "Furthermore, what's my current workaround about this problem? Should I save it by `save_to_disk()` and load dataset through `load_from_disk`?", "were you able to solve this issue?, I am facing the same issue" ]
2023-10-27T12:01:51
2024-01-24T15:02:06
null
NONE
null
null
null
### Describe the bug I have an image dataset with 300k images, the size of image is 768 * 768. When I run `dataset = load_dataset("imagefolder", data_dir="/path/to/img_dir", split='train')` in second time, it takes 50 minutes to finish "Resolving data files" part, what's going on in this part? From my understand, after Arrow files been created in the first run, the second run should not take time longer than one or two minutes. ### Steps to reproduce the bug # Run following code two times dataset = load_dataset("imagefolder", data_dir="/path/to/img_dir", split='train') ### Expected behavior Fast dataset building ### Environment info - `datasets` version: 2.14.5 - Platform: Linux-5.15.0-60-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Huggingface_hub version: 0.17.3 - PyArrow version: 10.0.1 - Pandas version: 1.5.3
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6359/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6359/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6358
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6358/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6358/comments
https://api.github.com/repos/huggingface/datasets/issues/6358/events
https://github.com/huggingface/datasets/issues/6358
1,965,014,595
I_kwDODunzps51H75D
6,358
Mounting datasets cache fails due to absolute paths.
{ "login": "charliebudd", "id": 72921588, "node_id": "MDQ6VXNlcjcyOTIxNTg4", "avatar_url": "https://avatars.githubusercontent.com/u/72921588?v=4", "gravatar_id": "", "url": "https://api.github.com/users/charliebudd", "html_url": "https://github.com/charliebudd", "followers_url": "https://api.github.com/users/charliebudd/followers", "following_url": "https://api.github.com/users/charliebudd/following{/other_user}", "gists_url": "https://api.github.com/users/charliebudd/gists{/gist_id}", "starred_url": "https://api.github.com/users/charliebudd/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/charliebudd/subscriptions", "organizations_url": "https://api.github.com/users/charliebudd/orgs", "repos_url": "https://api.github.com/users/charliebudd/repos", "events_url": "https://api.github.com/users/charliebudd/events{/privacy}", "received_events_url": "https://api.github.com/users/charliebudd/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "You may be able to make it work by tweaking some environment variables, such as [`HF_HOME`](https://huggingface.co/docs/huggingface_hub/main/en/package_reference/environment_variables#hfhome) or [`HF_DATASETS_CACHE`](https://huggingface.co/docs/datasets/cache#cache-directory).", "> You may be able to make it work by tweaking some environment variables, such as [`HF_HOME`](https://huggingface.co/docs/huggingface_hub/main/en/package_reference/environment_variables#hfhome) or [`HF_DATASETS_CACHE`](https://huggingface.co/docs/datasets/cache#cache-directory).\r\n\r\nI am already doing this. The problem is that, while this seemingly allows flexibility, the absolute paths written into the cache still have the old cache directory. The paths written into the cache should be relative to the cache location to allow this sort of flexibility. Sorry, I omitted this in the reproduction steps, I have now added it.", "I'm unable to reproduce this with the cache\r\n```bash\r\nexport HF_CACHE=$PWD/hf_cache\r\npython -c \"import datasets; datasets.load_dataset('imdb')\"\r\n```\r\nimported inside a dummy container that is built from\r\n```bash\r\nFROM python:3.9\r\n\r\nWORKDIR /usr/src/app\r\n\r\nRUN pip install datasets\r\n\r\nCOPY ./hf_cache ./hf_cache\r\n\r\nENV HF_HOME=./hf_cache\r\nENV HF_DATASETS_OFFLINE=1\r\n\r\nCMD [\"python\"]\r\n```\r\nWhat do you mean by \"absolute paths written into the cache\"? Paths inside the HF cache paths are based on hash (hashed URL of the downloaded files, etc.)" ]
2023-10-27T08:20:27
2023-11-28T14:47:12
2023-11-28T14:47:12
NONE
null
null
null
### Describe the bug Creating a datasets cache and mounting this into, for example, a docker container, renders the data unreadable due to absolute paths written into the cache. ### Steps to reproduce the bug 1. Create a datasets cache by downloading some data 2. Mount the dataset folder into a docker container or remote system. 3. (Edit) Set `HF_HOME` or `HF_DATASET_CACHE` to point to the mounted cache. 4. Attempt to access the data from within the docker container. 5. An error is thrown saying no file exists at \<absolute path to original cache location\> ### Expected behavior The data is loaded without error ### Environment info - `datasets` version: 2.14.4 - Platform: Linux-5.4.0-162-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.16.4 - PyArrow version: 13.0.0 - Pandas version: 2.0.3
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6358/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6358/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6357
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6357/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6357/comments
https://api.github.com/repos/huggingface/datasets/issues/6357/events
https://github.com/huggingface/datasets/issues/6357
1,964,653,995
I_kwDODunzps51Gj2r
6,357
Allow passing a multiprocessing context to functions that support `num_proc`
{ "login": "bryant1410", "id": 3905501, "node_id": "MDQ6VXNlcjM5MDU1MDE=", "avatar_url": "https://avatars.githubusercontent.com/u/3905501?v=4", "gravatar_id": "", "url": "https://api.github.com/users/bryant1410", "html_url": "https://github.com/bryant1410", "followers_url": "https://api.github.com/users/bryant1410/followers", "following_url": "https://api.github.com/users/bryant1410/following{/other_user}", "gists_url": "https://api.github.com/users/bryant1410/gists{/gist_id}", "starred_url": "https://api.github.com/users/bryant1410/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/bryant1410/subscriptions", "organizations_url": "https://api.github.com/users/bryant1410/orgs", "repos_url": "https://api.github.com/users/bryant1410/repos", "events_url": "https://api.github.com/users/bryant1410/events{/privacy}", "received_events_url": "https://api.github.com/users/bryant1410/received_events", "type": "User", "site_admin": false }
[ { "id": 1935892871, "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement", "name": "enhancement", "color": "a2eeef", "default": true, "description": "New feature or request" } ]
open
false
null
[]
null
[]
2023-10-27T02:31:16
2023-10-27T02:31:16
null
CONTRIBUTOR
null
null
null
### Feature request Allow specifying [a multiprocessing context](https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods) to functions that support `num_proc` or use multiprocessing pools. For example, the following could be done: ```python dataset = dataset.map(_func, num_proc=2, mp_context=multiprocess.get_context("spawn")) ``` Or at least the multiprocessing start method ("fork", "spawn", "fork_server" or `None`): ```python dataset = dataset.map(_func, num_proc=2, mp_start_method="spawn") ``` Another option could be passing the `pool` as an argument. ### Motivation By default, `multiprocess` (the `multiprocessing`-fork library that this repo uses) uses the "fork" start method for multiprocessing pools (for the default context). It could be changed by using `set_start_method`. However, this conditions the multiprocessing start method from all processing in a Python program that uses the default context, because [you can't call that function more than once](https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods:~:text=set_start_method()%20should%20not%20be%20used%20more%20than%20once%20in%20the%20program.). My proposal is to allow using a different multiprocessing context, not to condition the whole Python program. One reason to change the start method is that "fork" (the default) makes child processes likely deadlock if thread pools were created before (and also this is not supported by POSIX). For example, this happens when using PyTorch because OpenMP threads are used for CPU intra-op parallelism, which is enabled by default (e.g., for context see [`torch.set_num_threads`](https://pytorch.org/docs/stable/generated/torch.set_num_threads.html)). This can also be fixed by setting `torch.set_num_threads(1)` (or similarly by other methods) but this conditions the whole Python program as it can only be set once to guarantee its behavior (similarly to). There are noticeable performance differences when setting this number to 1 even when using GPU(s). Using, e.g., a "spawn" start method would solve this issue. For more context, see: * https://discuss.huggingface.co/t/dataset-map-stuck-with-torch-set-num-threads-set-to-2-or-larger/37984 * https://discuss.huggingface.co/t/using-num-proc-1-in-dataset-map-hangs/44310 ### Your contribution I'd be happy to review a PR that makes such a change. And if you really don't have the bandwidth for it, I'd consider creating one.
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6357/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6357/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6354
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6354/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6354/comments
https://api.github.com/repos/huggingface/datasets/issues/6354/events
https://github.com/huggingface/datasets/issues/6354
1,963,483,324
I_kwDODunzps51CGC8
6,354
`IterableDataset.from_spark` does not support multiple workers in pytorch `Dataloader`
{ "login": "NazyS", "id": 50199774, "node_id": "MDQ6VXNlcjUwMTk5Nzc0", "avatar_url": "https://avatars.githubusercontent.com/u/50199774?v=4", "gravatar_id": "", "url": "https://api.github.com/users/NazyS", "html_url": "https://github.com/NazyS", "followers_url": "https://api.github.com/users/NazyS/followers", "following_url": "https://api.github.com/users/NazyS/following{/other_user}", "gists_url": "https://api.github.com/users/NazyS/gists{/gist_id}", "starred_url": "https://api.github.com/users/NazyS/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/NazyS/subscriptions", "organizations_url": "https://api.github.com/users/NazyS/orgs", "repos_url": "https://api.github.com/users/NazyS/repos", "events_url": "https://api.github.com/users/NazyS/events{/privacy}", "received_events_url": "https://api.github.com/users/NazyS/received_events", "type": "User", "site_admin": false }
[]
open
false
null
[]
null
[ "I am having issues as well with this. \r\n\r\nHowever, the error I am getting is :\r\n`RuntimeError: It appears that you are attempting to reference SparkContext from a broadcast variable, action, or transformation. SparkContext can only be used on the driver, not in code that it run on workers. For more information, see SPARK-5063.`\r\n\r\nAlso did not work with pyspark==3.3.0 and py4j==0.10.9.5" ]
2023-10-26T12:43:36
2023-11-14T18:46:03
null
NONE
null
null
null
### Describe the bug Looks like `IterableDataset.from_spark` does not support multiple workers in pytorch `Dataloader` if I'm not missing anything. Also, returns not consistent error messages, which probably depend on the nondeterministic order of worker executions Some exampes I've encountered: ``` File "/local_disk0/.ephemeral_nfs/envs/pythonEnv-68c05436-3512-41c4-88ca-5630012b70d1/lib/python3.10/site-packages/datasets/packaged_modules/spark/spark.py", line 79, in __iter__ yield from self.generate_examples_fn() File "/local_disk0/.ephemeral_nfs/envs/pythonEnv-68c05436-3512-41c4-88ca-5630012b70d1/lib/python3.10/site-packages/datasets/packaged_modules/spark/spark.py", line 49, in generate_fn df_with_partition_id = df.select("*", pyspark.sql.functions.spark_partition_id().alias("part_id")) File "/databricks/spark/python/pyspark/instrumentation_utils.py", line 54, in wrapper logger.log_failure( File "/databricks/spark/python/pyspark/databricks/usage_logger.py", line 70, in log_failure self.logger.recordFunctionCallFailureEvent( File "/databricks/spark/python/lib/py4j-0.10.9.7-src.zip/py4j/java_gateway.py", line 1322, in __call__ return_value = get_return_value( File "/databricks/spark/python/pyspark/errors/exceptions/captured.py", line 188, in deco return f(*a, **kw) File "/databricks/spark/python/lib/py4j-0.10.9.7-src.zip/py4j/protocol.py", line 342, in get_return_value return OUTPUT_CONVERTER[type](answer[2:], gateway_client) KeyError: 'c' ``` ``` File "/local_disk0/.ephemeral_nfs/envs/pythonEnv-68c05436-3512-41c4-88ca-5630012b70d1/lib/python3.10/site-packages/datasets/packaged_modules/spark/spark.py", line 79, in __iter__ yield from self.generate_examples_fn() File "/local_disk0/.ephemeral_nfs/envs/pythonEnv-68c05436-3512-41c4-88ca-5630012b70d1/lib/python3.10/site-packages/datasets/packaged_modules/spark/spark.py", line 49, in generate_fn df_with_partition_id = df.select("*", pyspark.sql.functions.spark_partition_id().alias("part_id")) File "/databricks/spark/python/pyspark/sql/utils.py", line 162, in wrapped return f(*args, **kwargs) File "/databricks/spark/python/pyspark/sql/functions.py", line 4893, in spark_partition_id return _invoke_function("spark_partition_id") File "/databricks/spark/python/pyspark/sql/functions.py", line 98, in _invoke_function return Column(jf(*args)) File "/databricks/spark/python/lib/py4j-0.10.9.7-src.zip/py4j/java_gateway.py", line 1322, in __call__ return_value = get_return_value( File "/databricks/spark/python/pyspark/errors/exceptions/captured.py", line 188, in deco return f(*a, **kw) File "/databricks/spark/python/lib/py4j-0.10.9.7-src.zip/py4j/protocol.py", line 342, in get_return_value return OUTPUT_CONVERTER[type](answer[2:], gateway_client) KeyError: 'm' ``` ``` File "/local_disk0/.ephemeral_nfs/envs/pythonEnv-68c05436-3512-41c4-88ca-5630012b70d1/lib/python3.10/site-packages/datasets/packaged_modules/spark/spark.py", line 79, in __iter__ yield from self.generate_examples_fn() File "/local_disk0/.ephemeral_nfs/envs/pythonEnv-68c05436-3512-41c4-88ca-5630012b70d1/lib/python3.10/site-packages/datasets/packaged_modules/spark/spark.py", line 49, in generate_fn df_with_partition_id = df.select("*", pyspark.sql.functions.spark_partition_id().alias("part_id")) File "/databricks/spark/python/pyspark/sql/utils.py", line 162, in wrapped return f(*args, **kwargs) File "/databricks/spark/python/pyspark/sql/functions.py", line 4893, in spark_partition_id return _invoke_function("spark_partition_id") File "/databricks/spark/python/pyspark/sql/functions.py", line 97, in _invoke_function jf = _get_jvm_function(name, SparkContext._active_spark_context) File "/databricks/spark/python/pyspark/sql/functions.py", line 88, in _get_jvm_function return getattr(sc._jvm.functions, name) File "/databricks/spark/python/lib/py4j-0.10.9.7-src.zip/py4j/java_gateway.py", line 1725, in __getattr__ raise Py4JError(message) py4j.protocol.Py4JError: functions does not exist in the JVM ``` ### Steps to reproduce the bug ```python import pandas as pd import numpy as np batch_size = 16 pdf = pd.DataFrame({ key: np.random.rand(16*100) for key in ['feature', 'target'] }) test_df = spark.createDataFrame(pdf) from datasets import IterableDataset from torch.utils.data import DataLoader ids = IterableDataset.from_spark(test_df) for batch in DataLoader(ids, batch_size=16, num_workers=4): for k, b in batch.items(): print(k, b.shape, sep='\t') print('\n') ``` ### Expected behavior For `num_workers` equal to 0 or 1 works fine as expected: ``` feature torch.Size([16]) target torch.Size([16]) feature torch.Size([16]) target torch.Size([16]) .... ``` Expected to support workers >1. ### Environment info Databricks 13.3 LTS ML runtime - Spark 3.4.1 pyspark==3.4.1 py4j==0.10.9.7 datasets==2.13.1 and also tested with datasets==2.14.6
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6354/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6354/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6353
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6353/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6353/comments
https://api.github.com/repos/huggingface/datasets/issues/6353/events
https://github.com/huggingface/datasets/issues/6353
1,962,646,450
I_kwDODunzps50-5uy
6,353
load_dataset save_to_disk load_from_disk error
{ "login": "brisker", "id": 13804492, "node_id": "MDQ6VXNlcjEzODA0NDky", "avatar_url": "https://avatars.githubusercontent.com/u/13804492?v=4", "gravatar_id": "", "url": "https://api.github.com/users/brisker", "html_url": "https://github.com/brisker", "followers_url": "https://api.github.com/users/brisker/followers", "following_url": "https://api.github.com/users/brisker/following{/other_user}", "gists_url": "https://api.github.com/users/brisker/gists{/gist_id}", "starred_url": "https://api.github.com/users/brisker/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/brisker/subscriptions", "organizations_url": "https://api.github.com/users/brisker/orgs", "repos_url": "https://api.github.com/users/brisker/repos", "events_url": "https://api.github.com/users/brisker/events{/privacy}", "received_events_url": "https://api.github.com/users/brisker/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "solved.\r\nfsspec version problem", "I'm using the latest datasets and fsspec , but still got this error!\r\n\r\ndatasets : Version: 2.13.0\r\n\r\nfsspec Version: 2023.10.0\r\n\r\n```\r\nFile \"/home/guoby/app/Anaconda3-2021.05/envs/news/lib/python3.8/site-packages/datasets/load.py\", line 1892, in load_from_disk\r\n return DatasetDict.load_from_disk(dataset_path, keep_in_memory=keep_in_memory, storage_options=storage_options)\r\n File \"/home/guoby/app/Anaconda3-2021.05/envs/news/lib/python3.8/site-packages/datasets/dataset_dict.py\", line 1371, in load_from_disk\r\n dataset_dict[k] = Dataset.load_from_disk(\r\n File \"/home/guoby/app/Anaconda3-2021.05/envs/news/lib/python3.8/site-packages/datasets/arrow_dataset.py\", line 1639, in load_from_disk\r\n fs_token_paths = fsspec.get_fs_token_paths(dataset_path, storage_options=storage_options)\r\n File \"/home/guoby/app/Anaconda3-2021.05/envs/news/lib/python3.8/site-packages/fsspec/core.py\", line 610, in get_fs_token_paths\r\n chain = _un_chain(urlpath0, storage_options or {})\r\n File \"/home/guoby/app/Anaconda3-2021.05/envs/news/lib/python3.8/site-packages/fsspec/core.py\", line 325, in _un_chain\r\n cls = get_filesystem_class(protocol)\r\n File \"/home/guoby/app/Anaconda3-2021.05/envs/news/lib/python3.8/site-packages/fsspec/registry.py\", line 232, in get_filesystem_class\r\n raise ValueError(f\"Protocol not known: {protocol}\")\r\n```", "These two versions work.\r\n<img width=\"807\" alt=\"截圖 2023-11-22 下午5 55 28\" src=\"https://github.com/huggingface/datasets/assets/77866896/faa8333f-0519-4d69-b243-a8880cd7fc1f\">\r\n", "datasets==2.10.1 and fsspec==2023.6.0 also works for me." ]
2023-10-26T03:47:06
2024-02-02T15:23:14
2023-10-26T10:18:04
NONE
null
null
null
### Describe the bug datasets version: 2.10.1 I `load_dataset `and `save_to_disk` sucessfully on windows10( **and I `load_from_disk(/LLM/data/wiki)` succcesfully on windows10**), and I copy the dataset `/LLM/data/wiki` into a ubuntu system, but when I `load_from_disk(/LLM/data/wiki)` on ubuntu, something weird happens: ``` load_from_disk('/LLM/data/wiki') File "/usr/local/miniconda3/lib/python3.8/site-packages/datasets/load.py", line 1874, in load_from_disk return DatasetDict.load_from_disk(dataset_path, keep_in_memory=keep_in_memory, storage_options=storage_options) File "/usr/local/miniconda3/lib/python3.8/site-packages/datasets/dataset_dict.py", line 1309, in load_from_disk dataset_dict[k] = Dataset.load_from_disk( File "/usr/local/miniconda3/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1543, in load_from_disk fs_token_paths = fsspec.get_fs_token_paths(dataset_path, storage_options=storage_options) File "/usr/local/miniconda3/lib/python3.8/site-packages/fsspec/core.py", line 610, in get_fs_token_paths chain = _un_chain(urlpath0, storage_options or {}) File "/usr/local/miniconda3/lib/python3.8/site-packages/fsspec/core.py", line 325, in _un_chain cls = get_filesystem_class(protocol) File "/usr/local/miniconda3/lib/python3.8/site-packages/fsspec/registry.py", line 232, in get_filesystem_class raise ValueError(f"Protocol not known: {protocol}") ValueError: Protocol not known: /LLM/data/wiki ``` It seems that something went wrong on the arrow file? How can I solve this , since currently I can not save_to_disk on ubuntu system ### Steps to reproduce the bug datasets version: 2.10.1 ### Expected behavior datasets version: 2.10.1 ### Environment info datasets version: 2.10.1
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6353/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6353/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6352
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6352/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6352/comments
https://api.github.com/repos/huggingface/datasets/issues/6352/events
https://github.com/huggingface/datasets/issues/6352
1,962,296,057
I_kwDODunzps509kL5
6,352
Error loading wikitext data raise NotImplementedError(f"Loading a dataset cached in a {type(self._fs).__name__} is not supported.")
{ "login": "Ahmed-Roushdy", "id": 68569076, "node_id": "MDQ6VXNlcjY4NTY5MDc2", "avatar_url": "https://avatars.githubusercontent.com/u/68569076?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Ahmed-Roushdy", "html_url": "https://github.com/Ahmed-Roushdy", "followers_url": "https://api.github.com/users/Ahmed-Roushdy/followers", "following_url": "https://api.github.com/users/Ahmed-Roushdy/following{/other_user}", "gists_url": "https://api.github.com/users/Ahmed-Roushdy/gists{/gist_id}", "starred_url": "https://api.github.com/users/Ahmed-Roushdy/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Ahmed-Roushdy/subscriptions", "organizations_url": "https://api.github.com/users/Ahmed-Roushdy/orgs", "repos_url": "https://api.github.com/users/Ahmed-Roushdy/repos", "events_url": "https://api.github.com/users/Ahmed-Roushdy/events{/privacy}", "received_events_url": "https://api.github.com/users/Ahmed-Roushdy/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "+1 \r\n```\r\nFound cached dataset csv (file:///home/ubuntu/.cache/huggingface/datasets/theSquarePond___csv/theSquarePond--XXXXX-bbf0a8365d693d2c/0.0.0/eea64c71ca8b46dd3f537ed218fc9bf495d5707789152eb2764f5c78fa66d59d)\r\n---------------------------------------------------------------------------\r\nNotImplementedError Traceback (most recent call last)\r\nCell In[14], line 4\r\n 1 get_ipython().system('pip install -U datasets')\r\n 3 # Load dataset from the hub\r\n----> 4 dataset = load_dataset(dataset_name)\r\n\r\nFile ~/anaconda3/envs/python38-env/lib/python3.8/site-packages/datasets/load.py:1810, 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, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)\r\n 1806 # Build dataset for splits\r\n 1807 keep_in_memory = (\r\n 1808 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)\r\n 1809 )\r\n-> 1810 ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)\r\n 1811 # Rename and cast features to match task schema\r\n 1812 if task is not None:\r\n\r\nFile ~/anaconda3/envs/python38-env/lib/python3.8/site-packages/datasets/builder.py:1128, in DatasetBuilder.as_dataset(self, split, run_post_process, verification_mode, ignore_verifications, in_memory)\r\n 1126 is_local = not is_remote_filesystem(self._fs)\r\n 1127 if not is_local:\r\n-> 1128 raise NotImplementedError(f\"Loading a dataset cached in a {type(self._fs).__name__} is not supported.\")\r\n 1129 if not os.path.exists(self._output_dir):\r\n 1130 raise FileNotFoundError(\r\n 1131 f\"Dataset {self.name}: could not find data in {self._output_dir}. Please make sure to call \"\r\n 1132 \"builder.download_and_prepare(), or use \"\r\n 1133 \"datasets.load_dataset() before trying to access the Dataset object.\"\r\n 1134 )\r\n\r\nNotImplementedError: Loading a dataset cached in a LocalFileSystem is not supported.\r\n```", "+1\r\n\r\n```\r\nFound cached dataset csv ([file://C:/Users/Shady/.cache/huggingface/datasets/knkarthick___csv/knkarthick--dialogsum-cd36827d3490488d/0.0.0/6954658bab30a358235fa864b05cf819af0e179325c740e4bc853bcc7ec513e1](file:///C:/Users/Shady/.cache/huggingface/datasets/knkarthick___csv/knkarthick--dialogsum-cd36827d3490488d/0.0.0/6954658bab30a358235fa864b05cf819af0e179325c740e4bc853bcc7ec513e1))\r\n---------------------------------------------------------------------------\r\nNotImplementedError Traceback (most recent call last)\r\nCell In[38], line 3\r\n 1 huggingface_dataset_name = \"knkarthick/dialogsum\"\r\n----> 3 dataset = load_dataset(huggingface_dataset_name)\r\n\r\nFile D:\\Desktop\\Workspace\\GenAI\\genai\\lib\\site-packages\\datasets\\load.py:1804, 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, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)\r\n 1800 # Build dataset for splits\r\n 1801 keep_in_memory = (\r\n 1802 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)\r\n 1803 )\r\n-> 1804 ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)\r\n 1805 # Rename and cast features to match task schema\r\n 1806 if task is not None:\r\n\r\nFile D:\\Desktop\\Workspace\\GenAI\\genai\\lib\\site-packages\\datasets\\builder.py:1108, in DatasetBuilder.as_dataset(self, split, run_post_process, verification_mode, ignore_verifications, in_memory)\r\n 1106 is_local = not is_remote_filesystem(self._fs)\r\n 1107 if not is_local:\r\n-> 1108 raise NotImplementedError(f\"Loading a dataset cached in a {type(self._fs).__name__} is not supported.\")\r\n 1109 if not os.path.exists(self._output_dir):\r\n 1110 raise FileNotFoundError(\r\n 1111 f\"Dataset {self.name}: could not find data in {self._output_dir}. Please make sure to call \"\r\n 1112 \"builder.download_and_prepare(), or use \"\r\n 1113 \"datasets.load_dataset() before trying to access the Dataset object.\"\r\n 1114 )\r\n\r\nNotImplementedError: Loading a dataset cached in a LocalFileSystem is not supported.\r\n```", "This error stems from a breaking change in `fsspec`. It has been fixed in the latest `datasets` release (`2.14.6`). Updating the installation with `pip install -U datasets` should fix the issue.\r\n", "> 此错误源于 中的重大更改。此问题已在最新版本 () 中修复。更新安装应该可以解决此问题。`fsspec``datasets``2.14.6``pip install -U datasets`\r\n\r\nthanks , 太好啦,刚好解决了我的问题,GPT都没解决了,终于被你搞定了", "https://stackoverflow.com/questions/77433096/notimplementederror-loading-a-dataset-cached-in-a-localfilesystem-is-not-suppor/77433141#77433141", "Fixed by:\r\n- https://github.com/huggingface/datasets/pull/6334\r\n\r\nThe fix was released in `datasets-2.14.6`.", "this is fixed in 2.15.0, but broken again in 2.17.0. Can someone verify?", "I'm on `2.17.1` and can confirm it's broken again. Downgrading to `2.16` helped.", "> 2.14.6\r\n\r\ni update the version but the error still exist \r\n" ]
2023-10-25T21:55:31
2024-03-07T10:48:36
2023-11-07T07:26:54
NONE
null
null
null
I was trying to load the wiki dataset, but i got this error traindata = load_dataset('wikitext', 'wikitext-2-raw-v1', split='train') File "/home/aelkordy/.conda/envs/prune_llm/lib/python3.9/site-packages/datasets/load.py", line 1804, in load_dataset ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory) File "/home/aelkordy/.conda/envs/prune_llm/lib/python3.9/site-packages/datasets/builder.py", line 1108, in as_dataset raise NotImplementedError(f"Loading a dataset cached in a {type(self._fs).__name__} is not supported.") NotImplementedError: Loading a dataset cached in a LocalFileSystem is not supported.
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6352/reactions", "total_count": 4, "+1": 4, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6352/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6350
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6350/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6350/comments
https://api.github.com/repos/huggingface/datasets/issues/6350/events
https://github.com/huggingface/datasets/issues/6350
1,961,869,203
I_kwDODunzps5077-T
6,350
Different objects are returned from calls that should be returning the same kind of object.
{ "login": "phalexo", "id": 4603365, "node_id": "MDQ6VXNlcjQ2MDMzNjU=", "avatar_url": "https://avatars.githubusercontent.com/u/4603365?v=4", "gravatar_id": "", "url": "https://api.github.com/users/phalexo", "html_url": "https://github.com/phalexo", "followers_url": "https://api.github.com/users/phalexo/followers", "following_url": "https://api.github.com/users/phalexo/following{/other_user}", "gists_url": "https://api.github.com/users/phalexo/gists{/gist_id}", "starred_url": "https://api.github.com/users/phalexo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/phalexo/subscriptions", "organizations_url": "https://api.github.com/users/phalexo/orgs", "repos_url": "https://api.github.com/users/phalexo/repos", "events_url": "https://api.github.com/users/phalexo/events{/privacy}", "received_events_url": "https://api.github.com/users/phalexo/received_events", "type": "User", "site_admin": false }
[]
open
false
null
[]
null
[ "`load_dataset` returns a `DatasetDict` object unless `split` is defined, in which case it returns a `Dataset` (or a list of datasets if `split` is a list). We've discussed dropping `DatasetDict` from the API in https://github.com/huggingface/datasets/issues/5189 to always return the same type in `load_dataset` and support datasets without (explicit) splits. IIRC the main discussion point is deciding what to return when loading a dataset with multiple splits, but `split` is not specified. What would you expect as a return value in that scenario?", "> `load_dataset` returns a `DatasetDict` object unless `split` is defined, in which case it returns a `Dataset` (or a list of datasets if `split` is a list). We've discussed dropping `DatasetDict` from the API in #5189 to always return the same type in `load_dataset` and support datasets without (explicit) splits. IIRC the main discussion point is deciding what to return when loading a dataset with multiple splits, but `split` is not specified. What would you expect as a return value in that scenario?\r\n\r\nWouldn't a dataset with multiple splits already have keys and their related data arrays?\r\n\r\nLets say the dataset has \"train\" : trainset, \"valid\": validset and \"test\": testset\r\n\r\nSo a dictionary can be returned,, i.e.\r\n\r\n{ \r\n\"train\": trainset,\r\n\"valid\": validset,\r\n\"test\": testset\r\n}\r\n\r\nif a split is provided split=['train[:80%]', 'valid[80%:90%]', 'test[90%:100%]']\r\n\r\nwould also return the same dictionary as above.\r\n\r\nsplit='train[:10%]' should return the same value as split=['train[:10%]']\r\n\r\n{\r\n\"train\": trainset\r\n}\r\n " ]
2023-10-25T17:08:39
2023-10-26T21:03:06
null
NONE
null
null
null
### Describe the bug 1. dataset = load_dataset("togethercomputer/RedPajama-Data-1T-Sample", cache_dir=training_args.cache_dir, split='train[:1%]') 2. dataset = load_dataset("togethercomputer/RedPajama-Data-1T-Sample", cache_dir=training_args.cache_dir) The only difference I would expect these calls to have is the size of the dataset. But, while 2. returns a dictionary with "train" key in it, 1. returns a dataset WITHOUT any initial "train" keyword. Both calls are to be used within exactly the same context. They should return identically structured datasets of different size. ### Steps to reproduce the bug See above. ### Expected behavior Expect both calls to return the same structured Dataset structure but with different number of elements, i.e. call 1. should have 1% of the data of the call 2.0 ### Environment info Ubuntu 20.04 gcc 9.x.x. It is really irrelevant.
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6350/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6350/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6349
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6349/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6349/comments
https://api.github.com/repos/huggingface/datasets/issues/6349/events
https://github.com/huggingface/datasets/issues/6349
1,961,435,673
I_kwDODunzps506SIZ
6,349
Can't load ds = load_dataset("imdb")
{ "login": "vivianc2", "id": 86415736, "node_id": "MDQ6VXNlcjg2NDE1NzM2", "avatar_url": "https://avatars.githubusercontent.com/u/86415736?v=4", "gravatar_id": "", "url": "https://api.github.com/users/vivianc2", "html_url": "https://github.com/vivianc2", "followers_url": "https://api.github.com/users/vivianc2/followers", "following_url": "https://api.github.com/users/vivianc2/following{/other_user}", "gists_url": "https://api.github.com/users/vivianc2/gists{/gist_id}", "starred_url": "https://api.github.com/users/vivianc2/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/vivianc2/subscriptions", "organizations_url": "https://api.github.com/users/vivianc2/orgs", "repos_url": "https://api.github.com/users/vivianc2/repos", "events_url": "https://api.github.com/users/vivianc2/events{/privacy}", "received_events_url": "https://api.github.com/users/vivianc2/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "I'm unable to reproduce this error. The server hosting the files may have been down temporarily, so try again.", "getting the same error" ]
2023-10-25T13:29:51
2024-01-26T15:31:36
2023-10-31T19:59:35
NONE
null
null
null
### Describe the bug I did `from datasets import load_dataset, load_metric` and then `ds = load_dataset("imdb")` and it gave me the error: ExpectedMoreDownloadedFiles: {'http://ai.stanford.edu/~amaas/data/sentiment/aclImdb_v1.tar.gz'} I tried doing `ds = load_dataset("imdb",download_mode="force_redownload")` as well as reinstalling dataset. I still face this problem. ### Steps to reproduce the bug 1. from datasets import load_dataset, load_metric 2. ds = load_dataset("imdb") ### Expected behavior It should load and give me this when I run `ds` DatasetDict({ train: Dataset({ features: ['text', 'label'], num_rows: 25000 }) test: Dataset({ features: ['text', 'label'], num_rows: 25000 }) unsupervised: Dataset({ features: ['text', 'label'], num_rows: 50000 }) }) ### Environment info - `datasets` version: 2.14.6 - Platform: Linux-5.4.0-164-generic-x86_64-with-glibc2.17 - Python version: 3.8.18 - Huggingface_hub version: 0.16.2 - PyArrow version: 13.0.0 - Pandas version: 2.0.2
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6349/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6349/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6348
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6348/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6348/comments
https://api.github.com/repos/huggingface/datasets/issues/6348/events
https://github.com/huggingface/datasets/issues/6348
1,961,268,504
I_kwDODunzps505pUY
6,348
Parquet stream-conversion fails to embed images/audio files from gated repos
{ "login": "severo", "id": 1676121, "node_id": "MDQ6VXNlcjE2NzYxMjE=", "avatar_url": "https://avatars.githubusercontent.com/u/1676121?v=4", "gravatar_id": "", "url": "https://api.github.com/users/severo", "html_url": "https://github.com/severo", "followers_url": "https://api.github.com/users/severo/followers", "following_url": "https://api.github.com/users/severo/following{/other_user}", "gists_url": "https://api.github.com/users/severo/gists{/gist_id}", "starred_url": "https://api.github.com/users/severo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/severo/subscriptions", "organizations_url": "https://api.github.com/users/severo/orgs", "repos_url": "https://api.github.com/users/severo/repos", "events_url": "https://api.github.com/users/severo/events{/privacy}", "received_events_url": "https://api.github.com/users/severo/received_events", "type": "User", "site_admin": false }
[ { "id": 1935892857, "node_id": "MDU6TGFiZWwxOTM1ODkyODU3", "url": "https://api.github.com/repos/huggingface/datasets/labels/bug", "name": "bug", "color": "d73a4a", "default": true, "description": "Something isn't working" } ]
open
false
null
[]
null
[]
2023-10-25T12:12:44
2023-10-25T12:13:07
null
CONTRIBUTOR
null
null
null
it seems to be an issue with datasets not passing the token to embed_table_storage when generating a dataset See https://github.com/huggingface/datasets-server/issues/2010
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6348/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6348/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6347
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6347/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6347/comments
https://api.github.com/repos/huggingface/datasets/issues/6347/events
https://github.com/huggingface/datasets/issues/6347
1,959,004,835
I_kwDODunzps50xAqj
6,347
Incorrect example code in 'Create a dataset' docs
{ "login": "rwood-97", "id": 72076688, "node_id": "MDQ6VXNlcjcyMDc2Njg4", "avatar_url": "https://avatars.githubusercontent.com/u/72076688?v=4", "gravatar_id": "", "url": "https://api.github.com/users/rwood-97", "html_url": "https://github.com/rwood-97", "followers_url": "https://api.github.com/users/rwood-97/followers", "following_url": "https://api.github.com/users/rwood-97/following{/other_user}", "gists_url": "https://api.github.com/users/rwood-97/gists{/gist_id}", "starred_url": "https://api.github.com/users/rwood-97/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rwood-97/subscriptions", "organizations_url": "https://api.github.com/users/rwood-97/orgs", "repos_url": "https://api.github.com/users/rwood-97/repos", "events_url": "https://api.github.com/users/rwood-97/events{/privacy}", "received_events_url": "https://api.github.com/users/rwood-97/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "This was fixed in https://github.com/huggingface/datasets/pull/6247. You can find the fix in the `main` version of the docs", "Ah great, thanks :)" ]
2023-10-24T11:01:21
2023-10-25T13:05:21
2023-10-25T13:05:21
NONE
null
null
null
### Describe the bug On [this](https://huggingface.co/docs/datasets/create_dataset) page, the example code for loading in images and audio is incorrect. Currently, examples are: ``` python from datasets import ImageFolder dataset = load_dataset("imagefolder", data_dir="/path/to/pokemon") ``` and ``` python from datasets import AudioFolder dataset = load_dataset("audiofolder", data_dir="/path/to/folder") ``` I'm pretty sure the imports are wrong and should be: ``` python from datasets import load_dataset dataset = load_dataset("audiofolder", data_dir="/path/to/folder") ``` I am happy to update this if this is right but just wanted to check before making any changes. ### Steps to reproduce the bug Go to https://huggingface.co/docs/datasets/create_dataset ### Expected behavior N/A ### Environment info N/A
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6347/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6347/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6345
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6345/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6345/comments
https://api.github.com/repos/huggingface/datasets/issues/6345/events
https://github.com/huggingface/datasets/issues/6345
1,957,707,870
I_kwDODunzps50sEBe
6,345
support squad structure datasets using a YAML parameter
{ "login": "MajdTannous1", "id": 138524319, "node_id": "U_kgDOCEG2nw", "avatar_url": "https://avatars.githubusercontent.com/u/138524319?v=4", "gravatar_id": "", "url": "https://api.github.com/users/MajdTannous1", "html_url": "https://github.com/MajdTannous1", "followers_url": "https://api.github.com/users/MajdTannous1/followers", "following_url": "https://api.github.com/users/MajdTannous1/following{/other_user}", "gists_url": "https://api.github.com/users/MajdTannous1/gists{/gist_id}", "starred_url": "https://api.github.com/users/MajdTannous1/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/MajdTannous1/subscriptions", "organizations_url": "https://api.github.com/users/MajdTannous1/orgs", "repos_url": "https://api.github.com/users/MajdTannous1/repos", "events_url": "https://api.github.com/users/MajdTannous1/events{/privacy}", "received_events_url": "https://api.github.com/users/MajdTannous1/received_events", "type": "User", "site_admin": false }
[ { "id": 1935892871, "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement", "name": "enhancement", "color": "a2eeef", "default": true, "description": "New feature or request" } ]
open
false
null
[]
null
[]
2023-10-23T17:55:37
2023-10-23T17:55:37
null
NONE
null
null
null
### Feature request Since the squad structure is widely used, I think it could be beneficial to support it using a YAML parameter. could you implement automatic data loading of squad-like data using squad JSON format, to read it from JSON files and view it in the correct squad structure. The dataset structure should be like this: https://huggingface.co/datasets/squad Columns:id,title,context,question,answers ### Motivation Dataset repo requires arbitrary Python code execution ### Your contribution The dataset structure should be like this: https://huggingface.co/datasets/squad Columns:id,title,context,question,answers train and dev sets in squad structure JSON files
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6345/reactions", "total_count": 1, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 1 }
https://api.github.com/repos/huggingface/datasets/issues/6345/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6333
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6333/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6333/comments
https://api.github.com/repos/huggingface/datasets/issues/6333/events
https://github.com/huggingface/datasets/issues/6333
1,956,714,423
I_kwDODunzps50oRe3
6,333
Support fsspec 2023.10.0
{ "login": "albertvillanova", "id": 8515462, "node_id": "MDQ6VXNlcjg1MTU0NjI=", "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "gravatar_id": "", "url": "https://api.github.com/users/albertvillanova", "html_url": "https://github.com/albertvillanova", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "repos_url": "https://api.github.com/users/albertvillanova/repos", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "type": "User", "site_admin": false }
[]
closed
false
{ "login": "albertvillanova", "id": 8515462, "node_id": "MDQ6VXNlcjg1MTU0NjI=", "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "gravatar_id": "", "url": "https://api.github.com/users/albertvillanova", "html_url": "https://github.com/albertvillanova", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "repos_url": "https://api.github.com/users/albertvillanova/repos", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "type": "User", "site_admin": false }
[ { "login": "albertvillanova", "id": 8515462, "node_id": "MDQ6VXNlcjg1MTU0NjI=", "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "gravatar_id": "", "url": "https://api.github.com/users/albertvillanova", "html_url": "https://github.com/albertvillanova", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "repos_url": "https://api.github.com/users/albertvillanova/repos", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "type": "User", "site_admin": false } ]
null
[ "Hi @albertvillanova @lhoestq \r\n\r\nI believe the pull request that pins the fsspec version (https://github.com/huggingface/datasets/pull/6331) was merged by mistake. Another fix for the issue was merged on the same day an hour apart. See https://github.com/huggingface/datasets/pull/6334\r\n\r\nI'm now having an issue in my project where I can't use newer versions of fsspec.\r\n\r\nCan we remove the pin?\r\n\r\nHave a nice day! :)", "Hi @tomscholz,\r\n\r\nThanks for pointing this out. I think you are right.\r\n\r\nI am doing some cross-checks and fixing it. ", "Hi again, @tomscholz.\r\n\r\nAfter a more cautious investigation, I think the pin is OK because there are other reasons for it. Chronologically:\r\n- #6331 \r\n- #6334\r\n- #6336 \r\n- #6337 \r\n\r\nThe reason is that after version 2023.10.0, they changed again the behavior of their `glob` function. See: https://github.com/huggingface/datasets/pull/6337#issuecomment-1774930135\r\nWe are working on our side to support both previous and new glob behavior.\r\n\r\nNote:\r\n- First pin was < 2023.10.0\r\n- Last pin is <= 2023.10.0", "Fixed by #6334 and #6336." ]
2023-10-23T09:14:53
2024-02-07T12:39:58
2024-02-07T12:39:58
MEMBER
null
null
null
Once root issue is fixed, remove temporary pin of fsspec < 2023.10.0 introduced by: - #6331 Related to issue: - #6330 As @ZachNagengast suggested, the issue might be related to: - https://github.com/fsspec/filesystem_spec/pull/1381
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6333/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6333/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6330
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6330/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6330/comments
https://api.github.com/repos/huggingface/datasets/issues/6330/events
https://github.com/huggingface/datasets/issues/6330
1,956,053,294
I_kwDODunzps50lwEu
6,330
Latest fsspec==2023.10.0 issue with streaming datasets
{ "login": "ZachNagengast", "id": 1981179, "node_id": "MDQ6VXNlcjE5ODExNzk=", "avatar_url": "https://avatars.githubusercontent.com/u/1981179?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ZachNagengast", "html_url": "https://github.com/ZachNagengast", "followers_url": "https://api.github.com/users/ZachNagengast/followers", "following_url": "https://api.github.com/users/ZachNagengast/following{/other_user}", "gists_url": "https://api.github.com/users/ZachNagengast/gists{/gist_id}", "starred_url": "https://api.github.com/users/ZachNagengast/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ZachNagengast/subscriptions", "organizations_url": "https://api.github.com/users/ZachNagengast/orgs", "repos_url": "https://api.github.com/users/ZachNagengast/repos", "events_url": "https://api.github.com/users/ZachNagengast/events{/privacy}", "received_events_url": "https://api.github.com/users/ZachNagengast/received_events", "type": "User", "site_admin": false }
[]
closed
false
{ "login": "albertvillanova", "id": 8515462, "node_id": "MDQ6VXNlcjg1MTU0NjI=", "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "gravatar_id": "", "url": "https://api.github.com/users/albertvillanova", "html_url": "https://github.com/albertvillanova", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "repos_url": "https://api.github.com/users/albertvillanova/repos", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "type": "User", "site_admin": false }
[ { "login": "albertvillanova", "id": 8515462, "node_id": "MDQ6VXNlcjg1MTU0NjI=", "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "gravatar_id": "", "url": "https://api.github.com/users/albertvillanova", "html_url": "https://github.com/albertvillanova", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "repos_url": "https://api.github.com/users/albertvillanova/repos", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "type": "User", "site_admin": false } ]
null
[ "I also encountered a similar error below.\r\nAppreciate the team could shed some light on this issue.\r\n\r\n```\r\n---------------------------------------------------------------------------\r\nNotImplementedError Traceback (most recent call last)\r\n[/home/ubuntu/work/EveryDream2trainer/prepare_dataset.ipynb](https://vscode-remote+ssh-002dremote-002braspberry-002dg5-002e4x.vscode-resource.vscode-cdn.net/home/ubuntu/work/EveryDream2trainer/prepare_dataset.ipynb) Cell 1 line 4\r\n [1](vscode-notebook-cell://ssh-remote%2Braspberry-g5.4x/home/ubuntu/work/EveryDream2trainer/prepare_dataset.ipynb#W0sdnNjb2RlLXJlbW90ZQ%3D%3D?line=0) from datasets import load_dataset, load_dataset\r\n [3](vscode-notebook-cell://ssh-remote%2Braspberry-g5.4x/home/ubuntu/work/EveryDream2trainer/prepare_dataset.ipynb#W0sdnNjb2RlLXJlbW90ZQ%3D%3D?line=2) # ds = load_dataset(\"parquet\", data_dir=\"/home/ubuntu/work/EveryDream2trainer/datasets/monse_v1/data\")\r\n----> [4](vscode-notebook-cell://ssh-remote%2Braspberry-g5.4x/home/ubuntu/work/EveryDream2trainer/prepare_dataset.ipynb#W0sdnNjb2RlLXJlbW90ZQ%3D%3D?line=3) ds = load_dataset(\"Raspberry-ai/monse-v1\")\r\n\r\nFile [/opt/conda/envs/everydream/lib/python3.10/site-packages/datasets/load.py:1804](https://vscode-remote+ssh-002dremote-002braspberry-002dg5-002e4x.vscode-resource.vscode-cdn.net/opt/conda/envs/everydream/lib/python3.10/site-packages/datasets/load.py:1804), 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, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs)\r\n 1800 # Build dataset for splits\r\n 1801 keep_in_memory = (\r\n 1802 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size)\r\n 1803 )\r\n-> 1804 ds = builder_instance.as_dataset(split=split, verification_mode=verification_mode, in_memory=keep_in_memory)\r\n 1805 # Rename and cast features to match task schema\r\n 1806 if task is not None:\r\n\r\nFile [/opt/conda/envs/everydream/lib/python3.10/site-packages/datasets/builder.py:1108](https://vscode-remote+ssh-002dremote-002braspberry-002dg5-002e4x.vscode-resource.vscode-cdn.net/opt/conda/envs/everydream/lib/python3.10/site-packages/datasets/builder.py:1108), in DatasetBuilder.as_dataset(self, split, run_post_process, verification_mode, ignore_verifications, in_memory)\r\n 1106 is_local = not is_remote_filesystem(self._fs)\r\n 1107 if not is_local:\r\n-> 1108 raise NotImplementedError(f\"Loading a dataset cached in a {type(self._fs).__name__} is not supported.\")\r\n 1109 if not os.path.exists(self._output_dir):\r\n 1110 raise FileNotFoundError(\r\n 1111 f\"Dataset {self.name}: could not find data in {self._output_dir}. Please make sure to call \"\r\n 1112 \"builder.download_and_prepare(), or use \"\r\n 1113 \"datasets.load_dataset() before trying to access the Dataset object.\"\r\n 1114 )\r\n\r\nNotImplementedError: Loading a dataset cached in a LocalFileSystem is not supported.\r\n```\r\n\r\nCode to reproduce the issue:\r\n\r\n```\r\nfrom datasets import load_dataset\r\n\r\nds = load_dataset(\"Raspberry-ai/monse-v1\")\r\n```\r\n\r\n\r\nDependencies:\r\n```\r\nPackage Version\r\n------------------------- ------------\r\nabsl-py 2.0.0\r\naccelerate 0.23.0\r\naiohttp 3.8.4\r\naiosignal 1.3.1\r\nantlr4-python3-runtime 4.9.3\r\nanyio 4.0.0\r\nappdirs 1.4.4\r\nargon2-cffi 23.1.0\r\nargon2-cffi-bindings 21.2.0\r\narrow 1.3.0\r\nasttokens 2.4.0\r\nasync-lru 2.0.4\r\nasync-timeout 4.0.3\r\nattrs 23.1.0\r\nBabel 2.13.0\r\nbackcall 0.2.0\r\nbeautifulsoup4 4.12.2\r\nbitsandbytes 0.41.1\r\nbleach 6.1.0\r\nbraceexpand 0.1.7\r\ncachetools 5.3.1\r\ncertifi 2023.7.22\r\ncffi 1.16.0\r\ncharset-normalizer 3.3.1\r\nclick 8.1.7\r\ncmake 3.27.7\r\ncolorama 0.4.6\r\ncomm 0.1.4\r\ncompel 1.1.6\r\ndatasets 2.11.0\r\ndebugpy 1.8.0\r\ndecorator 5.1.1\r\ndefusedxml 0.7.1\r\ndiffusers 0.18.0\r\ndill 0.3.6\r\ndocker-pycreds 0.4.0\r\ndowg 0.3.1\r\neinops 0.7.0\r\neinops-exts 0.0.4\r\nexceptiongroup 1.1.3\r\nexecuting 2.0.0\r\nfastjsonschema 2.18.1\r\nfilelock 3.12.4\r\nfqdn 1.5.1\r\nfrozenlist 1.4.0\r\nfsspec 2023.10.0\r\nftfy 6.1.1\r\ngitdb 4.0.11\r\nGitPython 3.1.40\r\ngoogle-auth 2.23.3\r\ngoogle-auth-oauthlib 1.1.0\r\ngrpcio 1.59.0\r\nhuggingface-hub 0.18.0\r\nidna 3.4\r\nimportlib-metadata 6.8.0\r\ninflection 0.5.1\r\nipykernel 6.25.2\r\nipython 8.16.1\r\nisoduration 20.11.0\r\njedi 0.19.1\r\nJinja2 3.1.2\r\njoblib 1.3.2\r\njson5 0.9.14\r\njsonpointer 2.4\r\njsonschema 4.19.1\r\njsonschema-specifications 2023.7.1\r\njupyter_client 8.4.0\r\njupyter_core 5.4.0\r\njupyter-events 0.8.0\r\njupyter-lsp 2.2.0\r\njupyter_server 2.8.0\r\njupyter_server_terminals 0.4.4\r\njupyterlab 4.0.7\r\njupyterlab-pygments 0.2.2\r\njupyterlab_server 2.25.0\r\nlightning-utilities 0.9.0\r\nlion-pytorch 0.1.2\r\nlit 17.0.3\r\nMarkdown 3.5\r\nMarkupSafe 2.1.3\r\nmatplotlib-inline 0.1.6\r\nmistune 3.0.2\r\nmore-itertools 10.1.0\r\nmpmath 1.3.0\r\nmultidict 6.0.4\r\nmultiprocess 0.70.14\r\nmypy-extensions 1.0.0\r\nnbclient 0.8.0\r\nnbconvert 7.9.2\r\nnbformat 5.9.2\r\nnest-asyncio 1.5.8\r\nnetworkx 3.2\r\nnltk 3.8.1\r\nnotebook_shim 0.2.3\r\nnumpy 1.23.5\r\noauthlib 3.2.2\r\nomegaconf 2.2.3\r\nopen-clip-torch 2.22.0\r\nopen-flamingo 2.0.0\r\noverrides 7.4.0\r\npackaging 23.2\r\npandas 2.1.1\r\npandocfilters 1.5.0\r\nparso 0.8.3\r\npathtools 0.1.2\r\npexpect 4.8.0\r\npickleshare 0.7.5\r\nPillow 10.1.0\r\npip 23.3.1\r\nplatformdirs 3.11.0\r\nprometheus-client 0.17.1\r\nprompt-toolkit 3.0.39\r\nprotobuf 3.20.1\r\npsutil 5.9.6\r\nptyprocess 0.7.0\r\npure-eval 0.2.2\r\npyarrow 13.0.0\r\npyasn1 0.5.0\r\npyasn1-modules 0.3.0\r\npycparser 2.21\r\npyDeprecate 0.3.2\r\nPygments 2.16.1\r\npynvml 11.4.1\r\npyparsing 3.1.1\r\npyre-extensions 0.0.29\r\npython-dateutil 2.8.2\r\npython-json-logger 2.0.7\r\npytorch-lightning 1.6.5\r\npytz 2023.3.post1\r\nPyYAML 6.0.1\r\npyzmq 25.1.1\r\nreferencing 0.30.2\r\nregex 2023.10.3\r\nrequests 2.31.0\r\nrequests-oauthlib 1.3.1\r\nresponses 0.18.0\r\nrfc3339-validator 0.1.4\r\nrfc3986-validator 0.1.1\r\nrpds-py 0.10.6\r\nrsa 4.9\r\nsafetensors 0.4.0\r\nscipy 1.11.3\r\nSend2Trash 1.8.2\r\nsentencepiece 0.1.98\r\nsentry-sdk 1.32.0\r\nsetproctitle 1.3.3\r\nsetuptools 68.2.2\r\nsix 1.16.0\r\nsmmap 5.0.1\r\nsniffio 1.3.0\r\nsoupsieve 2.5\r\nstack-data 0.6.3\r\nsympy 1.12\r\ntensorboard 2.15.0\r\ntensorboard-data-server 0.7.1\r\nterminado 0.17.1\r\ntimm 0.9.8\r\ntinycss2 1.2.1\r\ntokenizers 0.13.3\r\ntomli 2.0.1\r\ntorch 2.0.1+cu118\r\ntorchmetrics 1.2.0\r\ntorchvision 0.15.2+cu118\r\ntornado 6.3.3\r\ntqdm 4.66.1\r\ntraitlets 5.11.2\r\ntransformers 4.29.2\r\ntriton 2.0.0\r\ntypes-python-dateutil 2.8.19.14\r\ntyping_extensions 4.8.0\r\ntyping-inspect 0.9.0\r\ntzdata 2023.3\r\nuri-template 1.3.0\r\nurllib3 2.0.7\r\nwandb 0.15.12\r\nwcwidth 0.2.8\r\nwebcolors 1.13\r\nwebdataset 0.2.62\r\nwebencodings 0.5.1\r\nwebsocket-client 1.6.4\r\nWerkzeug 3.0.0\r\nwheel 0.41.2\r\nxformers 0.0.20\r\nxxhash 3.4.1\r\nyarl 1.9.2\r\nzipp 3.17.0\r\n```", "@humpydonkey FWIW setting fsspec down to 2023.9.2 fixed the issue\r\n\r\n`pip install fsspec==2023.9.2`", "got it, thanks @ZachNagengast ", "Thanks for reporting and for the investigation, @ZachNagengast! :hugs: \r\n\r\nWe are investigating the root cause of the issue. In the meantime, we are going to pin fsspec < 2023.10.0. ", "https://stackoverflow.com/questions/77433096/notimplementederror-loading-a-dataset-cached-in-a-localfilesystem-is-not-suppor/77433141#77433141", "You can also update `datasets`:\r\n\r\n```\r\npip install -U datasets\r\n```\r\n\r\nIt will also update `fsspec` to use the right version" ]
2023-10-22T20:57:10
2023-11-07T10:02:14
2023-10-23T09:17:56
CONTRIBUTOR
null
null
null
### Describe the bug Loading a streaming dataset with this version of fsspec fails with the following error: `NotImplementedError: Loading a streaming dataset cached in a LocalFileSystem is not supported yet.` I suspect the issue is with this PR https://github.com/fsspec/filesystem_spec/pull/1381 ### Steps to reproduce the bug 1. Upgrade fsspec to version `2023.10.0` 2. Attempt to load a streaming dataset e.g. `load_dataset("laion/gpt4v-emotion-dataset", split="train", streaming=True)` 3. Observe the following exception: ``` File "/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/site-packages/datasets/load.py", line 2146, in load_dataset return builder_instance.as_streaming_dataset(split=split) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/site-packages/datasets/builder.py", line 1318, in as_streaming_dataset raise NotImplementedError( NotImplementedError: Loading a streaming dataset cached in a LocalFileSystem is not supported yet. ``` ### Expected behavior Should stream the dataset as normal. ### Environment info datasets@main fsspec==2023.10.0
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6330/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6330/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6329
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6329/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6329/comments
https://api.github.com/repos/huggingface/datasets/issues/6329/events
https://github.com/huggingface/datasets/issues/6329
1,955,858,020
I_kwDODunzps50lAZk
6,329
شبکه های متن به گفتار ابتدا متن داده شده را به بازنمایی میانی
{ "login": "shabnam706", "id": 147399213, "node_id": "U_kgDOCMkiLQ", "avatar_url": "https://avatars.githubusercontent.com/u/147399213?v=4", "gravatar_id": "", "url": "https://api.github.com/users/shabnam706", "html_url": "https://github.com/shabnam706", "followers_url": "https://api.github.com/users/shabnam706/followers", "following_url": "https://api.github.com/users/shabnam706/following{/other_user}", "gists_url": "https://api.github.com/users/shabnam706/gists{/gist_id}", "starred_url": "https://api.github.com/users/shabnam706/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/shabnam706/subscriptions", "organizations_url": "https://api.github.com/users/shabnam706/orgs", "repos_url": "https://api.github.com/users/shabnam706/repos", "events_url": "https://api.github.com/users/shabnam706/events{/privacy}", "received_events_url": "https://api.github.com/users/shabnam706/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[]
2023-10-22T11:07:46
2023-10-23T09:22:58
2023-10-23T09:22:58
NONE
null
null
null
شبکه های متن به گفتار ابتدا متن داده شده را به بازنمایی میانی
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6329/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6329/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6328
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6328/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6328/comments
https://api.github.com/repos/huggingface/datasets/issues/6328/events
https://github.com/huggingface/datasets/issues/6328
1,955,857,904
I_kwDODunzps50lAXw
6,328
شبکه های متن به گفتار ابتدا متن داده شده را به بازنمایی میانی
{ "login": "shabnam706", "id": 147399213, "node_id": "U_kgDOCMkiLQ", "avatar_url": "https://avatars.githubusercontent.com/u/147399213?v=4", "gravatar_id": "", "url": "https://api.github.com/users/shabnam706", "html_url": "https://github.com/shabnam706", "followers_url": "https://api.github.com/users/shabnam706/followers", "following_url": "https://api.github.com/users/shabnam706/following{/other_user}", "gists_url": "https://api.github.com/users/shabnam706/gists{/gist_id}", "starred_url": "https://api.github.com/users/shabnam706/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/shabnam706/subscriptions", "organizations_url": "https://api.github.com/users/shabnam706/orgs", "repos_url": "https://api.github.com/users/shabnam706/repos", "events_url": "https://api.github.com/users/shabnam706/events{/privacy}", "received_events_url": "https://api.github.com/users/shabnam706/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "شبکه های متن به گفتار ابتدا متن داده شده را به بازنمایی میانی" ]
2023-10-22T11:07:21
2023-10-23T09:22:38
2023-10-23T09:22:38
NONE
null
null
null
null
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6328/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6328/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6327
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6327/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6327/comments
https://api.github.com/repos/huggingface/datasets/issues/6327/events
https://github.com/huggingface/datasets/issues/6327
1,955,470,755
I_kwDODunzps50jh2j
6,327
FileNotFoundError when trying to load the downloaded dataset with `load_dataset(..., streaming=True)`
{ "login": "yzhangcs", "id": 18402347, "node_id": "MDQ6VXNlcjE4NDAyMzQ3", "avatar_url": "https://avatars.githubusercontent.com/u/18402347?v=4", "gravatar_id": "", "url": "https://api.github.com/users/yzhangcs", "html_url": "https://github.com/yzhangcs", "followers_url": "https://api.github.com/users/yzhangcs/followers", "following_url": "https://api.github.com/users/yzhangcs/following{/other_user}", "gists_url": "https://api.github.com/users/yzhangcs/gists{/gist_id}", "starred_url": "https://api.github.com/users/yzhangcs/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/yzhangcs/subscriptions", "organizations_url": "https://api.github.com/users/yzhangcs/orgs", "repos_url": "https://api.github.com/users/yzhangcs/repos", "events_url": "https://api.github.com/users/yzhangcs/events{/privacy}", "received_events_url": "https://api.github.com/users/yzhangcs/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "You can clone the `togethercomputer/RedPajama-Data-1T-Sample` repo and load the dataset with `load_dataset(\"path/to/cloned_repo\")` to use it offline.", "@mariosasko Thank you for your kind reply! I'll try it as a workaround.\r\nDoes that mean that currently it's not supported to simply load with a short name?", "It is, but manually downloading repo files to the cache can easily lead to failure (the HF cache is not meant to be modified by a user besides deleting the files 🙂), as in your case. Hence, the clone + `load_dataset(\"path/to/cloned_repo\")` workflow should be used instead." ]
2023-10-21T12:27:03
2023-10-23T18:50:07
2023-10-23T18:50:07
NONE
null
null
null
### Describe the bug Hi, I'm trying to load the dataset `togethercomputer/RedPajama-Data-1T-Sample` with `load_dataset` in streaming mode, i.e., `streaming=True`, but `FileNotFoundError` occurs. ### Steps to reproduce the bug I've downloaded the dataset and save it to the cache dir in advance. My hope is loading the files in offline environment and without taking too much hours to prepross the entire data before running into the training process. So I try the following code to load the files streamingly ```py dataset = load_dataset('togethercomputer/RedPajama-Data-1T-Sample', streaming=True) print(next(iter(dataset['train']))) ``` Sadly, it raises the following: ``` FileNotFoundError: [Errno 2] No such file or directory: 'CURRENT_CODE_PATH/arxiv_sample.jsonl' ``` I've noticed that the dataset can be properly found in the begining ``` Using the latest cached version of the module from /root/.cache/huggingface/modules/datasets_modules/datasets/togethercomputer--RedPajama-Data-1T-Sample/6ea3bc8ec2e84ec6d2df1930942e9028ace8c5b9d9143823cf911c50bbd92039 (last modified on Sat Oct 21 20:12:57 2023) since it couldn't be found locally at togethercomputer/RedPajama-Data-1T-Sample., or remotely on the Hugging Face Hub. ``` But it seems that the paths couldn't be properly parsed when loading iteratively. How should I fix this error. I've tried specifying `data_files` or `data_dir` as `.../arxiv_sample.jsonl` but none of them works. Thanks. ### Expected behavior Properly load the dataset. ### Environment info `datasets==2.14.5`
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6327/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6327/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6324
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6324/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6324/comments
https://api.github.com/repos/huggingface/datasets/issues/6324/events
https://github.com/huggingface/datasets/issues/6324
1,955,126,687
I_kwDODunzps50iN2f
6,324
Conversion to Arrow fails due to wrong type heuristic
{ "login": "jphme", "id": 2862336, "node_id": "MDQ6VXNlcjI4NjIzMzY=", "avatar_url": "https://avatars.githubusercontent.com/u/2862336?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jphme", "html_url": "https://github.com/jphme", "followers_url": "https://api.github.com/users/jphme/followers", "following_url": "https://api.github.com/users/jphme/following{/other_user}", "gists_url": "https://api.github.com/users/jphme/gists{/gist_id}", "starred_url": "https://api.github.com/users/jphme/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jphme/subscriptions", "organizations_url": "https://api.github.com/users/jphme/orgs", "repos_url": "https://api.github.com/users/jphme/repos", "events_url": "https://api.github.com/users/jphme/events{/privacy}", "received_events_url": "https://api.github.com/users/jphme/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "Unlike Pandas, Arrow is strict with types, so converting the problematic strings to ints (or ints to strings) to ensure all the values have the same type is the only fix. \r\n\r\nJSON support has been requested in Arrow [here](https://github.com/apache/arrow/issues/32538), but I don't expect this to be implemented soon. \r\n\r\nAlso, this type could be represented with the Arrow Union type. However, due to low usage, the Union type has limited support in the Arrow ecosystem (e.g., IIRC Parquet still does not support it). So, we should probably wait a bit more before adding support for it in `datasets`", "> Unlike Pandas, Arrow is strict with types, so converting the problematic strings to ints (or ints to strings) to ensure all the values have the same type is the only fix.\r\n> \r\n> JSON support has been requested in Arrow [here](https://github.com/apache/arrow/issues/32538), but I don't expect this to be implemented soon.\r\n> \r\n> Also, this type could be represented with the Arrow Union type. However, due to low usage, the Union type has limited support in the Arrow ecosystem (e.g., IIRC Parquet still does not support it). So, we should probably wait a bit more before adding support for it in `datasets`\r\n\r\nOk many thanks, I was able to mitigate the problem by manually checking and converting all problematic fields now." ]
2023-10-20T23:20:58
2023-10-23T20:52:57
2023-10-23T20:52:57
NONE
null
null
null
### Describe the bug I have a list of dictionaries with valid/JSON-serializable values. One key is the denominator for a paragraph. In 99.9% of cases its a number, but there are some occurences of '1a', '2b' and so on. If trying to convert this list to a dataset with `Dataset.from_list()`, I always get `ArrowInvalid: Could not convert '1' with type str: tried to convert to int64`, presumably because pyarrow tries to convert the keys to integers. Is there any way to circumvent this and fix dtypes? I didn't find anything in the documentation. ### Steps to reproduce the bug * create a list of dicts with one key being a string of an integer for the first few thousand occurences and try to convert to dataset. ### Expected behavior There shouldn't be an error (e.g. some flag to turn off automatic str to numeric conversion). ### Environment info - `datasets` version: 2.14.5 - Platform: Linux-5.15.0-84-generic-x86_64-with-glibc2.35 - Python version: 3.9.18 - Huggingface_hub version: 0.17.3 - PyArrow version: 13.0.0 - Pandas version: 2.1.1
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6324/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6324/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6323
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6323/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6323/comments
https://api.github.com/repos/huggingface/datasets/issues/6323/events
https://github.com/huggingface/datasets/issues/6323
1,954,245,980
I_kwDODunzps50e21c
6,323
Loading dataset from large GCS bucket very slow since 2.14
{ "login": "jbcdnr", "id": 6209990, "node_id": "MDQ6VXNlcjYyMDk5OTA=", "avatar_url": "https://avatars.githubusercontent.com/u/6209990?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jbcdnr", "html_url": "https://github.com/jbcdnr", "followers_url": "https://api.github.com/users/jbcdnr/followers", "following_url": "https://api.github.com/users/jbcdnr/following{/other_user}", "gists_url": "https://api.github.com/users/jbcdnr/gists{/gist_id}", "starred_url": "https://api.github.com/users/jbcdnr/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jbcdnr/subscriptions", "organizations_url": "https://api.github.com/users/jbcdnr/orgs", "repos_url": "https://api.github.com/users/jbcdnr/repos", "events_url": "https://api.github.com/users/jbcdnr/events{/privacy}", "received_events_url": "https://api.github.com/users/jbcdnr/received_events", "type": "User", "site_admin": false }
[]
open
false
null
[]
null
[]
2023-10-20T12:59:55
2023-10-20T12:59:55
null
NONE
null
null
null
### Describe the bug Since updating to >2.14 we have very slow access to our parquet files on GCS when loading a dataset (>30 min vs 3s). Our GCS bucket has many objects and resolving globs is very slow. I could track down the problem to this change: https://github.com/huggingface/datasets/blame/bade7af74437347a760830466eb74f7a8ce0d799/src/datasets/data_files.py#L348 The underlying implementation with gcsfs is really slow. Could you go back to the old way if we are simply giving the parquet files and no glob pattern? Thank you. ### Steps to reproduce the bug Load a dataset from a GCS bucket that has many files. ### Expected behavior Used to be fast (3s) in 2.13 ### Environment info datasets==2.14.5
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6323/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6323/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6320
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6320/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6320/comments
https://api.github.com/repos/huggingface/datasets/issues/6320/events
https://github.com/huggingface/datasets/issues/6320
1,952,618,316
I_kwDODunzps50YpdM
6,320
Dataset slice splits can't load training and validation at the same time
{ "login": "timlac", "id": 32488097, "node_id": "MDQ6VXNlcjMyNDg4MDk3", "avatar_url": "https://avatars.githubusercontent.com/u/32488097?v=4", "gravatar_id": "", "url": "https://api.github.com/users/timlac", "html_url": "https://github.com/timlac", "followers_url": "https://api.github.com/users/timlac/followers", "following_url": "https://api.github.com/users/timlac/following{/other_user}", "gists_url": "https://api.github.com/users/timlac/gists{/gist_id}", "starred_url": "https://api.github.com/users/timlac/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/timlac/subscriptions", "organizations_url": "https://api.github.com/users/timlac/orgs", "repos_url": "https://api.github.com/users/timlac/repos", "events_url": "https://api.github.com/users/timlac/events{/privacy}", "received_events_url": "https://api.github.com/users/timlac/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "The expression \"train+test\" concatenates the splits.\r\n\r\nThe individual splits as separate datasets can be obtained as follows:\r\n```python\r\ntrain_ds, test_ds = load_dataset(\"<dataset_name>\", split=[\"train\", \"test\"])\r\ntrain_10pct_ds, test_10pct_ds = load_dataset(\"<dataset_name>\", split=[\"train[:10%]\", \"test[:%10]\"])\r\n```" ]
2023-10-19T16:09:22
2023-11-30T16:21:15
2023-11-30T16:21:15
NONE
null
null
null
### Describe the bug According to the [documentation](https://huggingface.co/docs/datasets/v2.14.5/loading#slice-splits) is should be possible to run the following command: `train_test_ds = datasets.load_dataset("bookcorpus", split="train+test")` to load the train and test sets from the dataset. However executing the equivalent code: `speech_commands_v1 = load_dataset("superb", "ks", split="train+test")` only yields the following output: > Dataset({ > features: ['file', 'audio', 'label'], > num_rows: 54175 > }) Where loading the dataset without the split argument yields: > DatasetDict({ > train: Dataset({ > features: ['file', 'audio', 'label'], > num_rows: 51094 > }) > validation: Dataset({ > features: ['file', 'audio', 'label'], > num_rows: 6798 > }) > test: Dataset({ > features: ['file', 'audio', 'label'], > num_rows: 3081 > }) > }) Thus, the API seems to be broken in this regard. This is a bit annoying since I want to be able to use the split argument with `split="train[:10%]+test[:10%]"` to have smaller dataset to work with when validating my model is working correctly. ### Steps to reproduce the bug `speech_commands_v1 = load_dataset("superb", "ks", split="train+test")` ### Expected behavior > DatasetDict({ > train: Dataset({ > features: ['file', 'audio', 'label'], > num_rows: 51094 > }) > test: Dataset({ > features: ['file', 'audio', 'label'], > num_rows: 3081 > }) > }) ### Environment info ``` import datasets print(datasets.__version__) ``` > 2.14.5 ``` import sys print(sys.version) ``` > 3.9.17 (main, Jul 5 2023, 20:41:20) > [GCC 11.2.0]
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6320/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6320/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6319
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6319/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6319/comments
https://api.github.com/repos/huggingface/datasets/issues/6319/events
https://github.com/huggingface/datasets/issues/6319
1,952,101,717
I_kwDODunzps50WrVV
6,319
Datasets.map is severely broken
{ "login": "phalexo", "id": 4603365, "node_id": "MDQ6VXNlcjQ2MDMzNjU=", "avatar_url": "https://avatars.githubusercontent.com/u/4603365?v=4", "gravatar_id": "", "url": "https://api.github.com/users/phalexo", "html_url": "https://github.com/phalexo", "followers_url": "https://api.github.com/users/phalexo/followers", "following_url": "https://api.github.com/users/phalexo/following{/other_user}", "gists_url": "https://api.github.com/users/phalexo/gists{/gist_id}", "starred_url": "https://api.github.com/users/phalexo/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/phalexo/subscriptions", "organizations_url": "https://api.github.com/users/phalexo/orgs", "repos_url": "https://api.github.com/users/phalexo/repos", "events_url": "https://api.github.com/users/phalexo/events{/privacy}", "received_events_url": "https://api.github.com/users/phalexo/received_events", "type": "User", "site_admin": false }
[]
open
false
null
[]
null
[ "Hi! Instead of processing a single example at a time, you should use the batched `map` for the best performance (with `num_proc=1`) - the fast tokenizers can process a batch's samples in parallel in that scenario.\r\n\r\nE.g., the following code in Colab takes an hour to complete:\r\n```python\r\n# !pip install datasets transformers\r\nfrom datasets import load_dataset\r\nfrom transformers import AutoTokenizer\r\ntokenizer = AutoTokenizer.from_pretrained(\"bert-base-cased\")\r\ndataset = dataset.map(lambda ex: tokenizer(ex[\"text\"]), batched=True, remove_columns=[\"text\", \"meta\"])\r\n```", "Batched is far worse. A single batch of 1000 took hours and that was only 1%\r\n\r\n\r\nOn Thu, Oct 19, 2023, 2:26 PM Mario Šaško ***@***.***> wrote:\r\n\r\n> Hi! You should use the batched map for the best performance (with\r\n> num_proc=1) - the fast tokenizers can process a batch's samples in\r\n> parallel.\r\n>\r\n> E.g., the following code in Colab takes an hour to complete:\r\n>\r\n> # !pip install datasets transformersfrom datasets import load_datasetfrom transformers import AutoTokenizertokenizer = AutoTokenizer.from_pretrained(\"bert-base-cased\")dataset = dataset.map(lambda ex: tokenizer(ex[\"text\"]), batched=True, remove_columns=[\"text\", \"meta\"])\r\n>\r\n> —\r\n> Reply to this email directly, view it on GitHub\r\n> <https://github.com/huggingface/datasets/issues/6319#issuecomment-1771503757>,\r\n> or unsubscribe\r\n> <https://github.com/notifications/unsubscribe-auth/ABDD3ZJHPSRVDEXFNMXR2N3YAFWFZAVCNFSM6AAAAAA6HDKPSCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZRGUYDGNZVG4>\r\n> .\r\n> You are receiving this because you authored the thread.Message ID:\r\n> ***@***.***>\r\n>\r\n", "Can you please provide a self-contained reproducer?", "Which specific version of datasets are you using?\r\n\r\nWhat is the architecture of your colab setup? Ram? Cores? OS?\r\n\r\n\r\nOn Thu, Oct 19, 2023, 2:27 PM pensive introvert ***@***.***>\r\nwrote:\r\n\r\n> Batched is far worse. A single batch of 1000 took hours and that was only\r\n> 1%\r\n>\r\n>\r\n> On Thu, Oct 19, 2023, 2:26 PM Mario Šaško ***@***.***>\r\n> wrote:\r\n>\r\n>> Hi! You should use the batched map for the best performance (with\r\n>> num_proc=1) - the fast tokenizers can process a batch's samples in\r\n>> parallel.\r\n>>\r\n>> E.g., the following code in Colab takes an hour to complete:\r\n>>\r\n>> # !pip install datasets transformersfrom datasets import load_datasetfrom transformers import AutoTokenizertokenizer = AutoTokenizer.from_pretrained(\"bert-base-cased\")dataset = dataset.map(lambda ex: tokenizer(ex[\"text\"]), batched=True, remove_columns=[\"text\", \"meta\"])\r\n>>\r\n>> —\r\n>> Reply to this email directly, view it on GitHub\r\n>> <https://github.com/huggingface/datasets/issues/6319#issuecomment-1771503757>,\r\n>> or unsubscribe\r\n>> <https://github.com/notifications/unsubscribe-auth/ABDD3ZJHPSRVDEXFNMXR2N3YAFWFZAVCNFSM6AAAAAA6HDKPSCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZRGUYDGNZVG4>\r\n>> .\r\n>> You are receiving this because you authored the thread.Message ID:\r\n>> ***@***.***>\r\n>>\r\n>\r\n", "from functools import partial\r\nimport transformers\r\nfrom datasets import load_dataset, concatenate_datasets, load_from_disk\r\n\r\nmodel_name_or_path=\"/opt/data/data/daryl149/llama-2-7b-chat-hf\"\r\noutput_dir=\"/opt/data/data/LongLoRA/checkpoints\"\r\ncache_dir=\"/opt/data/data/LongLoRA/cache\"\r\nmodel_max_length=16384\r\n\r\nIGNORE_INDEX = -100\r\nDEFAULT_PAD_TOKEN = \"[PAD]\"\r\nDEFAULT_EOS_TOKEN = \"</s>\"\r\nDEFAULT_BOS_TOKEN = \"<s>\"\r\nDEFAULT_UNK_TOKEN = \"<unk>\"\r\n\r\n\r\ntokenizer = transformers.LlamaTokenizerFast.from_pretrained(\r\n model_name_or_path,\r\n cache_dir=cache_dir,\r\n model_max_length=model_max_length,\r\n padding_side=\"right\",\r\n use_fast=True,\r\n #use_fast=False\r\n)\r\n\r\nspecial_tokens_dict = dict()\r\nif tokenizer.pad_token is None:\r\n special_tokens_dict[\"pad_token\"] = DEFAULT_PAD_TOKEN\r\nif tokenizer.eos_token is None:\r\n special_tokens_dict[\"eos_token\"] = DEFAULT_EOS_TOKEN\r\nif tokenizer.bos_token is None:\r\n special_tokens_dict[\"bos_token\"] = DEFAULT_BOS_TOKEN\r\nif tokenizer.unk_token is None:\r\n special_tokens_dict[\"unk_token\"] = DEFAULT_UNK_TOKEN\r\n\r\ntokenizer.add_special_tokens(special_tokens_dict)\r\n\r\ndef tokenize_fn(tokenizer, example):\r\n context_length = tokenizer.model_max_length\r\n outputs = tokenizer(\r\n tokenizer.eos_token.join(example[\"text\"]),\r\n #truncation=False,\r\n truncation=True,\r\n return_tensors=\"pt\",\r\n #return_tensors=\"np\",\r\n pad_to_multiple_of=context_length,\r\n padding=True,\r\n )\r\n return {\"input_ids\": outputs[\"input_ids\"].view(-1, context_length)}\r\n\r\nfor idx in range(100):\r\n dataset = load_dataset(\"togethercomputer/RedPajama-Data-1T-Sample\",\r\ncache_dir=cache_dir, split=f'train[{idx}%:{idx+1}%]')\r\n dataset = dataset.map(partial(tokenize_fn, tokenizer), batched=False,\r\nnum_proc=16, remove_columns=[\"text\", \"meta\"])\r\n dataset.save_to_disk(training_args.cache_dir + f\"/training_data_{idx}\")\r\n\r\n\r\nOn Thu, Oct 19, 2023 at 2:30 PM Mario Šaško ***@***.***>\r\nwrote:\r\n\r\n> Can you please provide a self-contained reproducer?\r\n>\r\n> —\r\n> Reply to this email directly, view it on GitHub\r\n> <https://github.com/huggingface/datasets/issues/6319#issuecomment-1771509229>,\r\n> or unsubscribe\r\n> <https://github.com/notifications/unsubscribe-auth/ABDD3ZNBZ3BE7Q4EQZZK6MLYAFWURAVCNFSM6AAAAAA6HDKPSCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZRGUYDSMRSHE>\r\n> .\r\n> You are receiving this because you authored the thread.Message ID:\r\n> ***@***.***>\r\n>\r\n", "I changed the tokenizer to one without \"Fast suffix, and something changed.\r\nThe fraction, although still slowed a lot at 80% was able to get over the\r\nfinish line of 100%\r\n\r\nI have to do more testng, see if the whole set can be processed\r\n\r\n\r\n\r\nOn Thu, Oct 19, 2023 at 3:03 PM pensive introvert <\r\n***@***.***> wrote:\r\n\r\n> from functools import partial\r\n> import transformers\r\n> from datasets import load_dataset, concatenate_datasets, load_from_disk\r\n>\r\n> model_name_or_path=\"/opt/data/data/daryl149/llama-2-7b-chat-hf\"\r\n> output_dir=\"/opt/data/data/LongLoRA/checkpoints\"\r\n> cache_dir=\"/opt/data/data/LongLoRA/cache\"\r\n> model_max_length=16384\r\n>\r\n> IGNORE_INDEX = -100\r\n> DEFAULT_PAD_TOKEN = \"[PAD]\"\r\n> DEFAULT_EOS_TOKEN = \"</s>\"\r\n> DEFAULT_BOS_TOKEN = \"<s>\"\r\n> DEFAULT_UNK_TOKEN = \"<unk>\"\r\n>\r\n>\r\n> tokenizer = transformers.LlamaTokenizerFast.from_pretrained(\r\n> model_name_or_path,\r\n> cache_dir=cache_dir,\r\n> model_max_length=model_max_length,\r\n> padding_side=\"right\",\r\n> use_fast=True,\r\n> #use_fast=False\r\n> )\r\n>\r\n> special_tokens_dict = dict()\r\n> if tokenizer.pad_token is None:\r\n> special_tokens_dict[\"pad_token\"] = DEFAULT_PAD_TOKEN\r\n> if tokenizer.eos_token is None:\r\n> special_tokens_dict[\"eos_token\"] = DEFAULT_EOS_TOKEN\r\n> if tokenizer.bos_token is None:\r\n> special_tokens_dict[\"bos_token\"] = DEFAULT_BOS_TOKEN\r\n> if tokenizer.unk_token is None:\r\n> special_tokens_dict[\"unk_token\"] = DEFAULT_UNK_TOKEN\r\n>\r\n> tokenizer.add_special_tokens(special_tokens_dict)\r\n>\r\n> def tokenize_fn(tokenizer, example):\r\n> context_length = tokenizer.model_max_length\r\n> outputs = tokenizer(\r\n> tokenizer.eos_token.join(example[\"text\"]),\r\n> #truncation=False,\r\n> truncation=True,\r\n> return_tensors=\"pt\",\r\n> #return_tensors=\"np\",\r\n> pad_to_multiple_of=context_length,\r\n> padding=True,\r\n> )\r\n> return {\"input_ids\": outputs[\"input_ids\"].view(-1, context_length)}\r\n>\r\n> for idx in range(100):\r\n> dataset = load_dataset(\"togethercomputer/RedPajama-Data-1T-Sample\",\r\n> cache_dir=cache_dir, split=f'train[{idx}%:{idx+1}%]')\r\n> dataset = dataset.map(partial(tokenize_fn, tokenizer), batched=False,\r\n> num_proc=16, remove_columns=[\"text\", \"meta\"])\r\n> dataset.save_to_disk(training_args.cache_dir + f\"/training_data_{idx}\")\r\n>\r\n>\r\n> On Thu, Oct 19, 2023 at 2:30 PM Mario Šaško ***@***.***>\r\n> wrote:\r\n>\r\n>> Can you please provide a self-contained reproducer?\r\n>>\r\n>> —\r\n>> Reply to this email directly, view it on GitHub\r\n>> <https://github.com/huggingface/datasets/issues/6319#issuecomment-1771509229>,\r\n>> or unsubscribe\r\n>> <https://github.com/notifications/unsubscribe-auth/ABDD3ZNBZ3BE7Q4EQZZK6MLYAFWURAVCNFSM6AAAAAA6HDKPSCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZRGUYDSMRSHE>\r\n>> .\r\n>> You are receiving this because you authored the thread.Message ID:\r\n>> ***@***.***>\r\n>>\r\n>\r\n", "So, using LlamaTokenizerFast was the problem. Changing it to LlamaTokenizer\r\nfixed things,\r\n\r\nOn Thu, Oct 19, 2023 at 4:04 PM pensive introvert <\r\n***@***.***> wrote:\r\n\r\n> I changed the tokenizer to one without \"Fast suffix, and something\r\n> changed. The fraction, although still slowed a lot at 80% was able to get\r\n> over the finish line of 100%\r\n>\r\n> I have to do more testng, see if the whole set can be processed\r\n>\r\n>\r\n>\r\n> On Thu, Oct 19, 2023 at 3:03 PM pensive introvert <\r\n> ***@***.***> wrote:\r\n>\r\n>> from functools import partial\r\n>> import transformers\r\n>> from datasets import load_dataset, concatenate_datasets, load_from_disk\r\n>>\r\n>> model_name_or_path=\"/opt/data/data/daryl149/llama-2-7b-chat-hf\"\r\n>> output_dir=\"/opt/data/data/LongLoRA/checkpoints\"\r\n>> cache_dir=\"/opt/data/data/LongLoRA/cache\"\r\n>> model_max_length=16384\r\n>>\r\n>> IGNORE_INDEX = -100\r\n>> DEFAULT_PAD_TOKEN = \"[PAD]\"\r\n>> DEFAULT_EOS_TOKEN = \"</s>\"\r\n>> DEFAULT_BOS_TOKEN = \"<s>\"\r\n>> DEFAULT_UNK_TOKEN = \"<unk>\"\r\n>>\r\n>>\r\n>> tokenizer = transformers.LlamaTokenizerFast.from_pretrained(\r\n>> model_name_or_path,\r\n>> cache_dir=cache_dir,\r\n>> model_max_length=model_max_length,\r\n>> padding_side=\"right\",\r\n>> use_fast=True,\r\n>> #use_fast=False\r\n>> )\r\n>>\r\n>> special_tokens_dict = dict()\r\n>> if tokenizer.pad_token is None:\r\n>> special_tokens_dict[\"pad_token\"] = DEFAULT_PAD_TOKEN\r\n>> if tokenizer.eos_token is None:\r\n>> special_tokens_dict[\"eos_token\"] = DEFAULT_EOS_TOKEN\r\n>> if tokenizer.bos_token is None:\r\n>> special_tokens_dict[\"bos_token\"] = DEFAULT_BOS_TOKEN\r\n>> if tokenizer.unk_token is None:\r\n>> special_tokens_dict[\"unk_token\"] = DEFAULT_UNK_TOKEN\r\n>>\r\n>> tokenizer.add_special_tokens(special_tokens_dict)\r\n>>\r\n>> def tokenize_fn(tokenizer, example):\r\n>> context_length = tokenizer.model_max_length\r\n>> outputs = tokenizer(\r\n>> tokenizer.eos_token.join(example[\"text\"]),\r\n>> #truncation=False,\r\n>> truncation=True,\r\n>> return_tensors=\"pt\",\r\n>> #return_tensors=\"np\",\r\n>> pad_to_multiple_of=context_length,\r\n>> padding=True,\r\n>> )\r\n>> return {\"input_ids\": outputs[\"input_ids\"].view(-1, context_length)}\r\n>>\r\n>> for idx in range(100):\r\n>> dataset = load_dataset(\"togethercomputer/RedPajama-Data-1T-Sample\",\r\n>> cache_dir=cache_dir, split=f'train[{idx}%:{idx+1}%]')\r\n>> dataset = dataset.map(partial(tokenize_fn, tokenizer), batched=False,\r\n>> num_proc=16, remove_columns=[\"text\", \"meta\"])\r\n>> dataset.save_to_disk(training_args.cache_dir +\r\n>> f\"/training_data_{idx}\")\r\n>>\r\n>>\r\n>> On Thu, Oct 19, 2023 at 2:30 PM Mario Šaško ***@***.***>\r\n>> wrote:\r\n>>\r\n>>> Can you please provide a self-contained reproducer?\r\n>>>\r\n>>> —\r\n>>> Reply to this email directly, view it on GitHub\r\n>>> <https://github.com/huggingface/datasets/issues/6319#issuecomment-1771509229>,\r\n>>> or unsubscribe\r\n>>> <https://github.com/notifications/unsubscribe-auth/ABDD3ZNBZ3BE7Q4EQZZK6MLYAFWURAVCNFSM6AAAAAA6HDKPSCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZRGUYDSMRSHE>\r\n>>> .\r\n>>> You are receiving this because you authored the thread.Message ID:\r\n>>> ***@***.***>\r\n>>>\r\n>>\r\n", "Indeed, the tokenizer is super slow. Perhaps @ArthurZucker knows the reason why.\r\n\r\n([This](https://colab.research.google.com/drive/1VgeurX-4Fl2X6aBQTwh_X4kuQKZ6K9L1?usp=sharing) simplified Colab can be used to reproduce the behavior)", "same issue here\r\nsample to reproduce: https://github.com/philschmid/document-ai-transformers/blob/main/training/donut_sroie.ipynb\r\nwith following map line\r\nhttps://github.com/philschmid/document-ai-transformers/blob/main/training/donut_sroie.ipynb\r\n\r\nIf I directly iterate over the dataset and call the mapping method, it is very fast\r\n```py\r\nfor sample in dataset:\r\n def preprocess_documents_for_donut(sample):\r\n```\r\n\r\nif i removed `.convert('RGB')` It can run to completion without getting stuck. I suspect it has something to do with the Image.\r\n\r\nIf I use batch, it's even slower.", "@ewfian \r\n\r\n> If I directly iterate over the dataset and call the mapping method, it is very fast\r\n\r\n`Dataset.map` must also convert the images into bytes to write them to an Arrow file (the write itself takes some time, too). \r\n\r\nYou can make the `map` faster by manually converting the images into an \"arrow-compatible\" representation. Otherwise, the Pillow defaults are used when saving an image, which seems particularly slow for the notebook's case.\r\n\r\n```python\r\ndef preprocess_documents_for_donut(sample):\r\n text = json.loads(sample[\"text\"])\r\n d_doc = task_start_token + json2token(text) + eos_token\r\n image = sample[\"image\"].convert('RGB')\r\n # convert image to bytes\r\n buffer = io.BytesIO()\r\n image.save(buffer, format=\"PNG\", compress_level=1)\r\n return {\"image\": {\"bytes\": buffer.getvalue()}, \"text\": d_doc}\r\n\r\nproc_dataset = dataset.map(preprocess_documents_for_donut, writer_batch_size=50)\r\n```", "The problem I had was to do with map using fork and copying locks from the\r\nparent process in acquired state. I ended up changing the context to use\r\nforkserver instead.\r\n\r\n\r\nOn Wed, Nov 29, 2023, 10:04 PM Mario Šaško ***@***.***> wrote:\r\n\r\n> @ewfian <https://github.com/ewfian>\r\n>\r\n> If I directly iterate over the dataset and call the mapping method, it is\r\n> very fast\r\n>\r\n> Dataset.map must also convert the images into bytes to write them to an\r\n> Arrow file (the write itself takes some time, too).\r\n>\r\n> You can make the map faster by manually converting the images into an\r\n> \"arrow-compatible\" representation. Otherwise, the Pillow defaults are used\r\n> when saving an image, which seems particularly slow for the notebook's case.\r\n>\r\n> def preprocess_documents_for_donut(sample):\r\n> text = json.loads(sample[\"text\"])\r\n> d_doc = task_start_token + json2token(text) + eos_token\r\n> image = sample[\"image\"].convert('RGB')\r\n> # convert image to bytes\r\n> buffer = io.BytesIO()\r\n> image.save(buffer, format=\"PNG\", compress_level=1)\r\n> return {\"image\": {\"bytes\": buffer.getvalue()}, \"text\": d_doc}\r\n> proc_dataset = dataset.map(preprocess_documents_for_donut, writer_batch_size=50)\r\n>\r\n> —\r\n> Reply to this email directly, view it on GitHub\r\n> <https://github.com/huggingface/datasets/issues/6319#issuecomment-1833033973>,\r\n> or unsubscribe\r\n> <https://github.com/notifications/unsubscribe-auth/ABDD3ZKKEKJVWBFH7QHLRJ3YG7ZUJAVCNFSM6AAAAAA6HDKPSCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZTGAZTGOJXGM>\r\n> .\r\n> You are receiving this because you authored the thread.Message ID:\r\n> ***@***.***>\r\n>\r\n" ]
2023-10-19T12:19:33
2023-11-30T03:27:26
null
NONE
null
null
null
### Describe the bug Regardless of how many cores I used, I have 16 or 32 threads, map slows down to a crawl at around 80% done, lingers maybe until 97% extremely slowly and NEVER finishes the job. It just hangs. After watching this for 27 hours I control-C out of it. Until the end one process appears to be doing something, but it never ends. I saw some comments about fast tokenizers using Rust and all and tried different variations. NOTHING works. ### Steps to reproduce the bug Running it without breaking the dataset into parts results in the same behavior. The loop was an attempt to see if this was a RAM issue. for idx in range(100): dataset = load_dataset("togethercomputer/RedPajama-Data-1T-Sample", cache_dir=cache_dir, split=f'train[{idx}%:{idx+1}%]') dataset = dataset.map(partial(tokenize_fn, tokenizer), batched=False, num_proc=1, remove_columns=["text", "meta"]) dataset.save_to_disk(training_args.cache_dir + f"/training_data_{idx}") ### Expected behavior I expect map to run at more or less the same speed it starts with and FINISH its processing. ### Environment info Python 3.8, same with 3.10 makes no difference. Ubuntu 20.04,
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6319/reactions", "total_count": 3, "+1": 3, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6319/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6317
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6317/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6317/comments
https://api.github.com/repos/huggingface/datasets/issues/6317/events
https://github.com/huggingface/datasets/issues/6317
1,951,965,668
I_kwDODunzps50WKHk
6,317
sentiment140 dataset unavailable
{ "login": "AndreasKarasenko", "id": 52670382, "node_id": "MDQ6VXNlcjUyNjcwMzgy", "avatar_url": "https://avatars.githubusercontent.com/u/52670382?v=4", "gravatar_id": "", "url": "https://api.github.com/users/AndreasKarasenko", "html_url": "https://github.com/AndreasKarasenko", "followers_url": "https://api.github.com/users/AndreasKarasenko/followers", "following_url": "https://api.github.com/users/AndreasKarasenko/following{/other_user}", "gists_url": "https://api.github.com/users/AndreasKarasenko/gists{/gist_id}", "starred_url": "https://api.github.com/users/AndreasKarasenko/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/AndreasKarasenko/subscriptions", "organizations_url": "https://api.github.com/users/AndreasKarasenko/orgs", "repos_url": "https://api.github.com/users/AndreasKarasenko/repos", "events_url": "https://api.github.com/users/AndreasKarasenko/events{/privacy}", "received_events_url": "https://api.github.com/users/AndreasKarasenko/received_events", "type": "User", "site_admin": false }
[]
closed
false
{ "login": "albertvillanova", "id": 8515462, "node_id": "MDQ6VXNlcjg1MTU0NjI=", "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "gravatar_id": "", "url": "https://api.github.com/users/albertvillanova", "html_url": "https://github.com/albertvillanova", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "repos_url": "https://api.github.com/users/albertvillanova/repos", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "type": "User", "site_admin": false }
[ { "login": "albertvillanova", "id": 8515462, "node_id": "MDQ6VXNlcjg1MTU0NjI=", "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "gravatar_id": "", "url": "https://api.github.com/users/albertvillanova", "html_url": "https://github.com/albertvillanova", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "repos_url": "https://api.github.com/users/albertvillanova/repos", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "type": "User", "site_admin": false } ]
null
[ "Thanks for reporting. We are investigating the issue.", "We have opened an issue in the corresponding Hub dataset: https://huggingface.co/datasets/sentiment140/discussions/3\r\n\r\nLet's continue the discussion there." ]
2023-10-19T11:25:21
2023-10-19T13:04:56
2023-10-19T13:04:56
NONE
null
null
null
### Describe the bug loading the dataset using load_dataset("sentiment140") returns the following error ConnectionError: Couldn't reach http://cs.stanford.edu/people/alecmgo/trainingandtestdata.zip (error 403) ### Steps to reproduce the bug Run the following code (version should not matter). ``` from datasets import load_dataset data = load_dataset("sentiment140") ``` ### Expected behavior The dataset should be loaded just like any other. The main issue is that it is no longer hosted by stanford. It is still available from a [Google Drive Link](https://docs.google.com/file/d/0B04GJPshIjmPRnZManQwWEdTZjg/edit). ### Environment info - `datasets` version: 2.14.5 - Platform: Windows-10-10.0.19045-SP0 - Python version: 3.10.8 - Huggingface_hub version: 0.17.3 - PyArrow version: 13.0.0 - Pandas version: 2.1.1
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6317/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6317/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6315
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6315/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6315/comments
https://api.github.com/repos/huggingface/datasets/issues/6315/events
https://github.com/huggingface/datasets/issues/6315
1,951,800,819
I_kwDODunzps50Vh3z
6,315
Hub datasets with CSV metadata raise ArrowInvalid: JSON parse error: Invalid value. in row 0
{ "login": "albertvillanova", "id": 8515462, "node_id": "MDQ6VXNlcjg1MTU0NjI=", "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "gravatar_id": "", "url": "https://api.github.com/users/albertvillanova", "html_url": "https://github.com/albertvillanova", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "repos_url": "https://api.github.com/users/albertvillanova/repos", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "type": "User", "site_admin": false }
[ { "id": 1935892857, "node_id": "MDU6TGFiZWwxOTM1ODkyODU3", "url": "https://api.github.com/repos/huggingface/datasets/labels/bug", "name": "bug", "color": "d73a4a", "default": true, "description": "Something isn't working" } ]
closed
false
{ "login": "albertvillanova", "id": 8515462, "node_id": "MDQ6VXNlcjg1MTU0NjI=", "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "gravatar_id": "", "url": "https://api.github.com/users/albertvillanova", "html_url": "https://github.com/albertvillanova", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "repos_url": "https://api.github.com/users/albertvillanova/repos", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "type": "User", "site_admin": false }
[ { "login": "albertvillanova", "id": 8515462, "node_id": "MDQ6VXNlcjg1MTU0NjI=", "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "gravatar_id": "", "url": "https://api.github.com/users/albertvillanova", "html_url": "https://github.com/albertvillanova", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "repos_url": "https://api.github.com/users/albertvillanova/repos", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "type": "User", "site_admin": false } ]
null
[]
2023-10-19T10:11:29
2023-10-20T06:14:10
2023-10-20T06:14:10
MEMBER
null
null
null
When trying to load a Hub dataset that contains a CSV metadata file, it raises an `ArrowInvalid` error: ``` E pyarrow.lib.ArrowInvalid: JSON parse error: Invalid value. in row 0 pyarrow/error.pxi:100: ArrowInvalid ``` See: https://huggingface.co/datasets/lukarape/public_small_papers/discussions/1
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6315/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6315/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6311
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6311/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6311/comments
https://api.github.com/repos/huggingface/datasets/issues/6311/events
https://github.com/huggingface/datasets/issues/6311
1,949,304,993
I_kwDODunzps50MAih
6,311
cast_column to Sequence with length=4 occur exception raise in datasets/table.py:2146
{ "login": "neiblegy", "id": 16574677, "node_id": "MDQ6VXNlcjE2NTc0Njc3", "avatar_url": "https://avatars.githubusercontent.com/u/16574677?v=4", "gravatar_id": "", "url": "https://api.github.com/users/neiblegy", "html_url": "https://github.com/neiblegy", "followers_url": "https://api.github.com/users/neiblegy/followers", "following_url": "https://api.github.com/users/neiblegy/following{/other_user}", "gists_url": "https://api.github.com/users/neiblegy/gists{/gist_id}", "starred_url": "https://api.github.com/users/neiblegy/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/neiblegy/subscriptions", "organizations_url": "https://api.github.com/users/neiblegy/orgs", "repos_url": "https://api.github.com/users/neiblegy/repos", "events_url": "https://api.github.com/users/neiblegy/events{/privacy}", "received_events_url": "https://api.github.com/users/neiblegy/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "Thanks for reporting! We've spotted the bugs with the `array.values` handling and are fixing them in https://github.com/huggingface/datasets/pull/6283 (should be part of the next release).", "> Thanks for reporting! We've spotted the bugs with the `array.values` handling and are fixing them in #6283 (should be part of the next release).\r\n\r\ni encounter another exception while cast_column to type `Sequence(feature={\"points\": Array2D(shape=(-1, 2), dtype=\"int64\"), \"label\": ClassLabel(num_classes=num_classes, names=names)})`\r\n\r\nwhile my data like this: '{\"points\": [[0.6,0.6], [0.7,0.7], [0.8,0.8]], \"label\": \"A1\"}'\r\n\r\nhere is the backtrace info:\r\n\r\n```\r\n out = func(dataset, *args, **kwargs)\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py\", line 2110, in cast_column\r\n return self.cast(features)\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py\", line 2055, in cast\r\n dataset = dataset.map(\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py\", line 592, in wrapper\r\n out: Union[\"Dataset\", \"DatasetDict\"] = func(self, *args, **kwargs)\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py\", line 557, in wrapper\r\n out: Union[\"Dataset\", \"DatasetDict\"] = func(self, *args, **kwargs)\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py\", line 3097, in map\r\n for rank, done, content in Dataset._map_single(**dataset_kwargs):\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py\", line 3474, in _map_single\r\n batch = apply_function_on_filtered_inputs(\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py\", line 3353, in apply_function_on_filtered_inputs\r\n processed_inputs = function(*fn_args, *additional_args, **fn_kwargs)\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py\", line 2329, in table_cast\r\n return cast_table_to_schema(table, schema)\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py\", line 2288, in cast_table_to_schema\r\n arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py\", line 2288, in <listcomp>\r\n arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py\", line 1831, in wrapper\r\n return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py\", line 1831, in <listcomp>\r\n return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py\", line 2073, in cast_array_to_feature\r\n arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()]\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py\", line 2073, in <listcomp>\r\n arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()]\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py\", line 1833, in wrapper\r\n return func(array, *args, **kwargs)\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py\", line 2095, in cast_array_to_feature\r\n casted_values = _c(array.values, feature.feature)\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py\", line 1833, in wrapper\r\n return func(array, *args, **kwargs)\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py\", line 2144, in cast_array_to_feature\r\n return array_cast(array, feature(), allow_number_to_str=allow_number_to_str)\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py\", line 1833, in wrapper\r\n return func(array, *args, **kwargs)\r\n File \"/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py\", line 1967, in array_cast\r\n return pa_type.wrap_array(array)\r\n File \"pyarrow/types.pxi\", line 1369, in pyarrow.lib.BaseExtensionType.wrap_array\r\nTypeError: Incompatible storage type for extension<arrow.py_extension_type<Array2DExtensionType>>: expected list<item: list<item: double>>, got list<item: double>\r\n```\r\nand i print(array) in datasets/table.py:1967 indeed get 2D list. is that same issue in #6283 ?\r\n\r\nbesides this, hugging face datasets seems don't naturally support multi-labels which means `Sequence(ClassLabel)` illegal if data is [\"label1\", \"label2\"]. so i have to define a class derived from `ClassLabel`, like this:\r\n\r\n```\r\nclass AisClassLabels(ClassLabel):\r\n def encode_example(self, example_data):\r\n if self.num_classes is None:\r\n raise ValueError(\r\n \"Trying to use ClassLabel feature with undefined number of class. \"\r\n \"Please set ClassLabel.names or num_classes.\"\r\n )\r\n if not isinstance(example_data, list):\r\n example_data = [example_data]\r\n\r\n for i in range(len(example_data)):\r\n if isinstance(example_data[i], str):\r\n example_data[i] = self.str2int(example_data[i])\r\n if not -1 <= example_data[i] < self.num_classes:\r\n raise ValueError(f\"Class label {example_data:d} greater than configured num_classes {self.num_classes}\")\r\n return example_data\r\n```\r\nand it works well in my case. but is there any recommend way to implement multi-labels?", "`Incompatible storage type for extension<arrow.py_extension_type<Array2DExtensionType>>: expected list<item: list<item: double>>, got list<item: double>`\r\nif i change `Array2D(shape=(-1, 2), dtype=\"int64\")` to `Sequence(Value(\"int64\"))` , every thing goes well. but my data is 2D int list", "i test Sequence(ClassLabel) is ok if one column is label list. but it is not ok in nested column such as `Sequence(feature= {\"points\": Sequence(Value(\"int32\")), \"label\": Sequence(ClassLabel(num_classes....)))`. in this case i need override ClassLabels. encode_example as i given above." ]
2023-10-18T09:38:05
2024-02-06T19:24:20
2024-02-06T19:24:20
NONE
null
null
null
### Describe the bug i load a dataset from local csv file which has 187383612 examples, then use `map` to generate new columns for test. here is my code : ``` import os from datasets import load_dataset from datasets.features import Sequence, Value def add_new_path(example): example["ais_bbox"] = [100,100,200,200] example["ais_image_path"] = os.path.join("images", example["image_path"]) if example["image_path"] else "" return example ais_dataset = load_dataset("/data/ryan.gao/ais_dataset_cache/raw/1749/") hf_ds = ais_dataset.map(add_new_path, batched=False, num_proc=32) ds = hf_ds.cast_column("ais_bbox", Sequence(Value("int32"), length=4)) ``` and the `cast_column` raise an exception ``` Casting the dataset: 3%|███▉ ... File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2110, in cast_column return self.cast(features) File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2055, in cast dataset = dataset.map( File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 592, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 557, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3097, in map for rank, done, content in Dataset._map_single(**dataset_kwargs): File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3474, in _map_single batch = apply_function_on_filtered_inputs( File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 3353, in apply_function_on_filtered_inputs processed_inputs = function(*fn_args, *additional_args, **fn_kwargs) File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2329, in table_cast return cast_table_to_schema(table, schema) File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2288, in cast_table_to_schema arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2288, in <listcomp> arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 1831, in wrapper return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 1831, in <listcomp> return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/protoss.gao/.local/lib/python3.9/site-packages/datasets/table.py", line 2145, in cast_array_to_feature raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") TypeError: Couldn't cast array of type list<item: int64> to Sequence(feature=Value(dtype='int32', id=None), length=4, id=None) ``` i check the source code and make debug info: in datasets/table.py:2092 ``` 2091 if feature.length > -1: 2092 if feature.length * len(array) == len(array.values): 2093 return pa.FixedSizeListArray.from_arrays(_c(array.values, feature.feature), feature.length) 2094 print(len(array)) 2095 print(len(array.values)) ``` my feature.length is 4. but feature.length * len(array) == len(array.values) is false. print(len(array)) is 262 print(len(array.values)) is 4000 then I use "for item in array" to print each item then get 262 * [100,100,200,200] and use "for item in array.values" to print each item and get 4000 int32 which are 1000 * [100,100,200,200] i'm wondering the `chunk` in each `array.chunks`, the "chunk.values" may get all the chunks's value rather than single chunk? but i check the pyarrow's doc seems chunk.values is chunk's value not all. ### Steps to reproduce the bug code provided above. ### Expected behavior feature.length * len(array) == len(array.values) should be true. and there should not has Exception. ### Environment info python3.9 x86_64 datasets: 2.14.4 pyarrow: 13.0.0 or 10.0.0
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6311/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6311/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6308
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6308/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6308/comments
https://api.github.com/repos/huggingface/datasets/issues/6308/events
https://github.com/huggingface/datasets/issues/6308
1,946,810,625
I_kwDODunzps50CfkB
6,308
module 'resource' has no attribute 'error'
{ "login": "NeoWang9999", "id": 48009681, "node_id": "MDQ6VXNlcjQ4MDA5Njgx", "avatar_url": "https://avatars.githubusercontent.com/u/48009681?v=4", "gravatar_id": "", "url": "https://api.github.com/users/NeoWang9999", "html_url": "https://github.com/NeoWang9999", "followers_url": "https://api.github.com/users/NeoWang9999/followers", "following_url": "https://api.github.com/users/NeoWang9999/following{/other_user}", "gists_url": "https://api.github.com/users/NeoWang9999/gists{/gist_id}", "starred_url": "https://api.github.com/users/NeoWang9999/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/NeoWang9999/subscriptions", "organizations_url": "https://api.github.com/users/NeoWang9999/orgs", "repos_url": "https://api.github.com/users/NeoWang9999/repos", "events_url": "https://api.github.com/users/NeoWang9999/events{/privacy}", "received_events_url": "https://api.github.com/users/NeoWang9999/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "This (Windows) issue was fixed in `fsspec` in https://github.com/fsspec/filesystem_spec/pull/1275. So, to avoid the error, update the `fsspec` installation with `pip install -U fsspec`.", "> This (Windows) issue was fixed in `fsspec` in [fsspec/filesystem_spec#1275](https://github.com/fsspec/filesystem_spec/pull/1275). So, to avoid the error, update the `fsspec` installation with `pip install -U fsspec`.\r\n\r\nafter I run `pip install -U fsspec`\r\n\r\nit occurs a new error:\r\n```\r\nERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflict\r\ns.\r\ndatasets 2.14.5 requires fsspec[http]<2023.9.0,>=2023.1.0, but you have fsspec 2023.9.2 which is incompatible.\r\n\r\n```", "The `fsspec<2023.9.0` upper bound will be removed in the next release. The `ResourceError` fix is also present in version 2023.6.0, so use that version in the meantime (`pip install fsspec==2023.6.0`).", "> The `fsspec<2023.9.0` upper bound will be removed in the next release. The `ResourceError` fix is also present in version 2023.6.0, so use that version in the meantime (`pip install fsspec==2023.6.0`).\r\n\r\nthanks for reply!" ]
2023-10-17T08:08:54
2023-10-25T17:09:22
2023-10-25T17:09:22
NONE
null
null
null
### Describe the bug just run import: `from datasets import load_dataset` and then: ``` File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\__init__.py", line 22, in <module> from .arrow_dataset import Dataset File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\arrow_dataset.py", line 66, in <module> from .arrow_reader import ArrowReader File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\arrow_reader.py", line 30, in <module> from .download.download_config import DownloadConfig File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\download\__init__.py", line 10, in <module> from .streaming_download_manager import StreamingDownloadManager File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\download\streaming_download_manager.py", line 21, in <module> from ..filesystems import COMPRESSION_FILESYSTEMS File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\datasets\filesystems\__init__.py", line 8, in <module> import fsspec.asyn File "C:\ProgramData\anaconda3\envs\py310\lib\site-packages\fsspec\asyn.py", line 157, in <module> ResourceEror = resource.error AttributeError: module 'resource' has no attribute 'error' Process finished with exit code 1 ``` and the error codes are: ``` try: import resource except ImportError: resource = None ResourceError = OSError else: ResourceEror = resource.error ``` 1. miss spelling : "ResourceEror " should be "ResourceErorr" 2. module 'resource' has no attribute 'error' ### Steps to reproduce the bug only one step: `from datasets import load_dataset` ### Expected behavior slove error: module 'resource' has no attribute 'error' ### Environment info python=3.10 datasets==2.14.5
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6308/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6308/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6306
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6306/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6306/comments
https://api.github.com/repos/huggingface/datasets/issues/6306/events
https://github.com/huggingface/datasets/issues/6306
1,946,363,452
I_kwDODunzps50AyY8
6,306
pyinstaller : OSError: could not get source code
{ "login": "dusk877647949", "id": 57702070, "node_id": "MDQ6VXNlcjU3NzAyMDcw", "avatar_url": "https://avatars.githubusercontent.com/u/57702070?v=4", "gravatar_id": "", "url": "https://api.github.com/users/dusk877647949", "html_url": "https://github.com/dusk877647949", "followers_url": "https://api.github.com/users/dusk877647949/followers", "following_url": "https://api.github.com/users/dusk877647949/following{/other_user}", "gists_url": "https://api.github.com/users/dusk877647949/gists{/gist_id}", "starred_url": "https://api.github.com/users/dusk877647949/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/dusk877647949/subscriptions", "organizations_url": "https://api.github.com/users/dusk877647949/orgs", "repos_url": "https://api.github.com/users/dusk877647949/repos", "events_url": "https://api.github.com/users/dusk877647949/events{/privacy}", "received_events_url": "https://api.github.com/users/dusk877647949/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "more information:\r\n``` \r\nFile \"text2vec\\__init__.py\", line 8, in <module>\r\nFile \"<frozen importlib._bootstrap>\", line 1027, in _find_and_load\r\nFile \"<frozen importlib._bootstrap>\", line 1006, in _find_and_load_unlocked\r\nFile \"<frozen importlib._bootstrap>\", line 688, in _load_unlocked\r\nFile \"PyInstaller\\loader\\pyimod02_importers.py\", line 499, in exec_module\r\nFile \"text2vec\\bertmatching_model.py\", line 19, in <module>\r\nFile \"<frozen importlib._bootstrap>\", line 1027, in _find_and_load\r\nFile \"<frozen importlib._bootstrap>\", line 1006, in _find_and_load_unlocked\r\nFile \"<frozen importlib._bootstrap>\", line 688, in _load_unlocked\r\nFile \"PyInstaller\\loader\\pyimod02_importers.py\", line 499, in exec_module\r\nFile \"text2vec\\bertmatching_dataset.py\", line 7, in <module>\r\nFile \"<frozen importlib._bootstrap>\", line 1027, in _find_and_load\r\nFile \"<frozen importlib._bootstrap>\", line 1006, in _find_and_load_unlocked\r\nFile \"<frozen importlib._bootstrap>\", line 688, in _load_unlocked\r\nFile \"PyInstaller\\loader\\pyimod02_importers.py\", line 499, in exec_module\r\nFile \"datasets\\__init__.py\", line 52, in <module>\r\nFile \"<frozen importlib._bootstrap>\", line 1027, in _find_and_load\r\nFile \"<frozen importlib._bootstrap>\", line 1006, in _find_and_load_unlocked\r\nFile \"<frozen importlib._bootstrap>\", line 688, in _load_unlocked\r\nFile \"PyInstaller\\loader\\pyimod02_importers.py\", line 499, in exec_module\r\nFile \"datasets\\inspect.py\", line 30, in <module>\r\nFile \"<frozen importlib._bootstrap>\", line 1027, in _find_and_load\r\nFile \"<frozen importlib._bootstrap>\", line 1006, in _find_and_load_unlocked\r\nFile \"<frozen importlib._bootstrap>\", line 688, in _load_unlocked\r\nFile \"PyInstaller\\loader\\pyimod02_importers.py\", line 499, in exec_module\r\nFile \"datasets\\load.py\", line 58, in <module>\r\nFile \"<frozen importlib._bootstrap>\", line 1027, in _find_and_load\r\nFile \"<frozen importlib._bootstrap>\", line 1006, in _find_and_load_unlocked\r\nFile \"<frozen importlib._bootstrap>\", line 688, in _load_unlocked\r\nFile \"PyInstaller\\loader\\pyimod02_importers.py\", line 499, in exec_module\r\nFile \"datasets\\packaged_modules\\__init__.py\", line 31, in <module>\r\nFile \"inspect.py\", line 1147, in getsource\r\nFile \"inspect.py\", line 1129, in getsourcelines\r\nFile \"inspect.py\", line 958, in findsource\r\nOSError: could not get source code\r\n```\r\n", "Can you share a reproducer? I haven't been able to reproduce the error myself.", "> '\r\n\r\nthanks,I solve it.it's about pyinstaller.", "1", "> > '\r\n> \r\n> thanks,I solve it.it's about pyinstaller.\r\n\r\nI encountered the same error, how to solve it?" ]
2023-10-17T01:41:51
2023-11-02T07:24:51
2023-10-18T14:03:42
NONE
null
null
null
### Describe the bug I ran a package with pyinstaller and got the following error: ### Steps to reproduce the bug ``` ... File "datasets\__init__.py", line 52, in <module> File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 688, in _load_unlocked File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module File "datasets\inspect.py", line 30, in <module> File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 688, in _load_unlocked File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module File "datasets\load.py", line 58, in <module> File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 688, in _load_unlocked File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module File "datasets\packaged_modules\__init__.py", line 31, in <module> File "inspect.py", line 1147, in getsource File "inspect.py", line 1129, in getsourcelines File "inspect.py", line 958, in findsource OSError: could not get source code ``` ### Expected behavior I have looked up the relevant information, but I can't find a suitable reason ### Environment info ```python python 3.10 datasets 2.14.4 pyinstaller 5.6.2 ```
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6306/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6306/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6305
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6305/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6305/comments
https://api.github.com/repos/huggingface/datasets/issues/6305/events
https://github.com/huggingface/datasets/issues/6305
1,946,010,912
I_kwDODunzps5z_cUg
6,305
Cannot load dataset with `2.14.5`: `FileNotFound` error
{ "login": "finiteautomata", "id": 167943, "node_id": "MDQ6VXNlcjE2Nzk0Mw==", "avatar_url": "https://avatars.githubusercontent.com/u/167943?v=4", "gravatar_id": "", "url": "https://api.github.com/users/finiteautomata", "html_url": "https://github.com/finiteautomata", "followers_url": "https://api.github.com/users/finiteautomata/followers", "following_url": "https://api.github.com/users/finiteautomata/following{/other_user}", "gists_url": "https://api.github.com/users/finiteautomata/gists{/gist_id}", "starred_url": "https://api.github.com/users/finiteautomata/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/finiteautomata/subscriptions", "organizations_url": "https://api.github.com/users/finiteautomata/orgs", "repos_url": "https://api.github.com/users/finiteautomata/repos", "events_url": "https://api.github.com/users/finiteautomata/events{/privacy}", "received_events_url": "https://api.github.com/users/finiteautomata/received_events", "type": "User", "site_admin": false }
[]
closed
false
{ "login": "albertvillanova", "id": 8515462, "node_id": "MDQ6VXNlcjg1MTU0NjI=", "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "gravatar_id": "", "url": "https://api.github.com/users/albertvillanova", "html_url": "https://github.com/albertvillanova", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "repos_url": "https://api.github.com/users/albertvillanova/repos", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "type": "User", "site_admin": false }
[ { "login": "albertvillanova", "id": 8515462, "node_id": "MDQ6VXNlcjg1MTU0NjI=", "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "gravatar_id": "", "url": "https://api.github.com/users/albertvillanova", "html_url": "https://github.com/albertvillanova", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "repos_url": "https://api.github.com/users/albertvillanova/repos", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "type": "User", "site_admin": false } ]
null
[ "Thanks for reporting, @finiteautomata.\r\n\r\nWe are investigating it. ", "There is a bug in `datasets`. You can see our proposed fix:\r\n- #6309 " ]
2023-10-16T20:11:27
2023-10-18T13:50:36
2023-10-18T13:50:36
NONE
null
null
null
### Describe the bug I'm trying to load [piuba-bigdata/articles_and_comments] and I'm stumbling with this error on `2.14.5`. However, this works on `2.10.0`. ### Steps to reproduce the bug [Colab link](https://colab.research.google.com/drive/1SAftFMQnFE708ikRnJJHIXZV7R5IBOCE#scrollTo=r2R2ipCCDmsg) ```python Downloading readme: 100% 1.19k/1.19k [00:00<00:00, 30.9kB/s] --------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) [<ipython-input-2-807c3583d297>](https://localhost:8080/#) in <cell line: 3>() 1 from datasets import load_dataset 2 ----> 3 load_dataset("piuba-bigdata/articles_and_comments", split="train") 2 frames [/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) 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) 2127 2128 # Create a dataset builder -> 2129 builder_instance = load_dataset_builder( 2130 path=path, 2131 name=name, [/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) 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) 1813 download_config = download_config.copy() if download_config else DownloadConfig() 1814 download_config.storage_options.update(storage_options) -> 1815 dataset_module = dataset_module_factory( 1816 path, 1817 revision=revision, [/usr/local/lib/python3.10/dist-packages/datasets/load.py](https://localhost:8080/#) in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, **download_kwargs) 1506 raise e1 from None 1507 if isinstance(e1, FileNotFoundError): -> 1508 raise FileNotFoundError( 1509 f"Couldn't find a dataset script at {relative_to_absolute_path(combined_path)} or any data file in the same directory. " 1510 f"Couldn't find '{path}' on the Hugging Face Hub either: {type(e1).__name__}: {e1}" FileNotFoundError: Couldn't find a dataset script at /content/piuba-bigdata/articles_and_comments/articles_and_comments.py or any data file in the same directory. Couldn't find 'piuba-bigdata/articles_and_comments' on the Hugging Face Hub either: FileNotFoundError: No (supported) data files or dataset script found in piuba-bigdata/articles_and_comments. ``` ### Expected behavior It should load normally. ### Environment info ``` - `datasets` version: 2.14.5 - Platform: Linux-5.15.120+-x86_64-with-glibc2.35 - Python version: 3.10.12 - Huggingface_hub version: 0.18.0 - PyArrow version: 9.0.0 - Pandas version: 1.5.3 ```
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6305/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6305/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6303
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6303/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6303/comments
https://api.github.com/repos/huggingface/datasets/issues/6303/events
https://github.com/huggingface/datasets/issues/6303
1,943,466,532
I_kwDODunzps5z1vIk
6,303
Parquet uploads off-by-one naming scheme
{ "login": "ZachNagengast", "id": 1981179, "node_id": "MDQ6VXNlcjE5ODExNzk=", "avatar_url": "https://avatars.githubusercontent.com/u/1981179?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ZachNagengast", "html_url": "https://github.com/ZachNagengast", "followers_url": "https://api.github.com/users/ZachNagengast/followers", "following_url": "https://api.github.com/users/ZachNagengast/following{/other_user}", "gists_url": "https://api.github.com/users/ZachNagengast/gists{/gist_id}", "starred_url": "https://api.github.com/users/ZachNagengast/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ZachNagengast/subscriptions", "organizations_url": "https://api.github.com/users/ZachNagengast/orgs", "repos_url": "https://api.github.com/users/ZachNagengast/repos", "events_url": "https://api.github.com/users/ZachNagengast/events{/privacy}", "received_events_url": "https://api.github.com/users/ZachNagengast/received_events", "type": "User", "site_admin": false }
[]
open
false
null
[]
null
[ "You can find the reasoning behind this naming scheme [here](https://github.com/huggingface/transformers/pull/16343#discussion_r931182168).\r\n\r\nThis point has been raised several times, so I'd be okay with starting with `00001-` (also to be consistent with the `transformers` sharding), but I'm not sure @lhoestq agrees.", "We start at 0 in `datasets` for consistency with Apache Spark, Apache Beam, Dask and others.\r\n\r\nAlso note `transformers` isn't a good reference on this topic. I talked with the maintainers when they added shards but it was already released this way. Though we found that there is a backward-compatible way in `transformers` to start at 0, but no request from `transformers` users to changes this AFAIK.", "not sure it would be a good idea to break the consistency now, IMO", "Makes sense to start at 0 for plenty of good reasons so I'm on board.\r\n\r\nWhat about the second part `-of-0000X`? With single commit PR #6269 just getting merged, there was a note about issues with 100+ file edits https://github.com/huggingface/datasets/pull/6269#issuecomment-1755428581.\r\n\r\nThat would be my last remaining concern in the context of the `push_to_hub(..., append=True)` work to be done, where appending a single file to the full dataset will require renaming every other existing file in the dataset. If it doesn't seem like a big issue for this work then all the better 👍" ]
2023-10-14T18:31:03
2023-10-16T16:33:21
null
CONTRIBUTOR
null
null
null
### Describe the bug I noticed this numbering scheme not matching up in a different project and wanted to raise it as an issue for discussion, what is the actual proper way to have these stored? <img width="425" alt="image" src="https://github.com/huggingface/datasets/assets/1981179/3ffa2144-7c9a-446f-b521-a5e9db71e7ce"> The `-SSSSS-of-NNNNN` seems to be used widely across the codebase. The section that creates the part in my screenshot is here https://github.com/huggingface/datasets/blob/main/src/datasets/arrow_dataset.py#L5287 There are also some edits to this section in the single commit branch. ### Steps to reproduce the bug 1. Upload a dataset that requires at least two parquet files in it 2. Observe the naming scheme ### Expected behavior The couple options here are of course **1. keeping it as is** **2. Starting the index at 1:** train-00001-of-00002-{hash}.parquet train-00002-of-00002-{hash}.parquet **3. My preferred option** (which would solve my specific issue), dropping the total entirely: train-00000-{hash}.parquet train-00001-{hash}.parquet This also solves an issue that will occur with an `append` variable for `push_to_hub` (see https://github.com/huggingface/datasets/issues/6290) where as you add a new parquet file, you need to rename everything in the repo as well. However, I know there are parts of the repo that use 0 as the starting file or may require the total, so raising the question for discussion. ### Environment info - `datasets` version: 2.14.6.dev0 - Platform: macOS-14.0-arm64-arm-64bit - Python version: 3.10.12 - Huggingface_hub version: 0.18.0 - PyArrow version: 12.0.1 - Pandas version: 1.5.3
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6303/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6303/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6302
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6302/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6302/comments
https://api.github.com/repos/huggingface/datasets/issues/6302/events
https://github.com/huggingface/datasets/issues/6302
1,942,096,078
I_kwDODunzps5zwgjO
6,302
ArrowWriter/ParquetWriter `write` method does not increase `_num_bytes` and hence datasets not sharding at `max_shard_size`
{ "login": "Rassibassi", "id": 2855550, "node_id": "MDQ6VXNlcjI4NTU1NTA=", "avatar_url": "https://avatars.githubusercontent.com/u/2855550?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Rassibassi", "html_url": "https://github.com/Rassibassi", "followers_url": "https://api.github.com/users/Rassibassi/followers", "following_url": "https://api.github.com/users/Rassibassi/following{/other_user}", "gists_url": "https://api.github.com/users/Rassibassi/gists{/gist_id}", "starred_url": "https://api.github.com/users/Rassibassi/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Rassibassi/subscriptions", "organizations_url": "https://api.github.com/users/Rassibassi/orgs", "repos_url": "https://api.github.com/users/Rassibassi/repos", "events_url": "https://api.github.com/users/Rassibassi/events{/privacy}", "received_events_url": "https://api.github.com/users/Rassibassi/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "`writer._num_bytes` is updated every `writer_batch_size`-th call to the `write` method (default `writer_batch_size` is 1000 (examples)). You should be able to see the update by passing a smaller `writer_batch_size` to the `load_dataset_builder`.\r\n\r\nWe could improve this by supporting the string `writer_batch_size` version as we do with `max_shard_size`, and capping `writer_batch_size` to `max_shard_size` in scenarios where the default `writer_batch_size` > `max_shard_size`. ", "Thanks, reducing `writer_batch_size` solved my problem :)" ]
2023-10-13T14:43:36
2023-10-17T06:52:12
2023-10-17T06:52:11
NONE
null
null
null
### Describe the bug An example from [1], does not work when limiting shards with `max_shard_size`. Try the following example with low `max_shard_size`, such as: ```python builder.download_and_prepare(output_dir, storage_options=storage_options, file_format="parquet", max_shard_size="10MB") ``` The reason for this is that, in line [2] `writer._num_bytes > max_shard_size` is never true, because the `write` method of `ArrowWriter` [3] does not increase `self._num_bytes`. Such that respective Arrow/Parquet shards are only written to file based on the `writer_batch_size` or `config.DEFAULT_MAX_BATCH_SIZE`, but not based on `max_shard_size`. [1] https://huggingface.co/docs/datasets/filesystems#download-and-prepare-a-dataset-into-a-cloud-storage [2] https://github.com/huggingface/datasets/blob/3e8d420808718c9a1453a2e7ee3484ca12c9c70d/src/datasets/builder.py#L1677 [3] https://github.com/huggingface/datasets/blob/3e8d420808718c9a1453a2e7ee3484ca12c9c70d/src/datasets/arrow_writer.py#L459 ### Steps to reproduce the bug Get example from: https://huggingface.co/docs/datasets/filesystems#download-and-prepare-a-dataset-into-a-cloud-storage Call `builder.download_and_prepare` with low `max_shard_size` such as `10MB`, e.g.: ```python builder.download_and_prepare(output_dir, storage_options=storage_options, file_format="parquet", max_shard_size="10MB") ``` ### Expected behavior Shards should be written based on `max_shard_size` instead of batch size. ### Environment info ``` >>> import datasets >>> datasets.__version__ '2.14.6.dev0 ```
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6302/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6302/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6299
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6299/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6299/comments
https://api.github.com/repos/huggingface/datasets/issues/6299/events
https://github.com/huggingface/datasets/issues/6299
1,939,649,238
I_kwDODunzps5znLLW
6,299
Support for newer versions of JAX
{ "login": "ddrous", "id": 25456859, "node_id": "MDQ6VXNlcjI1NDU2ODU5", "avatar_url": "https://avatars.githubusercontent.com/u/25456859?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ddrous", "html_url": "https://github.com/ddrous", "followers_url": "https://api.github.com/users/ddrous/followers", "following_url": "https://api.github.com/users/ddrous/following{/other_user}", "gists_url": "https://api.github.com/users/ddrous/gists{/gist_id}", "starred_url": "https://api.github.com/users/ddrous/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ddrous/subscriptions", "organizations_url": "https://api.github.com/users/ddrous/orgs", "repos_url": "https://api.github.com/users/ddrous/repos", "events_url": "https://api.github.com/users/ddrous/events{/privacy}", "received_events_url": "https://api.github.com/users/ddrous/received_events", "type": "User", "site_admin": false }
[ { "id": 1935892871, "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement", "name": "enhancement", "color": "a2eeef", "default": true, "description": "New feature or request" } ]
closed
false
null
[]
null
[]
2023-10-12T10:03:46
2023-10-12T16:28:59
2023-10-12T16:28:59
NONE
null
null
null
### Feature request Hi, I like your idea of adapting the datasets library to be usable with JAX. Thank you for that. However, in your [setup.py](https://github.com/huggingface/datasets/blob/main/setup.py), you enforce old versions of JAX <= 0.3... It is very cumbersome ! What is the rationale for such a limitation ? Can you remove it please ? Thanks, ### Motivation This library is unusable with new versions of JAX ? ### Your contribution Yes.
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6299/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6299/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6294
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6294/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6294/comments
https://api.github.com/repos/huggingface/datasets/issues/6294/events
https://github.com/huggingface/datasets/issues/6294
1,937,359,605
I_kwDODunzps5zecL1
6,294
IndexError: Invalid key is out of bounds for size 0 despite having a populated dataset
{ "login": "ZYM66", "id": 61892155, "node_id": "MDQ6VXNlcjYxODkyMTU1", "avatar_url": "https://avatars.githubusercontent.com/u/61892155?v=4", "gravatar_id": "", "url": "https://api.github.com/users/ZYM66", "html_url": "https://github.com/ZYM66", "followers_url": "https://api.github.com/users/ZYM66/followers", "following_url": "https://api.github.com/users/ZYM66/following{/other_user}", "gists_url": "https://api.github.com/users/ZYM66/gists{/gist_id}", "starred_url": "https://api.github.com/users/ZYM66/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/ZYM66/subscriptions", "organizations_url": "https://api.github.com/users/ZYM66/orgs", "repos_url": "https://api.github.com/users/ZYM66/repos", "events_url": "https://api.github.com/users/ZYM66/events{/privacy}", "received_events_url": "https://api.github.com/users/ZYM66/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "It looks to be the same issue as the one reported in https://discuss.huggingface.co/t/indexerror-invalid-key-16-is-out-of-bounds-for-size-0.\r\n\r\nCan you check the length of `train_dataset` before the `train_sampler = self._get_train_sampler()` (and after `_remove_unused_columns`) line?" ]
2023-10-11T09:59:38
2023-10-17T11:24:06
2023-10-17T11:24:06
NONE
null
null
null
### Describe the bug I am encountering an `IndexError` when trying to access data from a DataLoader which wraps around a dataset I've loaded using the `datasets` library. The error suggests that the dataset size is `0`, but when I check the length and print the dataset, it's clear that it has `1166` entries. ### Steps to reproduce the bug 1. Load a dataset with `1166` entries. 2. Create a DataLoader using this dataset. 3. Try iterating over the DataLoader. code: ```python def get_train_dataloader(self) -> DataLoader: if self.train_dataset is None: raise ValueError("Trainer: training requires a train_dataset.") train_dataset = self.train_dataset data_collator = self.data_collator print(len(train_dataset)) print(train_dataset) if is_datasets_available() and isinstance(train_dataset, datasets.Dataset): train_dataset = self._remove_unused_columns(train_dataset, description="training") else: data_collator = self._get_collator_with_removed_columns(data_collator, description="training") train_sampler = self._get_train_sampler() dl = DataLoader( train_dataset, batch_size=self._train_batch_size, sampler=train_sampler, collate_fn=data_collator, drop_last=self.args.dataloader_drop_last, num_workers=self.args.dataloader_num_workers, pin_memory=self.args.dataloader_pin_memory, worker_init_fn=seed_worker, ) print(dl) print(len(dl)) for i in dl: print(i) break return dl ``` output : ``` 1166 Dataset({ features: ['input_ids', 'special_tokens_mask'], num_rows: 1166 }) <torch.utils.data.dataloader.DataLoader object ...> 146 ``` Error: ``` Traceback (most recent call last): File "/home/dl/zym/llamaJP/TestUseContinuePretrainLlama.py", line 266, in <module> train() File "/home/dl/zym/llamaJP/TestUseContinuePretrainLlama.py", line 260, in train trainer.train() File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/transformers/trainer.py", line 1506, in train return inner_training_loop( File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/transformers/trainer.py", line 1520, in _inner_training_loop train_dataloader = self.get_train_dataloader() File "/home/dl/zym/llamaJP/TestUseContinuePretrainLlama.py", line 80, in get_train_dataloader for i in dl: File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 630, in __next__ data = self._next_data() File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 674, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch data = self.dataset.__getitems__(possibly_batched_index) File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2807, in __getitems__ batch = self.__getitem__(keys) File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2803, in __getitem__ return self._getitem(key) File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2787, in _getitem pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/datasets/formatting/formatting.py", line 583, in query_table _check_valid_index_key(key, size) File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/datasets/formatting/formatting.py", line 536, in _check_valid_index_key _check_valid_index_key(int(max(key)), size=size) File "/root/miniconda3/envs/LLM/lib/python3.10/site-packages/datasets/formatting/formatting.py", line 526, in _check_valid_index_key raise IndexError(f"Invalid key: {key} is out of bounds for size {size}") IndexError: Invalid key: 1116 is out of bounds for size 0 ``` ### Expected behavior I expect to be able to iterate over the DataLoader without encountering an IndexError since the dataset is populated. ### Environment info - `datasets` library version: [2.14.5] - Platform: [Linux] - Python version: 3.10 - Other libraries involved: HuggingFace Transformers
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6294/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6294/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6293
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6293/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6293/comments
https://api.github.com/repos/huggingface/datasets/issues/6293/events
https://github.com/huggingface/datasets/issues/6293
1,937,238,047
I_kwDODunzps5zd-gf
6,293
Choose columns to stream parquet data in streaming mode
{ "login": "lhoestq", "id": 42851186, "node_id": "MDQ6VXNlcjQyODUxMTg2", "avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4", "gravatar_id": "", "url": "https://api.github.com/users/lhoestq", "html_url": "https://github.com/lhoestq", "followers_url": "https://api.github.com/users/lhoestq/followers", "following_url": "https://api.github.com/users/lhoestq/following{/other_user}", "gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}", "starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions", "organizations_url": "https://api.github.com/users/lhoestq/orgs", "repos_url": "https://api.github.com/users/lhoestq/repos", "events_url": "https://api.github.com/users/lhoestq/events{/privacy}", "received_events_url": "https://api.github.com/users/lhoestq/received_events", "type": "User", "site_admin": false }
[ { "id": 1935892857, "node_id": "MDU6TGFiZWwxOTM1ODkyODU3", "url": "https://api.github.com/repos/huggingface/datasets/labels/bug", "name": "bug", "color": "d73a4a", "default": true, "description": "Something isn't working" } ]
closed
false
null
[]
null
[]
2023-10-11T08:59:36
2023-10-11T16:21:38
2023-10-11T16:21:38
MEMBER
null
null
null
Currently passing columns= to load_dataset in streaming mode fails ``` Tried to load parquet data with columns '['link']' with mismatching features '{'caption': Value(dtype='string', id=None), 'image': {'bytes': Value(dtype='binary', id=None), 'path': Value(dtype='null', id=None)}, 'link': Value(dtype='string', id=None), 'message_id': Value(dtype='string', id=None), 'timestamp': Value(dtype='string', id=None)}' ``` similar to https://github.com/huggingface/datasets/issues/6039 reported at https://huggingface.co/datasets/laion/dalle-3-dataset/discussions/3#65259a09617407d4520f4ad9
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6293/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6293/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6292
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6292/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6292/comments
https://api.github.com/repos/huggingface/datasets/issues/6292/events
https://github.com/huggingface/datasets/issues/6292
1,937,050,470
I_kwDODunzps5zdQtm
6,292
how to load the image of dtype float32 or float64
{ "login": "wanglaofei", "id": 26437644, "node_id": "MDQ6VXNlcjI2NDM3NjQ0", "avatar_url": "https://avatars.githubusercontent.com/u/26437644?v=4", "gravatar_id": "", "url": "https://api.github.com/users/wanglaofei", "html_url": "https://github.com/wanglaofei", "followers_url": "https://api.github.com/users/wanglaofei/followers", "following_url": "https://api.github.com/users/wanglaofei/following{/other_user}", "gists_url": "https://api.github.com/users/wanglaofei/gists{/gist_id}", "starred_url": "https://api.github.com/users/wanglaofei/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/wanglaofei/subscriptions", "organizations_url": "https://api.github.com/users/wanglaofei/orgs", "repos_url": "https://api.github.com/users/wanglaofei/repos", "events_url": "https://api.github.com/users/wanglaofei/events{/privacy}", "received_events_url": "https://api.github.com/users/wanglaofei/received_events", "type": "User", "site_admin": false }
[]
open
false
null
[]
null
[ "Hi! Can you provide a code that reproduces the issue?\r\n\r\nAlso, which version of `datasets` are you using? You can check this by running `python -c \"import datasets; print(datasets.__version__)\"` inside the env. We added support for \"float images\" in `datasets 2.9`." ]
2023-10-11T07:27:16
2023-10-11T13:19:11
null
NONE
null
null
null
_FEATURES = datasets.Features( { "image": datasets.Image(), "text": datasets.Value("string"), }, ) The datasets builder seems only support the unit8 data. How to load the float dtype data?
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6292/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6292/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6291
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6291/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6291/comments
https://api.github.com/repos/huggingface/datasets/issues/6291/events
https://github.com/huggingface/datasets/issues/6291
1,936,129,871
I_kwDODunzps5zZv9P
6,291
Casting type from Array2D int to Array2D float crashes
{ "login": "AlanBlanchet", "id": 22567306, "node_id": "MDQ6VXNlcjIyNTY3MzA2", "avatar_url": "https://avatars.githubusercontent.com/u/22567306?v=4", "gravatar_id": "", "url": "https://api.github.com/users/AlanBlanchet", "html_url": "https://github.com/AlanBlanchet", "followers_url": "https://api.github.com/users/AlanBlanchet/followers", "following_url": "https://api.github.com/users/AlanBlanchet/following{/other_user}", "gists_url": "https://api.github.com/users/AlanBlanchet/gists{/gist_id}", "starred_url": "https://api.github.com/users/AlanBlanchet/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/AlanBlanchet/subscriptions", "organizations_url": "https://api.github.com/users/AlanBlanchet/orgs", "repos_url": "https://api.github.com/users/AlanBlanchet/repos", "events_url": "https://api.github.com/users/AlanBlanchet/events{/privacy}", "received_events_url": "https://api.github.com/users/AlanBlanchet/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "Thanks for reporting! I've opened a PR with a fix" ]
2023-10-10T20:10:10
2023-10-13T13:45:31
2023-10-13T13:45:31
NONE
null
null
null
### Describe the bug I am on a school project and the initial type for feature annotations are `Array2D(shape=(None, 4))`. I am trying to cast this type to a `float64` and pyarrow gives me this error : ``` Traceback (most recent call last): File "/home/alan/dev/ClassezDesImagesAvecDesAlgorithmesDeDeeplearning/src/sdd/data/dataset.py", line 141, in <module> dataset = StanfordDogsDataset(size, 5).original(True).demo() File "<attrs generated init __main__.StanfordDogsDataset>", line 4, in __init__ File "/home/alan/dev/ClassezDesImagesAvecDesAlgorithmesDeDeeplearning/src/sdd/data/dataset.py", line 33, in __attrs_post_init__ self.dataset = self.dataset.cast_column( File "/home/alan/.cache/pypoetry/virtualenvs/sdd-2XWLAjSi-py3.10/lib/python3.10/site-packages/datasets/fingerprint.py", line 511, in wrapper out = func(dataset, *args, **kwargs) File "/home/alan/.cache/pypoetry/virtualenvs/sdd-2XWLAjSi-py3.10/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2110, in cast_column return self.cast(features) File "/home/alan/.cache/pypoetry/virtualenvs/sdd-2XWLAjSi-py3.10/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2055, in cast dataset = dataset.map( File "/home/alan/.cache/pypoetry/virtualenvs/sdd-2XWLAjSi-py3.10/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 592, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/home/alan/.cache/pypoetry/virtualenvs/sdd-2XWLAjSi-py3.10/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 557, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/home/alan/.cache/pypoetry/virtualenvs/sdd-2XWLAjSi-py3.10/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3097, in map for rank, done, content in Dataset._map_single(**dataset_kwargs): File "/home/alan/.cache/pypoetry/virtualenvs/sdd-2XWLAjSi-py3.10/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3474, in _map_single batch = apply_function_on_filtered_inputs( File "/home/alan/.cache/pypoetry/virtualenvs/sdd-2XWLAjSi-py3.10/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3353, in apply_function_on_filtered_inputs processed_inputs = function(*fn_args, *additional_args, **fn_kwargs) File "/home/alan/.cache/pypoetry/virtualenvs/sdd-2XWLAjSi-py3.10/lib/python3.10/site-packages/datasets/table.py", line 2328, in table_cast return cast_table_to_schema(table, schema) File "/home/alan/.cache/pypoetry/virtualenvs/sdd-2XWLAjSi-py3.10/lib/python3.10/site-packages/datasets/table.py", line 2287, in cast_table_to_schema arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] File "/home/alan/.cache/pypoetry/virtualenvs/sdd-2XWLAjSi-py3.10/lib/python3.10/site-packages/datasets/table.py", line 2287, in <listcomp> arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()] File "/home/alan/.cache/pypoetry/virtualenvs/sdd-2XWLAjSi-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1831, in wrapper return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/alan/.cache/pypoetry/virtualenvs/sdd-2XWLAjSi-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1831, in <listcomp> return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/alan/.cache/pypoetry/virtualenvs/sdd-2XWLAjSi-py3.10/lib/python3.10/site-packages/datasets/table.py", line 2143, in cast_array_to_feature return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) File "/home/alan/.cache/pypoetry/virtualenvs/sdd-2XWLAjSi-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1833, in wrapper return func(array, *args, **kwargs) File "/home/alan/.cache/pypoetry/virtualenvs/sdd-2XWLAjSi-py3.10/lib/python3.10/site-packages/datasets/table.py", line 1967, in array_cast return pa_type.wrap_array(array) File "pyarrow/types.pxi", line 1369, in pyarrow.lib.BaseExtensionType.wrap_array TypeError: Incompatible storage type for extension<arrow.py_extension_type<Array2DExtensionType>>: expected list<item: list<item: double>>, got list<item: list<item: int32>> ``` ### Steps to reproduce the bug ```python dataset = datasets.load_dataset("Alanox/stanford-dogs", split="full") dataset = dataset.cast_column("annotations", Array2D((None, 4), "float64")) ``` ### Expected behavior It should simply cast the column feature type to a `float64` without error ### Environment info datasets == 2.14.5
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6291/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6291/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6290
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6290/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6290/comments
https://api.github.com/repos/huggingface/datasets/issues/6290/events
https://github.com/huggingface/datasets/issues/6290
1,935,629,679
I_kwDODunzps5zX11v
6,290
Incremental dataset (e.g. `.push_to_hub(..., append=True)`)
{ "login": "Wauplin", "id": 11801849, "node_id": "MDQ6VXNlcjExODAxODQ5", "avatar_url": "https://avatars.githubusercontent.com/u/11801849?v=4", "gravatar_id": "", "url": "https://api.github.com/users/Wauplin", "html_url": "https://github.com/Wauplin", "followers_url": "https://api.github.com/users/Wauplin/followers", "following_url": "https://api.github.com/users/Wauplin/following{/other_user}", "gists_url": "https://api.github.com/users/Wauplin/gists{/gist_id}", "starred_url": "https://api.github.com/users/Wauplin/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/Wauplin/subscriptions", "organizations_url": "https://api.github.com/users/Wauplin/orgs", "repos_url": "https://api.github.com/users/Wauplin/repos", "events_url": "https://api.github.com/users/Wauplin/events{/privacy}", "received_events_url": "https://api.github.com/users/Wauplin/received_events", "type": "User", "site_admin": false }
[ { "id": 1935892871, "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement", "name": "enhancement", "color": "a2eeef", "default": true, "description": "New feature or request" } ]
open
false
null
[]
null
[ "Yea I think waiting for #6269 would be best, or branching from it. For reference, this [PR](https://github.com/LAION-AI/Discord-Scrapers/pull/2) is progressing pretty well which will do similar using the hf hub for our LAION dataset bot https://github.com/LAION-AI/Discord-Scrapers/pull/2. " ]
2023-10-10T15:18:03
2023-10-13T16:05:26
null
CONTRIBUTOR
null
null
null
### Feature request Have the possibility to do `ds.push_to_hub(..., append=True)`. ### Motivation Requested in this [comment](https://huggingface.co/datasets/laion/dalle-3-dataset/discussions/3#65252597c4edc168202a5eaa) and this [comment](https://huggingface.co/datasets/laion/dalle-3-dataset/discussions/4#6524f675c9607bdffb208d8f). Discussed internally on [slack](https://huggingface.slack.com/archives/C02EMARJ65P/p1696950642610639?thread_ts=1690554266.830949&cid=C02EMARJ65P). ### Your contribution What I suggest to do for parquet datasets is to use `CommitOperationCopy` + `CommitOperationDelete` from `huggingface_hub`: 1. list files 2. copy files from parquet-0001-of-0004 to parquet-0001-of-0005 3. delete files like parquet-0001-of-0004 4. generate + add last parquet file parquet-0005-of-0005 => make a single commit with all commit operations at once I think it should be quite straightforward to implement. Happy to review a PR (maybe conflicting with the ongoing "1 commit push_to_hub" PR https://github.com/huggingface/datasets/pull/6269)
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6290/reactions", "total_count": 3, "+1": 3, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6290/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6288
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6288/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6288/comments
https://api.github.com/repos/huggingface/datasets/issues/6288/events
https://github.com/huggingface/datasets/issues/6288
1,935,005,457
I_kwDODunzps5zVdcR
6,288
Dataset.from_pandas with a DataFrame of PIL.Images
{ "login": "lhoestq", "id": 42851186, "node_id": "MDQ6VXNlcjQyODUxMTg2", "avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4", "gravatar_id": "", "url": "https://api.github.com/users/lhoestq", "html_url": "https://github.com/lhoestq", "followers_url": "https://api.github.com/users/lhoestq/followers", "following_url": "https://api.github.com/users/lhoestq/following{/other_user}", "gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}", "starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions", "organizations_url": "https://api.github.com/users/lhoestq/orgs", "repos_url": "https://api.github.com/users/lhoestq/repos", "events_url": "https://api.github.com/users/lhoestq/events{/privacy}", "received_events_url": "https://api.github.com/users/lhoestq/received_events", "type": "User", "site_admin": false }
[ { "id": 1935892871, "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement", "name": "enhancement", "color": "a2eeef", "default": true, "description": "New feature or request" } ]
open
false
null
[]
null
[ "A duplicate of https://github.com/huggingface/datasets/issues/4796.\r\n\r\nWe could get this for free by implementing the `Image` feature as an extension type, as shown in [this](https://colab.research.google.com/drive/1Uzm_tXVpGTwbzleDConWcNjacwO1yxE4?usp=sharing) Colab (example with UUIDs).\r\n", "+1 to this\r\nCalling this line with a df that contains a PIL image (as they are returned from load_dataset)\r\n`ds = Dataset.from_pandas(df)`\r\nResults in this error:\r\n`ArrowInvalid: ('Could not convert <PIL.PngImagePlugin.PngImageFile image mode=RGB size=1024x1024 at 0x2B41F2D70> with type PngImageFile: did not recognize Python value type when inferring an Arrow data type', 'Conversion failed for column image with type object')`" ]
2023-10-10T10:29:16
2023-10-20T18:23:05
null
MEMBER
null
null
null
Currently type inference doesn't know what to do with a Pandas Series of PIL.Image objects, though it would be nice to get a Dataset with the Image type this way
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6288/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6288/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6287
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6287/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6287/comments
https://api.github.com/repos/huggingface/datasets/issues/6287/events
https://github.com/huggingface/datasets/issues/6287
1,932,758,192
I_kwDODunzps5zM4yw
6,287
map() not recognizing "text"
{ "login": "EngineerKhan", "id": 5688359, "node_id": "MDQ6VXNlcjU2ODgzNTk=", "avatar_url": "https://avatars.githubusercontent.com/u/5688359?v=4", "gravatar_id": "", "url": "https://api.github.com/users/EngineerKhan", "html_url": "https://github.com/EngineerKhan", "followers_url": "https://api.github.com/users/EngineerKhan/followers", "following_url": "https://api.github.com/users/EngineerKhan/following{/other_user}", "gists_url": "https://api.github.com/users/EngineerKhan/gists{/gist_id}", "starred_url": "https://api.github.com/users/EngineerKhan/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/EngineerKhan/subscriptions", "organizations_url": "https://api.github.com/users/EngineerKhan/orgs", "repos_url": "https://api.github.com/users/EngineerKhan/repos", "events_url": "https://api.github.com/users/EngineerKhan/events{/privacy}", "received_events_url": "https://api.github.com/users/EngineerKhan/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "There is no \"text\" column in the `amazon_reviews_multi`, hence the `KeyError`. You can get the column names by running `dataset.column_names`." ]
2023-10-09T10:27:30
2023-10-11T20:28:45
2023-10-11T20:28:45
NONE
null
null
null
### Describe the bug The [map() documentation](https://huggingface.co/docs/datasets/v2.14.5/en/package_reference/main_classes#datasets.Dataset.map) reads: ` ds = ds.map(lambda x: tokenizer(x['text'], truncation=True, padding=True), batched=True)` I have been trying to reproduce it in my code as: `tokenizedDataset = dataset.map(lambda x: tokenizer(x['text']), batched=True)` But it doesn't work as it throws the error: > KeyError: 'text' Can you please guide me on how to fix it? ### Steps to reproduce the bug 1. `from datasets import load_dataset dataset = load_dataset("amazon_reviews_multi")` 2. Then this code: `from transformers import AutoTokenizer tokenizer = AutoTokenizer.from_pretrained("bert-base-cased")` 3. The line I quoted above (which I have been trying) ### Expected behavior As mentioned in the documentation, it should run without any error and map the tokenization on the whole dataset. ### Environment info Python 3.10.2
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6287/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6287/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6285
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6285/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6285/comments
https://api.github.com/repos/huggingface/datasets/issues/6285/events
https://github.com/huggingface/datasets/issues/6285
1,932,306,325
I_kwDODunzps5zLKeV
6,285
TypeError: expected str, bytes or os.PathLike object, not dict
{ "login": "andysingal", "id": 20493493, "node_id": "MDQ6VXNlcjIwNDkzNDkz", "avatar_url": "https://avatars.githubusercontent.com/u/20493493?v=4", "gravatar_id": "", "url": "https://api.github.com/users/andysingal", "html_url": "https://github.com/andysingal", "followers_url": "https://api.github.com/users/andysingal/followers", "following_url": "https://api.github.com/users/andysingal/following{/other_user}", "gists_url": "https://api.github.com/users/andysingal/gists{/gist_id}", "starred_url": "https://api.github.com/users/andysingal/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/andysingal/subscriptions", "organizations_url": "https://api.github.com/users/andysingal/orgs", "repos_url": "https://api.github.com/users/andysingal/repos", "events_url": "https://api.github.com/users/andysingal/events{/privacy}", "received_events_url": "https://api.github.com/users/andysingal/received_events", "type": "User", "site_admin": false }
[]
open
false
null
[]
null
[ "You should be able to load the images by modifying the `load_dataset` call like this:\r\n```python\r\ndataset = load_dataset(\"imagefolder\", data_dir=\"/content/datasets/PotholeDetectionYOLOv8-1\")\r\n```\r\n\r\nThe `imagefolder` builder expects the image files to be in `path/label/image_file` (e.g. .`.../train/dog/image_1.jpg`), so the solution for the labels in your case is to create metadata files (one for each split; as explained [here](https://huggingface.co/docs/datasets/image_dataset#imagefolder)) that map the images to their labels.", "> You should be able to load the images by modifying the `load_dataset` call like this:\r\n> \r\n> ```python\r\n> dataset = load_dataset(\"imagefolder\", data_dir=\"/content/datasets/PotholeDetectionYOLOv8-1\")\r\n> ```\r\n> \r\n> The `imagefolder` builder expects the image files to be in `path/label/image_file` (e.g. .`.../train/dog/image_1.jpg`), so the solution for the labels in your case is to create metadata files (one for each split; as explained [here](https://huggingface.co/docs/datasets/image_dataset#imagefolder)) that map the images to their labels.\r\n\r\nI tried like this but only uploads images and not labels, Andyrasika/potholes-dataset", "As explained in my previous comment, you need to define metadata files to load the labels or update the paths to be in the format `train/label/image` (`train- image /n -labels` is not supported by the loader).", "I downloaded my file after annotating using roboflow . It gives train-\r\nimages, labels , test- images, labels , valid- images, labels . I hope it\r\ngives you an idea of the dataset . Please advise on this dataset\r\n\r\nOn Tue, Oct 10, 2023 at 18:12 Mario Šaško ***@***.***> wrote:\r\n\r\n> As explained in my previous comment, you need to define metadata files to\r\n> load the labels or update the paths to be in the format train/label/image\r\n> (train- image /n -labels is not supported by the loader).\r\n>\r\n> —\r\n> Reply to this email directly, view it on GitHub\r\n> <https://github.com/huggingface/datasets/issues/6285#issuecomment-1755335215>,\r\n> or unsubscribe\r\n> <https://github.com/notifications/unsubscribe-auth/AE4LJNN56FWWTSBYTSTUWHLX6U7CVAVCNFSM6AAAAAA5YHCSTGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJVGMZTKMRRGU>\r\n> .\r\n> You are receiving this because you authored the thread.Message ID:\r\n> ***@***.***>\r\n>\r\n" ]
2023-10-09T04:56:26
2023-10-10T13:17:33
null
NONE
null
null
null
### Describe the bug my dataset is in form : train- image /n -labels and tried the code: ``` from datasets import load_dataset data_files = { "train": "/content/datasets/PotholeDetectionYOLOv8-1/train/", "validation": "/content/datasets/PotholeDetectionYOLOv8-1/valid/", "test": "/content/datasets/PotholeDetectionYOLOv8-1/test/" } dataset = load_dataset("imagefolder", data_dir=data_files) dataset ``` got error: ``` --------------------------------------------------------------------------- TypeError Traceback (most recent call last) [<ipython-input-29-2ef1926f73d9>](https://localhost:8080/#) in <cell line: 8>() 6 "test": "/content/datasets/PotholeDetectionYOLOv8-1/test/" 7 } ----> 8 dataset = load_dataset("imagefolder", data_dir=data_files) 9 dataset 6 frames [/usr/lib/python3.10/pathlib.py](https://localhost:8080/#) in _parse_args(cls, args) 576 parts += a._parts 577 else: --> 578 a = os.fspath(a) 579 if isinstance(a, str): 580 # Force-cast str subclasses to str (issue #21127) TypeError: expected str, bytes or os.PathLike object, not dict ``` ### Steps to reproduce the bug as share above ### Expected behavior load images and labels , but my dataset only uploads images - https://huggingface.co/datasets/Andyrasika/potholes-dataset ### Environment info colab pro
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6285/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6285/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6284
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6284/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6284/comments
https://api.github.com/repos/huggingface/datasets/issues/6284/events
https://github.com/huggingface/datasets/issues/6284
1,929,551,712
I_kwDODunzps5zAp9g
6,284
Add Belebele multiple-choice machine reading comprehension (MRC) dataset
{ "login": "rajveer43", "id": 64583161, "node_id": "MDQ6VXNlcjY0NTgzMTYx", "avatar_url": "https://avatars.githubusercontent.com/u/64583161?v=4", "gravatar_id": "", "url": "https://api.github.com/users/rajveer43", "html_url": "https://github.com/rajveer43", "followers_url": "https://api.github.com/users/rajveer43/followers", "following_url": "https://api.github.com/users/rajveer43/following{/other_user}", "gists_url": "https://api.github.com/users/rajveer43/gists{/gist_id}", "starred_url": "https://api.github.com/users/rajveer43/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/rajveer43/subscriptions", "organizations_url": "https://api.github.com/users/rajveer43/orgs", "repos_url": "https://api.github.com/users/rajveer43/repos", "events_url": "https://api.github.com/users/rajveer43/events{/privacy}", "received_events_url": "https://api.github.com/users/rajveer43/received_events", "type": "User", "site_admin": false }
[ { "id": 1935892871, "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement", "name": "enhancement", "color": "a2eeef", "default": true, "description": "New feature or request" } ]
closed
false
null
[]
null
[ "This dataset is already available on the Hub: https://huggingface.co/datasets/facebook/belebele.\r\n" ]
2023-10-06T06:58:03
2023-10-06T13:26:51
2023-10-06T13:26:51
NONE
null
null
null
### Feature request Belebele is a multiple-choice machine reading comprehension (MRC) dataset spanning 122 language variants. This dataset enables the evaluation of mono- and multi-lingual models in high-, medium-, and low-resource languages. Each question has four multiple-choice answers and is linked to a short passage from the [FLORES-200](https://github.com/facebookresearch/flores/tree/main/flores200) dataset. The human annotation procedure was carefully curated to create questions that discriminate between different levels of generalizable language comprehension and is reinforced by extensive quality checks. While all questions directly relate to the passage, the English dataset on its own proves difficult enough to challenge state-of-the-art language models. Being fully parallel, this dataset enables direct comparison of model performance across all languages. Belebele opens up new avenues for evaluating and analyzing the multilingual abilities of language models and NLP systems. Please refer to paper for more details, [The Belebele Benchmark: a Parallel Reading Comprehension Dataset in 122 Language Variants](https://arxiv.org/abs/2308.16884). ## Composition - 900 questions per language variant - 488 distinct passages, there are 1-2 associated questions for each. - For each question, there is 4 multiple-choice answers, exactly 1 of which is correct. - 122 language/language variants (including English). - 900 x 122 = 109,800 total questions. ### Motivation official repo https://github.com/facebookresearch/belebele ### Your contribution -
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6284/reactions", "total_count": 1, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 1, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6284/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6280
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6280/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6280/comments
https://api.github.com/repos/huggingface/datasets/issues/6280/events
https://github.com/huggingface/datasets/issues/6280
1,928,215,278
I_kwDODunzps5y7jru
6,280
Couldn't cast array of type fixed_size_list to Sequence(Value(float64))
{ "login": "jmif", "id": 1000442, "node_id": "MDQ6VXNlcjEwMDA0NDI=", "avatar_url": "https://avatars.githubusercontent.com/u/1000442?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jmif", "html_url": "https://github.com/jmif", "followers_url": "https://api.github.com/users/jmif/followers", "following_url": "https://api.github.com/users/jmif/following{/other_user}", "gists_url": "https://api.github.com/users/jmif/gists{/gist_id}", "starred_url": "https://api.github.com/users/jmif/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jmif/subscriptions", "organizations_url": "https://api.github.com/users/jmif/orgs", "repos_url": "https://api.github.com/users/jmif/repos", "events_url": "https://api.github.com/users/jmif/events{/privacy}", "received_events_url": "https://api.github.com/users/jmif/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "Thanks for reporting! I've opened a PR with a fix.", "Thanks for the quick response @mariosasko! I just installed your branch via `poetry add 'git+https://github.com/huggingface/datasets#fix-array_values'` and I can confirm it works on the example provided.\r\n\r\nFollow up question for you, should `None`s be supported in these types of features as they are in others?\r\n\r\nFor example, the following script:\r\n\r\n```\r\nfrom datasets import Features, Value, Sequence, ClassLabel, Dataset\r\n\r\ndataset_features = Features({\r\n 'text': Value('string'),\r\n 'embedding': Sequence(Value('double'), length=2),\r\n 'categories': Sequence(ClassLabel(names=sorted([\r\n 'one',\r\n 'two',\r\n 'three'\r\n ]))),\r\n})\r\n\r\ndataset = Dataset.from_dict(\r\n {\r\n 'text': ['A'] * 10000,\r\n \"embedding\": [None] * 10000, # THIS LINE CHANGED\r\n 'categories': [[0]] * 10000,\r\n },\r\n features=dataset_features\r\n)\r\n\r\ndef test_mapper(r):\r\n r['text'] = list(map(lambda t: t + ' b', r['text']))\r\n return r\r\n\r\n\r\ndataset = dataset.map(test_mapper, batched=True, batch_size=10, features=dataset_features, num_proc=2)\r\n```\r\n\r\nfails with\r\n\r\n```\r\nTraceback (most recent call last):\r\n File \"/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/multiprocess/pool.py\", line 125, in worker\r\n result = (True, func(*args, **kwds))\r\n File \"/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py\", line 1354, in _write_generator_to_queue\r\n for i, result in enumerate(func(**kwargs)):\r\n File \"/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/arrow_dataset.py\", line 3493, in _map_single\r\n writer.write_batch(batch)\r\n File \"/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/arrow_writer.py\", line 549, in write_batch\r\n array = cast_array_to_feature(col_values, col_type) if col_type is not None else col_values\r\n File \"/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/table.py\", line 1831, in wrapper\r\n return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])\r\n File \"/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/table.py\", line 1831, in <listcomp>\r\n return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])\r\n File \"/home/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/table.py\", line 2160, in cast_array_to_feature\r\n raise TypeError(f\"Couldn't cast array of type\\n{array.type}\\nto\\n{feature}\")\r\nTypeError: Couldn't cast array of type\r\nfixed_size_list<item: double>[2]\r\nto\r\nSequence(feature=Value(dtype='float64', id=None), length=2, id=None)\r\n```\r\n\r\nIdeally we can have empty embedding columns as well!", "This part of PyArrow is buggy and inconsistent regarding features implemented across the types, so the only option is to operate on the Arrow buffer level to fix issues such as the above one.", "Ok - can you take the POC I did [here](https://github.com/huggingface/datasets/commit/15443098e9ce053943172f7ec6fce3769d7dff6e)? Happy to turn this into an actual PR but would appreciate feedback on the implementation before I take another pass!" ]
2023-10-05T12:48:31
2024-02-06T19:24:20
2024-02-06T19:24:20
NONE
null
null
null
### Describe the bug I have a dataset with an embedding column, when I try to map that dataset I get the following exception: ``` Traceback (most recent call last): File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 3189, in map for rank, done, content in iflatmap_unordered( File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1387, in iflatmap_unordered [async_result.get(timeout=0.05) for async_result in async_results] File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/datasets/utils/py_utils.py", line 1387, in <listcomp> [async_result.get(timeout=0.05) for async_result in async_results] File "/Users/jmif/.virtualenvs/llm-training/lib/python3.10/site-packages/multiprocess/pool.py", line 774, in get raise self._value TypeError: Couldn't cast array of type fixed_size_list<item: float>[2] to Sequence(feature=Value(dtype='float32', id=None), length=2, id=None) ``` ### Steps to reproduce the bug Here's a simple repro script: ``` from datasets import Features, Value, Sequence, ClassLabel, Dataset dataset_features = Features({ 'text': Value('string'), 'embedding': Sequence(Value('double'), length=2), 'categories': Sequence(ClassLabel(names=sorted([ 'one', 'two', 'three' ]))), }) dataset = Dataset.from_dict( { 'text': ['A'] * 10000, 'embedding': [[0.0, 0.1]] * 10000, 'categories': [[0]] * 10000, }, features=dataset_features ) def test_mapper(r): r['text'] = list(map(lambda t: t + ' b', r['text'])) return r dataset = dataset.map(test_mapper, batched=True, batch_size=10, features=dataset_features, num_proc=2) ``` Removing the embedding column fixes the issue! ### Expected behavior The mapping completes successfully. ### Environment info - `datasets` version: 2.14.4 - Platform: macOS-14.0-arm64-arm-64bit - Python version: 3.10.12 - Huggingface_hub version: 0.17.1 - PyArrow version: 13.0.0 - Pandas version: 2.0.3
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6280/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6280/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6279
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6279/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6279/comments
https://api.github.com/repos/huggingface/datasets/issues/6279/events
https://github.com/huggingface/datasets/issues/6279
1,928,028,226
I_kwDODunzps5y62BC
6,279
Batched IterableDataset
{ "login": "lneukom", "id": 7010688, "node_id": "MDQ6VXNlcjcwMTA2ODg=", "avatar_url": "https://avatars.githubusercontent.com/u/7010688?v=4", "gravatar_id": "", "url": "https://api.github.com/users/lneukom", "html_url": "https://github.com/lneukom", "followers_url": "https://api.github.com/users/lneukom/followers", "following_url": "https://api.github.com/users/lneukom/following{/other_user}", "gists_url": "https://api.github.com/users/lneukom/gists{/gist_id}", "starred_url": "https://api.github.com/users/lneukom/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lneukom/subscriptions", "organizations_url": "https://api.github.com/users/lneukom/orgs", "repos_url": "https://api.github.com/users/lneukom/repos", "events_url": "https://api.github.com/users/lneukom/events{/privacy}", "received_events_url": "https://api.github.com/users/lneukom/received_events", "type": "User", "site_admin": false }
[ { "id": 1935892871, "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement", "name": "enhancement", "color": "a2eeef", "default": true, "description": "New feature or request" } ]
open
false
null
[]
null
[ "This is exactly what I was looking for. It would also be very useful for me :-)" ]
2023-10-05T11:12:49
2023-10-05T11:50:28
null
NONE
null
null
null
### Feature request Hi, could you add an implementation of a batched `IterableDataset`. It already support an option to do batch iteration via `.iter(batch_size=...)` but this cannot be used in combination with a torch `DataLoader` since it just returns an iterator. ### Motivation The current implementation loads each element of a batch individually which can be very slow in cases of a big batch_size. I did some experiments [here](https://discuss.huggingface.co/t/slow-dataloader-with-big-batch-size/57224) and using a batched iteration would speed up data loading significantly. ### Your contribution N/A
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6279/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6279/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6277
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6277/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6277/comments
https://api.github.com/repos/huggingface/datasets/issues/6277/events
https://github.com/huggingface/datasets/issues/6277
1,927,044,546
I_kwDODunzps5y3F3C
6,277
FileNotFoundError: Couldn't find a module script at /content/paws-x/paws-x.py. Module 'paws-x' doesn't exist on the Hugging Face Hub either.
{ "login": "diegogonzalezc", "id": 66733346, "node_id": "MDQ6VXNlcjY2NzMzMzQ2", "avatar_url": "https://avatars.githubusercontent.com/u/66733346?v=4", "gravatar_id": "", "url": "https://api.github.com/users/diegogonzalezc", "html_url": "https://github.com/diegogonzalezc", "followers_url": "https://api.github.com/users/diegogonzalezc/followers", "following_url": "https://api.github.com/users/diegogonzalezc/following{/other_user}", "gists_url": "https://api.github.com/users/diegogonzalezc/gists{/gist_id}", "starred_url": "https://api.github.com/users/diegogonzalezc/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/diegogonzalezc/subscriptions", "organizations_url": "https://api.github.com/users/diegogonzalezc/orgs", "repos_url": "https://api.github.com/users/diegogonzalezc/repos", "events_url": "https://api.github.com/users/diegogonzalezc/events{/privacy}", "received_events_url": "https://api.github.com/users/diegogonzalezc/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "`evaluate.load(\"paws-x\", \"es\")` throws the error because there is no such metric in the `evaluate` lib.\r\n\r\nSo, this is unrelated to our lib." ]
2023-10-04T22:01:25
2023-10-08T17:05:46
2023-10-08T17:05:46
NONE
null
null
null
### Describe the bug I'm encountering a "FileNotFoundError" while attempting to use the "paws-x" dataset to retrain the DistilRoBERTa-base model. The error message is as follows: FileNotFoundError: Couldn't find a module script at /content/paws-x/paws-x.py. Module 'paws-x' doesn't exist on the Hugging Face Hub either. ### Steps to reproduce the bug https://colab.research.google.com/drive/11xUUFxloClpmqLvDy_Xxfmo3oUzjY5nx#scrollTo=kUn74FigzhHm ### Expected behavior The the trained model ### Environment info colab, "paws-x" dataset , DistilRoBERTa-base model
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6277/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6277/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6276
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6276/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6276/comments
https://api.github.com/repos/huggingface/datasets/issues/6276/events
https://github.com/huggingface/datasets/issues/6276
1,925,961,878
I_kwDODunzps5yy9iW
6,276
I'm trying to fine tune the openai/whisper model from huggingface using jupyter notebook and i keep getting this error
{ "login": "valaofficial", "id": 50768065, "node_id": "MDQ6VXNlcjUwNzY4MDY1", "avatar_url": "https://avatars.githubusercontent.com/u/50768065?v=4", "gravatar_id": "", "url": "https://api.github.com/users/valaofficial", "html_url": "https://github.com/valaofficial", "followers_url": "https://api.github.com/users/valaofficial/followers", "following_url": "https://api.github.com/users/valaofficial/following{/other_user}", "gists_url": "https://api.github.com/users/valaofficial/gists{/gist_id}", "starred_url": "https://api.github.com/users/valaofficial/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/valaofficial/subscriptions", "organizations_url": "https://api.github.com/users/valaofficial/orgs", "repos_url": "https://api.github.com/users/valaofficial/repos", "events_url": "https://api.github.com/users/valaofficial/events{/privacy}", "received_events_url": "https://api.github.com/users/valaofficial/received_events", "type": "User", "site_admin": false }
[]
open
false
null
[]
null
[ "Since you are using Windows, maybe moving the `map` call inside `if __name__ == \"__main__\"` can fix the issue:\r\n```python\r\nif __name__ == \"__main__\":\r\n common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names[\"train\"], num_proc=4)\r\n```\r\n\r\nOtherwise, the only solution is to set `num_proc=1`.", "> Since you are using Windows, maybe moving the `map` call inside `if __name__ == \"__main__\"` can fix the issue:\r\n> \r\n> ```python\r\n> if __name__ == \"__main__\":\r\n> common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names[\"train\"], num_proc=4)\r\n> ```\r\n> \r\n> Otherwise, the only solution is to set `num_proc=1`.\r\n\r\nThank you very much for the response, i eventually tried setting `num_proc=1` and now the jupyter notebook kernel keers dying after running the command, what do you think the issue could be, could it be that my system is not capable of running the command \"i'm using a Lenovo Thinkpad T440 with no GPU\"", "Firstly, you didn't define feature_extractor variable. Secondly, it is large nlp model. Hence you should use proper gpu, otherwise your machine's cpu will be overclock and you can do nothing." ]
2023-10-04T11:03:41
2023-11-27T10:39:16
null
NONE
null
null
null
### Describe the bug I'm trying to fine tune the openai/whisper model from huggingface using jupyter notebook and i keep getting this error, i'm following the steps in this blog post https://huggingface.co/blog/fine-tune-whisper I tried google collab and it works but because I'm on the free version the training doesn't complete the error comes in jupyter notebook when i run this line `common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)` here is the error message ``` Map (num_proc=4): 0% 0/2506 [00:52<?, ? examples/s] The above exception was the direct cause of the following exception: NameError Traceback (most recent call last) Cell In[19], line 1 ----> 1 common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4) File ~\anaconda\Lib\site-packages\datasets\dataset_dict.py:853, in DatasetDict.map(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, desc) 850 if cache_file_names is None: 851 cache_file_names = {k: None for k in self} 852 return DatasetDict( --> 853 { 854 k: dataset.map( 855 function=function, 856 with_indices=with_indices, 857 with_rank=with_rank, 858 input_columns=input_columns, 859 batched=batched, 860 batch_size=batch_size, 861 drop_last_batch=drop_last_batch, 862 remove_columns=remove_columns, 863 keep_in_memory=keep_in_memory, 864 load_from_cache_file=load_from_cache_file, 865 cache_file_name=cache_file_names[k], 866 writer_batch_size=writer_batch_size, 867 features=features, 868 disable_nullable=disable_nullable, 869 fn_kwargs=fn_kwargs, 870 num_proc=num_proc, 871 desc=desc, 872 ) 873 for k, dataset in self.items() 874 } 875 ) File ~\anaconda\Lib\site-packages\datasets\dataset_dict.py:854, in <dictcomp>(.0) 850 if cache_file_names is None: 851 cache_file_names = {k: None for k in self} 852 return DatasetDict( 853 { --> 854 k: dataset.map( 855 function=function, 856 with_indices=with_indices, 857 with_rank=with_rank, 858 input_columns=input_columns, 859 batched=batched, 860 batch_size=batch_size, 861 drop_last_batch=drop_last_batch, 862 remove_columns=remove_columns, 863 keep_in_memory=keep_in_memory, 864 load_from_cache_file=load_from_cache_file, 865 cache_file_name=cache_file_names[k], 866 writer_batch_size=writer_batch_size, 867 features=features, 868 disable_nullable=disable_nullable, 869 fn_kwargs=fn_kwargs, 870 num_proc=num_proc, 871 desc=desc, 872 ) 873 for k, dataset in self.items() 874 } 875 ) File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:592, in transmit_tasks.<locals>.wrapper(*args, **kwargs) 590 self: "Dataset" = kwargs.pop("self") 591 # apply actual function --> 592 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 593 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 594 for dataset in datasets: 595 # Remove task templates if a column mapping of the template is no longer valid File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:557, in transmit_format.<locals>.wrapper(*args, **kwargs) 550 self_format = { 551 "type": self._format_type, 552 "format_kwargs": self._format_kwargs, 553 "columns": self._format_columns, 554 "output_all_columns": self._output_all_columns, 555 } 556 # apply actual function --> 557 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 558 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 559 # re-apply format to the output File ~\anaconda\Lib\site-packages\datasets\arrow_dataset.py:3189, in Dataset.map(self, function, with_indices, with_rank, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 3182 logger.info(f"Spawning {num_proc} processes") 3183 with logging.tqdm( 3184 disable=not logging.is_progress_bar_enabled(), 3185 unit=" examples", 3186 total=pbar_total, 3187 desc=(desc or "Map") + f" (num_proc={num_proc})", 3188 ) as pbar: -> 3189 for rank, done, content in iflatmap_unordered( 3190 pool, Dataset._map_single, kwargs_iterable=kwargs_per_job 3191 ): 3192 if done: 3193 shards_done += 1 File ~\anaconda\Lib\site-packages\datasets\utils\py_utils.py:1394, in iflatmap_unordered(pool, func, kwargs_iterable) 1391 finally: 1392 if not pool_changed: 1393 # we get the result in case there's an error to raise -> 1394 [async_result.get(timeout=0.05) for async_result in async_results] File ~\anaconda\Lib\site-packages\datasets\utils\py_utils.py:1394, in <listcomp>(.0) 1391 finally: 1392 if not pool_changed: 1393 # we get the result in case there's an error to raise -> 1394 [async_result.get(timeout=0.05) for async_result in async_results] File ~\anaconda\Lib\site-packages\multiprocess\pool.py:774, in ApplyResult.get(self, timeout) 772 return self._value 773 else: --> 774 raise self._value NameError: name 'feature_extractor' is not defined ``` ### Steps to reproduce the bug 1. follow the steps in this blog post https://huggingface.co/blog/fine-tune-whisper 2. run this line of code `common_voice = common_voice.map(prepare_dataset, remove_columns=common_voice.column_names["train"], num_proc=4)` 3. I'm using jupyter notebook from anaconda ### Expected behavior No error message ### Environment info datasets version: 2.8.0 Python version: 3.11 Windows 10
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6276/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6276/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6275
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6275/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6275/comments
https://api.github.com/repos/huggingface/datasets/issues/6275/events
https://github.com/huggingface/datasets/issues/6275
1,921,354,680
I_kwDODunzps5yhYu4
6,275
Would like to Contribute a dataset
{ "login": "vikas70607", "id": 97907750, "node_id": "U_kgDOBdX0Jg", "avatar_url": "https://avatars.githubusercontent.com/u/97907750?v=4", "gravatar_id": "", "url": "https://api.github.com/users/vikas70607", "html_url": "https://github.com/vikas70607", "followers_url": "https://api.github.com/users/vikas70607/followers", "following_url": "https://api.github.com/users/vikas70607/following{/other_user}", "gists_url": "https://api.github.com/users/vikas70607/gists{/gist_id}", "starred_url": "https://api.github.com/users/vikas70607/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/vikas70607/subscriptions", "organizations_url": "https://api.github.com/users/vikas70607/orgs", "repos_url": "https://api.github.com/users/vikas70607/repos", "events_url": "https://api.github.com/users/vikas70607/events{/privacy}", "received_events_url": "https://api.github.com/users/vikas70607/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "Hi! The process of contributing a dataset is explained here: https://huggingface.co/docs/datasets/upload_dataset. Also, check https://huggingface.co/docs/datasets/image_dataset for a more detailed explanation of how to share an image dataset." ]
2023-10-02T07:00:21
2023-10-10T16:27:54
2023-10-10T16:27:54
NONE
null
null
null
I have a dataset of 2500 images that can be used for color-blind machine-learning algorithms. Since , there was no dataset available online , I made this dataset myself and would like to contribute this now to community
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6275/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6275/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6274
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6274/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6274/comments
https://api.github.com/repos/huggingface/datasets/issues/6274/events
https://github.com/huggingface/datasets/issues/6274
1,921,036,328
I_kwDODunzps5ygLAo
6,274
FileNotFoundError for dataset with multiple builder config
{ "login": "LouisChen15", "id": 97120485, "node_id": "U_kgDOBcnw5Q", "avatar_url": "https://avatars.githubusercontent.com/u/97120485?v=4", "gravatar_id": "", "url": "https://api.github.com/users/LouisChen15", "html_url": "https://github.com/LouisChen15", "followers_url": "https://api.github.com/users/LouisChen15/followers", "following_url": "https://api.github.com/users/LouisChen15/following{/other_user}", "gists_url": "https://api.github.com/users/LouisChen15/gists{/gist_id}", "starred_url": "https://api.github.com/users/LouisChen15/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/LouisChen15/subscriptions", "organizations_url": "https://api.github.com/users/LouisChen15/orgs", "repos_url": "https://api.github.com/users/LouisChen15/repos", "events_url": "https://api.github.com/users/LouisChen15/events{/privacy}", "received_events_url": "https://api.github.com/users/LouisChen15/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "Please tell me if the above info is not enough for solving the problem. I will then make my dataset public temporarily so that you can really reproduce the bug. " ]
2023-10-01T23:45:56
2023-10-02T20:09:38
2023-10-02T20:09:38
NONE
null
null
null
### Describe the bug When there is only one config and only the dataset name is entered when using datasets.load_dataset(), it works fine. But if I create a second builder_config for my dataset and enter the config name when using datasets.load_dataset(), the following error will happen. FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/chenx/.cache/huggingface/datasets/my_dataset/0_shot_multiple_choice/1.0.0/97c3854a012cfd6b045e3be4c864739902af2d818bb9235b047baa94c302e9a2.incomplete/my_dataset-test-00000-00000-of-NNNNN.arrow' The "XXX.incomplete folder" in the cache folder of my dataset will disappear before "generating test split", which does not happen when config name is not entered and the config name is "default" C:\Users\chenx\.cache\huggingface\datasets\my_dataset\0_shot_multiple_choice\1.0.0 The folder that is supposed to remain under the above directory will disappear, and the data generator will not have a place to generate data into. ### Steps to reproduce the bug test = load_dataset('my_dataset', '0_shot_multiple_choice') ### Expected behavior FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/chenx/.cache/huggingface/datasets/my_dataset/0_shot_multiple_choice/1.0.0/97c3854a012cfd6b045e3be4c864739902af2d818bb9235b047baa94c302e9a2.incomplete/my_dataset-test-00000-00000-of-NNNNN.arrow' ### Environment info datasets 2.14.5 python 3.8.18
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6274/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6274/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6273
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6273/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6273/comments
https://api.github.com/repos/huggingface/datasets/issues/6273/events
https://github.com/huggingface/datasets/issues/6273
1,920,922,260
I_kwDODunzps5yfvKU
6,273
Broken Link to PubMed Abstracts dataset .
{ "login": "sameemqureshi", "id": 100606327, "node_id": "U_kgDOBf8hdw", "avatar_url": "https://avatars.githubusercontent.com/u/100606327?v=4", "gravatar_id": "", "url": "https://api.github.com/users/sameemqureshi", "html_url": "https://github.com/sameemqureshi", "followers_url": "https://api.github.com/users/sameemqureshi/followers", "following_url": "https://api.github.com/users/sameemqureshi/following{/other_user}", "gists_url": "https://api.github.com/users/sameemqureshi/gists{/gist_id}", "starred_url": "https://api.github.com/users/sameemqureshi/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/sameemqureshi/subscriptions", "organizations_url": "https://api.github.com/users/sameemqureshi/orgs", "repos_url": "https://api.github.com/users/sameemqureshi/repos", "events_url": "https://api.github.com/users/sameemqureshi/events{/privacy}", "received_events_url": "https://api.github.com/users/sameemqureshi/received_events", "type": "User", "site_admin": false }
[]
open
false
null
[]
null
[ "This has already been reported in the HF Course repo (https://github.com/huggingface/course/issues/623).", "@lhoestq @albertvillanova @lewtun I don't think we are allowed to host these data files on the Hub (due to DMCA), which means the only option is to use a different dataset in the course (and to re-record the video 🙂), no?", "Keeping the video is maybe fine, we can add a note on youtube to suggest to load a dataset with a different name. Maybe C4 ? And update the code snippets on the website ?", "Maybe you want to try it with the PUBMED dataset that I reproduced based on the The [PubMed Abstract GitHub Site](http://github.com/thoppe/The-Pile-PubMed) and uploaded on the HuggingFace:\r\n\r\n```\r\nfrom datasets import load_dataset\r\npubmed_dataset = load_dataset(\"hwang2006/PUBMED_title_abstracts_2020_baseline\")\r\npubmed_dataset\r\n\r\n#Downloading data: 100%\r\n#7.98G/7.98G [11:47<00:00, 9.68MB/s]\r\n#Generating train split: 17722096/0 [00:36<00:00, 505376.37 examples/s]\r\n\r\n#DatasetDict({\r\n# train: Dataset({\r\n# features: ['meta', 'text'],\r\n# num_rows: 17722096\r\n# })\r\n#})\r\n```" ]
2023-10-01T19:08:48
2024-01-09T05:48:01
null
NONE
null
null
null
### Describe the bug The link provided for the dataset is broken, data_files = [https://the-eye.eu/public/AI/pile_preliminary_components/PUBMED_title_abstracts_2019_baseline.jsonl.zst](url) The ### Steps to reproduce the bug Steps to reproduce: 1) Head over to [https://huggingface.co/learn/nlp-course/chapter5/4?fw=pt#big-data-datasets-to-the-rescue](url) 2) In the Section "What is the Pile?", you can see a code snippet that contains the broken link. ### Expected behavior The link should Redirect to the "PubMed Abstracts dataset" as expected . ### Environment info .
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6273/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6273/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6272
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6272/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6272/comments
https://api.github.com/repos/huggingface/datasets/issues/6272/events
https://github.com/huggingface/datasets/issues/6272
1,920,831,487
I_kwDODunzps5yfY__
6,272
Duplicate `data_files` when named `<split>/<split>.parquet`
{ "login": "lhoestq", "id": 42851186, "node_id": "MDQ6VXNlcjQyODUxMTg2", "avatar_url": "https://avatars.githubusercontent.com/u/42851186?v=4", "gravatar_id": "", "url": "https://api.github.com/users/lhoestq", "html_url": "https://github.com/lhoestq", "followers_url": "https://api.github.com/users/lhoestq/followers", "following_url": "https://api.github.com/users/lhoestq/following{/other_user}", "gists_url": "https://api.github.com/users/lhoestq/gists{/gist_id}", "starred_url": "https://api.github.com/users/lhoestq/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/lhoestq/subscriptions", "organizations_url": "https://api.github.com/users/lhoestq/orgs", "repos_url": "https://api.github.com/users/lhoestq/repos", "events_url": "https://api.github.com/users/lhoestq/events{/privacy}", "received_events_url": "https://api.github.com/users/lhoestq/received_events", "type": "User", "site_admin": false }
[ { "id": 1935892857, "node_id": "MDU6TGFiZWwxOTM1ODkyODU3", "url": "https://api.github.com/repos/huggingface/datasets/labels/bug", "name": "bug", "color": "d73a4a", "default": true, "description": "Something isn't working" } ]
closed
false
null
[]
null
[ "Also reported in https://github.com/huggingface/datasets/issues/6259", "I think it's best to drop duplicates with a `set` (as a temporary fix) and improve the patterns when/if https://github.com/fsspec/filesystem_spec/pull/1382 gets merged. @lhoestq Do you have some other ideas?", "Alternatively we could just use this no ?\r\n\r\n```python\r\nif config.FSSPEC_VERSION < version.parse(\"2023.9.0\"):\r\n KEYWORDS_IN_PATH_NAME_BASE_PATTERNS = [\r\n \"{keyword}[{sep}/]**\",\r\n \"**[{sep}]{keyword}[{sep}/]**\",\r\n \"**/{keyword}[{sep}/]**\",\r\n ]\r\nelse:\r\n KEYWORDS_IN_PATH_NAME_BASE_PATTERNS = [\r\n \"{keyword}[{sep}/]**\",\r\n \"**/*[{sep}]{keyword}[{sep}/]**\",\r\n \"**/*/{keyword}[{sep}/]**\",\r\n ]\r\n```\r\n\r\nThis way no need to implement sets, which would require a bit of work since we've always considered a list of pattern to be resolved as the concatenated list of resolved files for each pattern (including duplicates)\r\n", "Arf `\"**/*/{keyword}[{sep}/]**\"` does return `data/keyword.txt` in latest `fsspec` but not in `glob.glob`\r\n\r\nEDIT: actually forgot to set `recursive=True`", "Actually `glob.glob` does return it with `recursive=True` ! my bad", "Pff just tested and my idea sucks, pattern 1 and 3 obviously give duplicates ", "> I think it's best to drop duplicates with a set (as a temporary fix)\r\n\r\nI started https://github.com/huggingface/datasets/pull/6278 to use DataFilesSet objects instead of DataFilesList" ]
2023-10-01T15:43:56
2024-03-15T15:22:05
2024-03-15T15:22:05
MEMBER
null
null
null
e.g. with `u23429/stock_1_minute_ticker` ```ipython In [1]: from datasets import * In [2]: b = load_dataset_builder("u23429/stock_1_minute_ticker") Downloading readme: 100%|██████████████████████████| 627/627 [00:00<00:00, 246kB/s] In [3]: b.config.data_files Out[3]: {NamedSplit('train'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet', 'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/train/train.parquet'], NamedSplit('validation'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet', 'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/validation/validation.parquet'], NamedSplit('test'): ['hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet', 'hf://datasets/u23429/stock_1_minute_ticker@65c973cf4ec061f01a363b40da4c1bb128ba4166/test/test.parquet']} ``` This bug issue is present in the current `datasets` 2.14.5 and also on `main` even after https://github.com/huggingface/datasets/pull/6244 cc @mariosasko
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6272/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6272/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6271
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6271/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6271/comments
https://api.github.com/repos/huggingface/datasets/issues/6271/events
https://github.com/huggingface/datasets/issues/6271
1,920,420,295
I_kwDODunzps5yd0nH
6,271
Overwriting Split overwrites data but not metadata, corrupting dataset
{ "login": "govindrai", "id": 13859249, "node_id": "MDQ6VXNlcjEzODU5MjQ5", "avatar_url": "https://avatars.githubusercontent.com/u/13859249?v=4", "gravatar_id": "", "url": "https://api.github.com/users/govindrai", "html_url": "https://github.com/govindrai", "followers_url": "https://api.github.com/users/govindrai/followers", "following_url": "https://api.github.com/users/govindrai/following{/other_user}", "gists_url": "https://api.github.com/users/govindrai/gists{/gist_id}", "starred_url": "https://api.github.com/users/govindrai/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/govindrai/subscriptions", "organizations_url": "https://api.github.com/users/govindrai/orgs", "repos_url": "https://api.github.com/users/govindrai/repos", "events_url": "https://api.github.com/users/govindrai/events{/privacy}", "received_events_url": "https://api.github.com/users/govindrai/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[]
2023-09-30T22:37:31
2023-10-16T13:30:50
2023-10-16T13:30:50
NONE
null
null
null
### Describe the bug I want to be able to overwrite/update/delete splits in my dataset. Currently the only way to do is to manually go into the dataset and delete the split. If I try to overwrite programmatically I end up in an error state and (somewhat) corrupting the dataset. Read below. **Current Behavior** When I push to an existing split I get this error: `ValueError: Split complexRoofLocation_01Apr2023_to_31May2023test already present` This seems to suggest that the library doesn't support overwriting splits. **Potential Bug** What’s strange is that datasets, despite the operation erroring out with the ValueError above, does, in fact, overwrite the split: `Pushing dataset shards to the dataset hub: 100% [.....................] 1/1 [00:00<00:00, 55.04it/s]` Even though you got an error message and your code fails, your dataset is now changed. That seems like a bug. Either don't change the dataset, or don't throw the error and allow the script to proceed. Additional Bug While it overwrites the split, it doesn’t overwrite the split’s information. Because of this when you pull down the dataset you may end up getting a `NonMatchingSplitsSizesError` if the size of the dataset during the overwrite is different. For example, my original split had 5 rows, but on my overwrite, I only had 4. Then when I try to download the dataset, I get a `NonMatchingSplitsSizesError` because the dataset's data.json states there’s 5 but only 4 exist in the split. Expected Behavior This corrupts the dataset rendering it unusable (until you take manual intervention). Either the library should let the overwrite happen (which it does but should also update the metadata) or it shouldn’t do anything. ### Steps to reproduce the bug [Colab Notebook](https://colab.research.google.com/drive/1bqVkD06Ngs9MQNdSk_ygCG6y1UqXA4pC?usp=sharing) ### Expected behavior The split should be overwritten and I should be able to use the new version of the dataset without issue. ### Environment info - `datasets` version: 2.14.5 - Platform: Linux-5.15.120+-x86_64-with-glibc2.35 - Python version: 3.10.12 - Huggingface_hub version: 0.17.3 - PyArrow version: 9.0.0 - Pandas version: 1.5.3
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6271/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6271/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6270
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6270/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6270/comments
https://api.github.com/repos/huggingface/datasets/issues/6270/events
https://github.com/huggingface/datasets/issues/6270
1,920,329,373
I_kwDODunzps5ydead
6,270
Dataset.from_generator raises with sharded gen_args
{ "login": "hartmans", "id": 53510, "node_id": "MDQ6VXNlcjUzNTEw", "avatar_url": "https://avatars.githubusercontent.com/u/53510?v=4", "gravatar_id": "", "url": "https://api.github.com/users/hartmans", "html_url": "https://github.com/hartmans", "followers_url": "https://api.github.com/users/hartmans/followers", "following_url": "https://api.github.com/users/hartmans/following{/other_user}", "gists_url": "https://api.github.com/users/hartmans/gists{/gist_id}", "starred_url": "https://api.github.com/users/hartmans/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/hartmans/subscriptions", "organizations_url": "https://api.github.com/users/hartmans/orgs", "repos_url": "https://api.github.com/users/hartmans/repos", "events_url": "https://api.github.com/users/hartmans/events{/privacy}", "received_events_url": "https://api.github.com/users/hartmans/received_events", "type": "User", "site_admin": false }
[]
closed
false
null
[]
null
[ "`gen_kwargs` should be a `dict`, as stated in the docstring, but you are passing a `list`.\r\n\r\nSo, to fix the error, replace the list of dicts with a dict of lists (and slightly modify the generator function):\r\n```python\r\nfrom pathlib import Path\r\nimport datasets\r\n\r\ndef process_yaml(files):\r\n for f in files:\r\n # process\r\n yield dict(...)\r\n\r\n\r\nif __name__ == '__main__':\r\n import sys\r\n dir = Path(sys.argv[0]).parent\r\n ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs={'files': [f for f in dir.glob('*.yml')]})\r\n ds.to_json('training.jsonl')\r\n```", "That runs, and because my dataset is small, it's what I did to get past the problem.\r\nHowever, it does not produce a sharded dataset. From the doc string I expect there ought to be a way to call from_generator such that num_shards in the resulting data set is equal to the number of items in the list.\r\nThe part of the doc string that your suggestion is not responsive to is:\r\n` You can define a sharded dataset by passing the list of shards in *g\r\nen_kwargs*.\r\n`\r\n\r\nWhat your suggestion does is calls the generator once, with the list argument, and produces a single shard dataset.\r\n", "The sharding mentioned here refers to using this function with `num_proc` (multiprocessing splits the `kwargs` into shards and passes them to the generator function)\r\n\r\n> That runs, and because my dataset is small, it's what I did to get past the problem.\r\n\r\n`from_generator` generates a memory-mapped dataset (can be larger than RAM), so the dataset size should not be an issue unless the generator function's implementation does not properly free the memory.\r\n", "It sounds like you are saying that num_proc affects the form of gen_kwargs.\r\nAre you saying that for non-zero num_proc gen_kwargs should be a list whose length is the same as num_proc?\r\nOr are you saying that for non-zero num_proc, gen_kwargs should be a dict whose elements are lists the length of num_proc?\r\n", "I ran some tests. So, it looks like with num_proc greater than 1, gen_kwargs is expected to be a dict of lists. It calls the generator also with a dict of lists, but the lists are split.\r\nI.E. if my original has `gen_kwargs=dict(a=[0,1,2])`, then my generator might get called with `gen_kwalrgs=dict([0])`.\r\nThat all makes sense, but I definitely think there is room for improvement in the doc string here.\r\nIn order to suggest improvements to the doc string, I need to look at how the gen_kwargs are split, and figure out if:\r\n* num_proc needs to exactly equal the length of the lists\r\n* num_proc needs to evenly divide the length of the lists\r\n* Or there's no required relationship.\r\nI'll look into that and then propose an improved doc string if no one else gets to it first.", "Okay, that was fun; I took a dive through the dataset code and feel like I have a much better understanding.\r\nHere is my understanding of the behavior:\r\n* max_proc is an upper limit on the number of shards that `from_generator` produces\r\n* If `max_proc` is greater than 1, then all lists in *gen_kwargs* must be the same length\r\n* If the lists in *gen_kwargs* are shorter than *num_proc* elements, *num_proc* will be reduced and a warning produced. Put another way, `min(list_length, num_shards)` shards will be produced\r\n* The members of the lists in *gen_kwargs* will be partitioned among the created jobs.\r\nTo validate the above, take a look at\r\n`_number_of_shards_in_gen_kwargs` and `_distribute_shards` and `_split_gen_kwargs` in utils/sharding.py.\r\nI've also chased down starting at *from_generator* all the way through to GeneratorBuilder and the calls to the functions in sharding.py.\r\nTomorrow I'll take a look at the contributing guidelines and see what's involved in putting together a PR to improve the doc string." ]
2023-09-30T16:50:06
2023-10-11T20:29:12
2023-10-11T20:29:11
CONTRIBUTOR
null
null
null
### Describe the bug According to the docs of Datasets.from_generator: ``` gen_kwargs(`dict`, *optional*): Keyword arguments to be passed to the `generator` callable. You can define a sharded dataset by passing the list of shards in `gen_kwargs`. ``` So I'd expect that if gen_kwargs was a list, then my generator would be called once for each element in the list with the dict in the list for that element. It doesn't work that way though. ### Steps to reproduce the bug ```python #!/usr/bin/python from pathlib import Path import datasets def process_yaml(file): yield dict(example=42) if __name__ == '__main__': import sys dir = Path(sys.argv[0]).parent ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')], ) ds.to_json('training.jsonl') ``` ``` Generating train split: 0 examples [00:00, ? examples/s] Traceback (most recent call last): File "/tmp/dataset_bug.py", line 13, in <module> ds = datasets.Dataset.from_generator(process_yaml, gen_kwargs=[{'file':f} for f in dir.glob('*.yml')], ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/arrow_dataset.py", line 1072, in from_generator ).read() ^^^^^^ File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/io/generator.py", line 47, in read self.builder.download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 954, in download_and_prepare self._download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1717, in _download_and_prepare super()._download_and_prepare( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1049, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1555, in _prepare_split for job_id, done, content in self._prepare_split_single( File "/home/hartmans/ai/venv/lib/python3.11/site-packages/datasets/builder.py", line 1656, in _prepare_split_single generator = self._generate_examples(**gen_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: datasets.packaged_modules.generator.generator.Generator._generate_examples() argument after ** must be a ``` mapping, not list ### Expected behavior I would expect that process_yaml would be called once for each yaml file in the directory where the script is run. I also tried with the list being in gen_kwargs, but in that case process_yaml gets called with a list. ### Environment info - `datasets` version: 2.14.6.dev0 (git commit 0cc77d7f45c7369; also tested with 2.14.0) - Platform: Linux-6.1.0-10-amd64-x86_64-with-glibc2.36 - Python version: 3.11.2 - Huggingface_hub version: 0.16.4 - PyArrow version: 12.0.1 - Pandas version: 2.0.3
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6270/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6270/timeline
null
completed
https://api.github.com/repos/huggingface/datasets/issues/6267
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6267/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6267/comments
https://api.github.com/repos/huggingface/datasets/issues/6267/events
https://github.com/huggingface/datasets/issues/6267
1,916,443,262
I_kwDODunzps5yOpp-
6,267
Multi label class encoding
{ "login": "jmif", "id": 1000442, "node_id": "MDQ6VXNlcjEwMDA0NDI=", "avatar_url": "https://avatars.githubusercontent.com/u/1000442?v=4", "gravatar_id": "", "url": "https://api.github.com/users/jmif", "html_url": "https://github.com/jmif", "followers_url": "https://api.github.com/users/jmif/followers", "following_url": "https://api.github.com/users/jmif/following{/other_user}", "gists_url": "https://api.github.com/users/jmif/gists{/gist_id}", "starred_url": "https://api.github.com/users/jmif/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/jmif/subscriptions", "organizations_url": "https://api.github.com/users/jmif/orgs", "repos_url": "https://api.github.com/users/jmif/repos", "events_url": "https://api.github.com/users/jmif/events{/privacy}", "received_events_url": "https://api.github.com/users/jmif/received_events", "type": "User", "site_admin": false }
[ { "id": 1935892871, "node_id": "MDU6TGFiZWwxOTM1ODkyODcx", "url": "https://api.github.com/repos/huggingface/datasets/labels/enhancement", "name": "enhancement", "color": "a2eeef", "default": true, "description": "New feature or request" } ]
open
false
null
[]
null
[ "You can use a `Sequence(ClassLabel(...))` feature type to represent a list of labels, and `cast_column`/`cast` to perform the \"string to label\" conversion (`class_encode_column` does support nested fields), e.g., in your case:\r\n```python\r\nfrom datasets import Dataset, Sequence, ClassLabel\r\ndata = {\r\n 'text': ['one', 'two', 'three', 'four'],\r\n 'labels': [['a', 'b'], ['b'], ['b', 'c'], ['a', 'd']]\r\n}\r\n\r\ndataset = Dataset.from_dict(data)\r\ndataset = dataset.cast_column('labels', Sequence(ClassLabel(names=[\"a\", \"b\", \"c\", \"d\"])))\r\n```", "Great! Can you elaborate on \"class_encode_column does support nested fields\"? Do you mean that there is a way to `class_encode_column` on a Sequence?", "Yes, exactly! This would be a nice contribution, though.", "Sorry, I'm still not following. Are you saying that there currently exists a way to call `class_encode_column` on a `Sequence(ClassLabel)` type? Or that the underlying data structures support it and a contribution of a method to do that would be welcome?", "`class_encode_column ` currently does not support `Sequence(ClassLabel)`. Implementing support for this would be a nice contribution.\r\n\r\nIn the meantime, this limitation can be circumvented by fetching (unique) labels and calling `.cast_column(col, Sequence(ClassLabel(names=labels)))`.", "Ok makes sense, can you take a look at the POC implementation I did [here](https://github.com/huggingface/datasets/commit/15443098e9ce053943172f7ec6fce3769d7dff6e)? Happy to take another pass / submit as a PR but would be helpful if I got a thumbs up that this was directionally correct with respect to implementation / architecture. ", "There is no need to introduce a new type (`MultiLabel`) for this feature. Also, I think we can keep the logic inside a single method instead of separating the two cases.\r\n\r\nMaybe https://github.com/huggingface/datasets/pull/4277 can help with the implementation. We extended `align_labels_with_mapping` to support `Sequence(ClassLabel(...))` in that PR (initially, it only worked with `ClassLabel(...)`)" ]
2023-09-27T22:48:08
2023-10-26T18:46:08
null
NONE
null
null
null
### Feature request I have a multi label dataset and I'd like to be able to class encode the column and store the mapping directly in the features just as I can with a single label column. `class_encode_column` currently does not support multi labels. Here's an example of what I'd like to encode: ``` data = { 'text': ['one', 'two', 'three', 'four'], 'labels': [['a', 'b'], ['b'], ['b', 'c'], ['a', 'd']] } dataset = Dataset.from_dict(data) dataset = dataset.class_encode_column('labels') ``` I did some digging into the code base to evaluate the feasibility of this (note I'm very new to this code base) and from what I noticed the `ClassLabel` feature is still stored as an underlying raw data type of int so I thought a `MultiLabel` feature could similarly be stored as a Sequence of ints, thus not requiring significant serialization / conversion work to / from arrow. I did a POC of this [here](https://github.com/huggingface/datasets/commit/15443098e9ce053943172f7ec6fce3769d7dff6e) and included a simple test case (please excuse all the commented out tests, going for speed of POC here and didn't want to fight IDE to debug a single test). In the test I just assert that `num_classes` is the same to show that things are properly serializing, but if you break after loading from disk you'll see the dataset correct and the dataset feature is as expected. After digging more I did notice a few issues - After loading from disk I noticed type of the `labels` class is `Sequence` not `MultiLabel` (though the added `feature` attribute came through). This doesn't happen for `ClassLabel` but I couldn't find the encode / decode code paths that handle this. - I subclass `Sequence` in `MultiLabel` to leverage existing serialization, but this does miss the custom encode logic that `ClassLabel` has. I'm not sure of the best way to approach this as I haven't fully understood the encode / decode flow for datasets. I suspect my simple implementation will need some improvement as it'll require a significant amount of repeated logic to mimic `ClassLabel` behavior. ### Motivation See above - would like to support multi label class encodings. ### Your contribution This would be a big help for us and we're open to contributing but I'll likely need some guidance on how to implement to fit the encode / decode flow. Some suggestions on tests / would be great too, I'm guessing in addition to the class encode tests (that I'll need to expand) we'll need encode / decode tests.
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6267/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6267/timeline
null
null
https://api.github.com/repos/huggingface/datasets/issues/6263
https://api.github.com/repos/huggingface/datasets
https://api.github.com/repos/huggingface/datasets/issues/6263/labels{/name}
https://api.github.com/repos/huggingface/datasets/issues/6263/comments
https://api.github.com/repos/huggingface/datasets/issues/6263/events
https://github.com/huggingface/datasets/issues/6263
1,914,951,043
I_kwDODunzps5yI9WD
6,263
CI is broken: ImportError: cannot import name 'context' from 'tensorflow.python'
{ "login": "albertvillanova", "id": 8515462, "node_id": "MDQ6VXNlcjg1MTU0NjI=", "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "gravatar_id": "", "url": "https://api.github.com/users/albertvillanova", "html_url": "https://github.com/albertvillanova", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "repos_url": "https://api.github.com/users/albertvillanova/repos", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "type": "User", "site_admin": false }
[ { "id": 1935892857, "node_id": "MDU6TGFiZWwxOTM1ODkyODU3", "url": "https://api.github.com/repos/huggingface/datasets/labels/bug", "name": "bug", "color": "d73a4a", "default": true, "description": "Something isn't working" } ]
closed
false
{ "login": "albertvillanova", "id": 8515462, "node_id": "MDQ6VXNlcjg1MTU0NjI=", "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "gravatar_id": "", "url": "https://api.github.com/users/albertvillanova", "html_url": "https://github.com/albertvillanova", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "repos_url": "https://api.github.com/users/albertvillanova/repos", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "type": "User", "site_admin": false }
[ { "login": "albertvillanova", "id": 8515462, "node_id": "MDQ6VXNlcjg1MTU0NjI=", "avatar_url": "https://avatars.githubusercontent.com/u/8515462?v=4", "gravatar_id": "", "url": "https://api.github.com/users/albertvillanova", "html_url": "https://github.com/albertvillanova", "followers_url": "https://api.github.com/users/albertvillanova/followers", "following_url": "https://api.github.com/users/albertvillanova/following{/other_user}", "gists_url": "https://api.github.com/users/albertvillanova/gists{/gist_id}", "starred_url": "https://api.github.com/users/albertvillanova/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/albertvillanova/subscriptions", "organizations_url": "https://api.github.com/users/albertvillanova/orgs", "repos_url": "https://api.github.com/users/albertvillanova/repos", "events_url": "https://api.github.com/users/albertvillanova/events{/privacy}", "received_events_url": "https://api.github.com/users/albertvillanova/received_events", "type": "User", "site_admin": false } ]
null
[]
2023-09-27T08:12:05
2023-09-27T08:36:40
2023-09-27T08:36:40
MEMBER
null
null
null
Python 3.10 CI is broken for `test_py310`. See: https://github.com/huggingface/datasets/actions/runs/6322990957/job/17169678812?pr=6262 ``` FAILED tests/test_py_utils.py::TempSeedTest::test_tensorflow - ImportError: cannot import name 'context' from 'tensorflow.python' (/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/tensorflow/python/__init__.py) ``` ``` _________________________ TempSeedTest.test_tensorflow _________________________ [gw1] linux -- Python 3.10.13 /opt/hostedtoolcache/Python/3.10.13/x64/bin/python self = <tests.test_py_utils.TempSeedTest testMethod=test_tensorflow> @require_tf def test_tensorflow(self): import tensorflow as tf from tensorflow.keras import layers model = layers.Dense(2) def gen_random_output(): x = tf.random.uniform((1, 3)) return model(x).numpy() > with temp_seed(42, set_tensorflow=True): tests/test_py_utils.py:155: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/contextlib.py:135: in __enter__ return next(self.gen) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ seed = 42, set_pytorch = False, set_tensorflow = True @contextmanager def temp_seed(seed: int, set_pytorch=False, set_tensorflow=False): """Temporarily set the random seed. This works for python numpy, pytorch and tensorflow.""" np_state = np.random.get_state() np.random.seed(seed) if set_pytorch and config.TORCH_AVAILABLE: import torch torch_state = torch.random.get_rng_state() torch.random.manual_seed(seed) if torch.cuda.is_available(): torch_cuda_states = torch.cuda.get_rng_state_all() torch.cuda.manual_seed_all(seed) if set_tensorflow and config.TF_AVAILABLE: import tensorflow as tf > from tensorflow.python import context as tfpycontext E ImportError: cannot import name 'context' from 'tensorflow.python' (/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/tensorflow/python/__init__.py) /opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/datasets/utils/py_utils.py:257: ImportError ```
{ "url": "https://api.github.com/repos/huggingface/datasets/issues/6263/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 }
https://api.github.com/repos/huggingface/datasets/issues/6263/timeline
null
completed