html_url
stringlengths
51
51
comments
stringlengths
67
24.7k
title
stringlengths
6
280
body
stringlengths
51
36.2k
comment_length
int64
16
1.45k
text
stringlengths
190
38.3k
embeddings
sequence
https://github.com/huggingface/datasets/issues/5990
Apparently this happened because of bad modifications in the README.md split metadata. I fixed them in this PR: https://huggingface.co/datasets/Antreas/TALI-base/discussions/1
Pushing a large dataset on the hub consistently hangs
### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
19
Pushing a large dataset on the hub consistently hangs ### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` Apparently this happened because of bad modifications in the README.md split metadata. I fixed them in this PR: https://huggingface.co/datasets/Antreas/TALI-base/discussions/1
[ -0.3251087963581085, -0.42933112382888794, -0.06096188724040985, 0.08869528025388718, 0.21317243576049805, -0.06696006655693054, 0.1970674693584442, 0.5384528636932373, 0.05225852131843567, 0.3061686158180237, 0.08448541909456253, 0.10903309285640717, 0.03724048659205437, 0.22024406492710114, 0.14667896926403046, 0.2332618236541748, 0.25349166989326477, -0.10799236595630646, 0.27970409393310547, -0.06858120858669281, -0.06573061645030975, -0.15738080441951752, 0.10763393342494965, -0.10093242675065994, -0.7575782537460327, 0.04432877153158188, 0.22587668895721436, 0.2064542919397354, 0.1921502649784088, -0.16747573018074036, 0.20722517371177673, 0.25278791785240173, -0.16246680915355682, 0.6471035480499268, -0.00012341895489953458, -0.05790407583117485, 0.25191041827201843, 0.02304328978061676, -0.3664642572402954, 0.09019968658685684, -0.10475093126296997, -0.13000282645225525, -0.2037355899810791, 0.1003957986831665, 0.03635609894990921, 0.45928943157196045, -0.19047336280345917, -0.16487863659858704, 0.21318119764328003, -0.0651368647813797, 0.02760709449648857, 0.17410922050476074, 0.014200866222381592, -0.24395343661308289, 0.20720058679580688, 0.13026978075504303, -0.30730724334716797, -0.07190019637346268, 0.49071699380874634, 0.13820913434028625, -0.1179051548242569, -0.07936432957649231, -0.11190301179885864, -0.11168365180492401, 0.016268212348222733, -0.3535960912704468, -0.089785136282444, -0.3143678307533264, 0.34380003809928894, 0.24355612695217133, 0.14077115058898926, -0.08090770244598389, -0.2698417603969574, -0.07041946053504944, -0.11939385533332825, -0.1470957100391388, 0.28435736894607544, 0.16139265894889832, -0.2762324810028076, 0.0654551237821579, -0.13129226863384247, -0.4053599536418915, -0.12707537412643433, -0.03554612770676613, -0.14915555715560913, -0.03168031945824623, 0.1751161366701126, 0.08743235468864441, 0.2067568451166153, -0.05901416763663292, 0.3941405117511749, -0.2691796123981476, 0.0901857241988182, -0.2755673825740814, -0.41740137338638306, 0.13888457417488098, 0.08934485912322998, 0.07516989856958389, -0.042328789830207825, -0.12489776313304901, -0.22944197058677673, 0.44265317916870117, -0.19254255294799805, 0.07224048674106598, 0.27406084537506104, -0.1266958862543106, 0.035612236708402634, -0.06530951708555222, 0.3070811629295349, 0.14404165744781494, -0.2572271227836609, 0.09562107175588608, 0.004041291773319244, -0.11014997959136963, -0.013009496033191681, -0.025750624015927315, 0.0792459174990654, -0.22842007875442505, -0.3421907424926758, 0.2250162661075592, -0.16784855723381042, 0.2685824930667877, 0.20871514081954956, 0.24827389419078827, 0.08709130436182022, 0.3373471796512604, -0.27540260553359985, 0.022007297724485397, -0.23613813519477844, -0.19603271782398224, -0.18941564857959747, -0.13765454292297363, 0.22148294746875763, 0.33565178513526917, 0.19451121985912323, -0.3410741686820984, -0.24856320023536682, 0.07881910353899002, 0.49135810136795044, -0.1306176483631134, -0.20826470851898193, -0.13527116179466248, 0.12670336663722992, 0.4150709807872772, 0.11111826449632645, 0.425483763217926, -0.1380186229944229, -0.1203937754034996, -0.21549536287784576, 0.057632461190223694, -0.18095824122428894, -0.29855096340179443, 0.236887589097023, 0.09342896938323975, -0.14131808280944824, 0.012494992464780807, -0.19530931115150452, -0.20652753114700317, -0.10413315892219543, 0.3453899025917053, -0.04829101264476776, 0.07182597368955612, -0.05895145982503891, -0.009029572829604149, 0.16733375191688538, 0.3914467692375183, -0.46486231684684753, 0.2811201512813568, 0.06217803806066513, 0.4197710156440735, -0.2656343877315521, 0.31870418787002563, -0.07181254029273987, 0.1722499132156372, -0.11614037305116653, 0.008509308099746704, -0.244670569896698, -0.6641231179237366, -0.4377872347831726, 0.4218234121799469, -0.1620047390460968, 0.16865754127502441, 0.030979372560977936, 0.14459466934204102, 0.42355436086654663, -0.36917978525161743, 0.3288465142250061, 0.2769600749015808, -0.1284511536359787, 0.1686631292104721, -0.2560868263244629, -0.23015055060386658, -0.34304046630859375, 0.3827191889286041, 0.2105250358581543, -0.2159123718738556, 0.012101415544748306, 0.46206918358802795, 0.23962244391441345, 0.1523667424917221, 0.3582223951816559, 0.26409244537353516, 0.5892544388771057, -0.15352578461170197, -0.14096936583518982, -0.15002700686454773, -0.5206427574157715, 0.43066176772117615, 0.3863000273704529, -0.12492451071739197, -0.14289477467536926, -0.07865099608898163, -0.22074106335639954, 0.15172049403190613, -0.3061752915382385, 0.3593229055404663, -0.03207937255501747, -0.28083735704421997, -0.034529704600572586, 0.23081551492214203, 0.01316806674003601, 0.37530258297920227, -0.0534038171172142, 0.0001145191490650177, -0.08453143388032913, 0.589294970035553, 0.12691321969032288, -0.23005501925945282, 0.06565289199352264, 0.19912466406822205, 0.14771544933319092, -0.3349977135658264, -0.15287035703659058, 0.11965660005807877, 0.025633741170167923, 0.1757788360118866, 0.26884737610816956, 0.05140337347984314, 0.3028479516506195, -0.034123025834560394, 0.2301027476787567, 0.12599213421344757, -0.11914559453725815, -0.24972756206989288, -0.11160072684288025, 0.16405045986175537, -0.018670421093702316, 0.24425914883613586, -0.1308334469795227, 0.018514275550842285, 0.13719388842582703, -0.09259036928415298, 0.0758800134062767, 0.10112706571817398, 0.31888532638549805, -0.04317906126379967, 0.07725636661052704, -0.03980230540037155, 0.09870178997516632, 0.46279701590538025, 0.6134483218193054, 0.012248978018760681, -0.41306638717651367, 0.1094224750995636, -0.009646803140640259, 0.06047262251377106, 0.05362584441900253, 0.025167375802993774, -0.07241889834403992, 0.010686881840229034, -0.0824461579322815, -0.30172306299209595, -0.14531058073043823, -0.3921554684638977, -0.07417018711566925, 0.2588631510734558, 0.0007041282951831818, 0.1754174530506134, 0.08643867075443268, -0.12469619512557983, -0.139383465051651, -0.22530192136764526, 0.23488369584083557, 0.267243355512619, -0.07326918840408325, 0.01306074857711792, -0.25176653265953064, 0.19057311117649078, 0.11472766101360321, -0.3452693521976471, -0.4584461748600006, -0.5935556888580322, 0.03924757242202759, 0.41381070017814636, -0.005098491907119751, 0.15742459893226624, 0.22899895906448364, 0.227858304977417, 0.19770047068595886, -0.22055822610855103, -0.420364111661911, -0.2874385714530945, -0.06433404982089996, -0.10546663403511047, 0.6536206007003784, 0.11534883826971054, 0.1595478355884552, 0.24570858478546143, -0.060959890484809875, -0.41670650243759155, 0.036050885915756226, 0.014210517518222332, -0.1369485855102539, 0.2540033757686615, -0.3656550347805023, 0.25909745693206787, 0.044579774141311646, -0.0024777650833129883, 0.17514558136463165, -0.22877919673919678, 0.0010563060641288757, 0.2825095057487488, -0.023783313110470772, -0.23724283277988434, 0.030204840004444122, 0.19706696271896362, -0.03649286925792694, -0.5179988741874695, 0.1423984169960022, -0.1319684237241745, 0.01018792949616909, -0.03397040814161301, 0.25232237577438354, -0.07725120335817337, 0.13748645782470703, -0.5111334919929504, 0.10514205694198608, -0.4406029284000397, 0.15532219409942627, -0.03851146996021271, -0.2520192861557007, 0.038356222212314606, 0.1205354630947113, -0.09105511009693146, 0.15005257725715637, -0.6417413353919983, 0.056516218930482864, -0.4287385940551758, 0.3723188042640686, -0.027623241767287254, -0.19984112679958344, -0.044800642877817154, -0.11843064427375793, 0.021422982215881348, 0.08745451271533966, -0.0635109394788742, 0.11660970002412796, 0.44347894191741943, -0.14121459424495697, -0.03429589420557022, 0.23535628616809845, 0.19166912138462067, 0.2653641700744629, 0.23575785756111145, -0.14393195509910583, 0.27466556429862976, 0.31208908557891846, 0.2016386240720749, -0.3055754005908966, -0.20440888404846191, 0.1741175502538681, -0.07299759984016418, -0.27569931745529175, 0.0135960653424263, 0.004383929073810577, 0.3032492399215698, -0.05015849694609642, -0.13071033358573914, 0.22629301249980927, -0.5607283115386963, 0.02306339330971241, -0.21239283680915833, 0.03483888506889343, 0.0065180957317352295, -0.03357160836458206, -0.11715450882911682, -0.40232446789741516, 0.2563615143299103, -0.07678636908531189, 0.16888119280338287, -0.04085487127304077, 0.04937058687210083, 0.20073705911636353, -0.5037559270858765, 0.05050276964902878, -0.07239267230033875, 0.3635871410369873, -0.1539391577243805, 0.01953607052564621, 0.23668713867664337, -0.2818394899368286, 0.6828809380531311, -0.30027705430984497, 0.3237898051738739, -0.10701091587543488, 0.018488794565200806, -0.3644412159919739, -0.1723620593547821, -0.08260313421487808, 0.230376735329628, 0.002069476991891861, 0.7693324685096741, -0.08069546520709991, -0.3536863327026367, -0.19044020771980286, 0.1617283672094345, -0.23571264743804932, -0.22333142161369324, -0.16530045866966248, -0.2613714337348938, -0.3035412132740021, 0.22521772980690002, 0.10040123015642166, 0.15587183833122253, -0.2812294065952301, -0.3021184206008911, 0.026003604754805565, -0.0011469647288322449, 0.08619536459445953, -0.16672855615615845, -0.026849646121263504, 0.0362161323428154, 0.6639813184738159, -0.3151652216911316, 0.003426592331379652, 0.25937315821647644, 0.363582581281662, 0.2772989571094513, 0.13558177649974823, 0.1684017777442932, -0.07802929729223251, 0.16677631437778473, 0.8263382911682129, 0.1594078093767166, 0.23823609948158264, -0.2188805639743805, 0.33667007088661194, -0.4187341332435608, 0.003567427396774292, 0.19658835232257843, -0.09242197871208191, -0.16093581914901733, 0.24352499842643738, 0.41675865650177, -0.09666501730680466, 0.10659737884998322, 0.1142304539680481, 0.3840652108192444, 0.1764860451221466, 0.20738890767097473, 0.13277371227741241, 0.9799233675003052, -0.3102877736091614, 0.16982372105121613, -0.04234737157821655, -0.0031089261174201965, -0.04354431852698326, -0.6333492994308472, -0.11661183834075928, -0.20017999410629272, -0.3024233281612396, 0.11174935102462769, 0.08568943291902542, -0.10316911339759827, 0.055813271552324295, -0.09285952150821686, 0.0855586901307106, -0.19770905375480652, 0.41906434297561646, -0.19767966866493225, 0.2439996302127838, -0.32617297768592834, -0.4959625005722046, -0.15647678077220917, 0.16487178206443787, 0.031437039375305176, -0.04853859543800354, -0.059421706944704056, 0.011713005602359772, -0.13057313859462738, 0.18725842237472534, -0.31405773758888245, 0.021645426750183105, 0.31231430172920227, -0.02313263900578022, -0.14394286274909973, -0.14292877912521362, 0.05420947074890137, -0.5641478300094604, 0.30512750148773193, 0.23124092817306519, -0.17710986733436584, 0.3257598876953125, -0.15534146130084991, 0.021448682993650436, 0.17042016983032227, -0.1134125217795372, 0.26708027720451355, 0.07743698358535767, -0.11875835806131363, 0.16013307869434357, 0.16236057877540588, -0.19428834319114685, -0.09682602435350418, -0.015537142753601074, -0.015437187626957893, -0.01255611702799797, -0.06439370661973953, 0.093236543238163, -0.10974498838186264, -0.16716268658638, 0.05558819696307182, 0.05979766696691513, -0.1893545538187027, 0.3783528208732605, -0.09678718447685242, -0.15456964075565338, -0.008890262804925442, 0.3713226616382599, -0.32756173610687256, -0.19321994483470917, 0.09207242727279663, 0.31886476278305054, -0.18478575348854065, -0.20151659846305847, 0.3515964150428772, -0.012421196326613426, -0.5109376907348633, 0.2792467772960663, -0.35034340620040894, -0.01118190586566925, 0.16701765358448029, 0.016943996772170067, -0.006683635991066694, -0.19413642585277557, -0.16645605862140656, -0.09571659564971924, -0.14830030500888824, -0.05033358186483383, 0.10745757818222046, 0.2067873179912567, -0.4769432544708252, 0.09458194673061371, -0.021793771535158157, 0.40373659133911133, -0.19476406276226044, 0.16495415568351746, -0.3420085608959198, 0.23262569308280945, -0.29311177134513855, -0.45957010984420776, 0.037413790822029114, -0.2678847014904022, -0.045747481286525726, 0.09241914004087448, -0.1529419869184494, -0.12227412313222885, -0.23628827929496765, 0.19033539295196533, 0.189319908618927, 0.17391738295555115, -0.16682016849517822, -0.34320151805877686, 0.17436756193637848, -0.17570532858371735, 0.18915046751499176, 0.1338556706905365, -0.0990087017416954, -0.2690891921520233, 0.7326576113700867, 0.19018957018852234, -0.024524956941604614, 0.44166213274002075, 0.46100103855133057, 0.5311329960823059, -0.028858959674835205, 0.03738952428102493, 0.05452367290854454, 0.04260316491127014, -0.28762519359588623, 0.3660692274570465, 0.28036263585090637, 0.04939091578125954, 0.39158010482788086, -0.2303597778081894, 0.1374913603067398, 0.08632475137710571, 0.37588220834732056, 0.49084779620170593, -0.035772256553173065, -0.49716076254844666, 0.24364681541919708, 0.09298495948314667, 0.10267966985702515, -0.24107787013053894, 0.2818644344806671, -0.05562826991081238, -0.03644116222858429, 0.20599883794784546, 0.18303625285625458, -0.29970067739486694, -0.010596934705972672, 0.3796977996826172, 0.5373080372810364, -0.1991109848022461, -0.3758561313152313, -0.0419774167239666, 0.12178318202495575, -0.009604385122656822, 0.024430690333247185, -0.11847929656505585, 0.21105073392391205, 0.8026148080825806, 0.06376732885837555, 0.1803985834121704, 0.1867927610874176, -0.07245159149169922, 0.18699227273464203, -0.12172377109527588, -0.3046778440475464, 0.10303465276956558, -0.15545590221881866, -0.04155028238892555, 0.07164712250232697, 0.21780909597873688, -0.18861845135688782, -0.1876366287469864, -0.4336097240447998, 0.06782592833042145, -0.14034484326839447, 0.23643556237220764, 0.07064389437437057, 0.011292919516563416, -0.40676021575927734, 0.23104017972946167, -0.06329773366451263, 0.22097136080265045, 0.4582326114177704, 0.5591541528701782, 0.21365556120872498, 0.24056142568588257, -0.21015866100788116, -0.06845530867576599, 0.22913074493408203, -0.18099212646484375, 0.09044861048460007, 0.4119534194469452, -0.2922443151473999, -0.23383483290672302, -0.24112413823604584, 0.22108159959316254, 0.19341081380844116, -0.45813703536987305, 0.43371787667274475, 0.3062591850757599, 0.06670287996530533, 0.0987987220287323, 0.18956217169761658, -0.18546995520591736, 0.20504236221313477, 0.1533985584974289, 0.031063273549079895, -0.0819806158542633, -0.3525286018848419, -0.030681375414133072, 0.3223510682582855, -0.05932959169149399, 0.42182379961013794, 0.11201243102550507, -0.17466874420642853, -0.21328380703926086, -0.058081768453121185, -0.22172901034355164, -0.09328427910804749, 0.26636549830436707, -0.5355953574180603, 0.07447651028633118, -0.1866752654314041, 0.02572821080684662, -0.4233056902885437, 0.6617635488510132, 0.24154812097549438, 0.07221417129039764, -0.35519134998321533, -0.29439595341682434, -0.23527970910072327, 0.2907281517982483, -0.4481869339942932, -0.014662988483905792, 0.06173192709684372, 0.4491553008556366, 0.06895572692155838, 0.025518983602523804, -0.2532501816749573, -0.25601741671562195, -0.12963348627090454, 0.28376272320747375, -0.13120701909065247, 0.06262820959091187, 0.12757046520709991, 0.015935787931084633, -0.14396265149116516, -0.4498974680900574, 0.3557792901992798, 0.10339139401912689, -0.036318931728601456, 0.08136772364377975, -0.23051905632019043, 0.4120981991291046, -0.2536555528640747, 0.02452188730239868, -0.18090640008449554, 0.012954097241163254, 0.0780438557267189, -0.27691221237182617, -0.3581109642982483, -0.106882244348526, 0.034435685724020004, -0.29862281680107117, -0.1686069518327713, 0.10910940170288086, 0.020840056240558624, 0.03685014694929123, -0.1390921026468277, 0.1992226094007492, -0.08289027959108353, 0.38733887672424316, 0.08963944017887115, -0.18663540482521057, -0.26398766040802, 0.3944457173347473, 0.28055137395858765, 0.23066475987434387, 0.1072213351726532, 0.3361835479736328, -0.43927863240242004, -0.1555042266845703, 0.3613762855529785, 0.2324036955833435, -0.4046543836593628, 0.006576307117938995, 0.25290530920028687, -0.18358075618743896, -0.02321651205420494, -0.13050611317157745, -0.12933382391929626, -0.013140063732862473, -0.005518182180821896, -0.12338262796401978, 0.33634501695632935, 0.07808706164360046, -0.08841875195503235, -0.07756863534450531, 0.000375114381313324, 0.07786931842565536, 0.020994901657104492, 0.12060888111591339, 0.1628909409046173 ]
https://github.com/huggingface/datasets/issues/5990
@lhoestq It's a bit odd that when uploading a dataset, one set at a time "train", "val", "test", the push_to_hub function overwrites the readme and removes differently named sets from previous commits. i.e., you push "val", all is well. Then you push "test", and the "val" entry disappears from the readme, while the data remain intact.
Pushing a large dataset on the hub consistently hangs
### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
56
Pushing a large dataset on the hub consistently hangs ### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` @lhoestq It's a bit odd that when uploading a dataset, one set at a time "train", "val", "test", the push_to_hub function overwrites the readme and removes differently named sets from previous commits. i.e., you push "val", all is well. Then you push "test", and the "val" entry disappears from the readme, while the data remain intact.
[ -0.3251087963581085, -0.42933112382888794, -0.06096188724040985, 0.08869528025388718, 0.21317243576049805, -0.06696006655693054, 0.1970674693584442, 0.5384528636932373, 0.05225852131843567, 0.3061686158180237, 0.08448541909456253, 0.10903309285640717, 0.03724048659205437, 0.22024406492710114, 0.14667896926403046, 0.2332618236541748, 0.25349166989326477, -0.10799236595630646, 0.27970409393310547, -0.06858120858669281, -0.06573061645030975, -0.15738080441951752, 0.10763393342494965, -0.10093242675065994, -0.7575782537460327, 0.04432877153158188, 0.22587668895721436, 0.2064542919397354, 0.1921502649784088, -0.16747573018074036, 0.20722517371177673, 0.25278791785240173, -0.16246680915355682, 0.6471035480499268, -0.00012341895489953458, -0.05790407583117485, 0.25191041827201843, 0.02304328978061676, -0.3664642572402954, 0.09019968658685684, -0.10475093126296997, -0.13000282645225525, -0.2037355899810791, 0.1003957986831665, 0.03635609894990921, 0.45928943157196045, -0.19047336280345917, -0.16487863659858704, 0.21318119764328003, -0.0651368647813797, 0.02760709449648857, 0.17410922050476074, 0.014200866222381592, -0.24395343661308289, 0.20720058679580688, 0.13026978075504303, -0.30730724334716797, -0.07190019637346268, 0.49071699380874634, 0.13820913434028625, -0.1179051548242569, -0.07936432957649231, -0.11190301179885864, -0.11168365180492401, 0.016268212348222733, -0.3535960912704468, -0.089785136282444, -0.3143678307533264, 0.34380003809928894, 0.24355612695217133, 0.14077115058898926, -0.08090770244598389, -0.2698417603969574, -0.07041946053504944, -0.11939385533332825, -0.1470957100391388, 0.28435736894607544, 0.16139265894889832, -0.2762324810028076, 0.0654551237821579, -0.13129226863384247, -0.4053599536418915, -0.12707537412643433, -0.03554612770676613, -0.14915555715560913, -0.03168031945824623, 0.1751161366701126, 0.08743235468864441, 0.2067568451166153, -0.05901416763663292, 0.3941405117511749, -0.2691796123981476, 0.0901857241988182, -0.2755673825740814, -0.41740137338638306, 0.13888457417488098, 0.08934485912322998, 0.07516989856958389, -0.042328789830207825, -0.12489776313304901, -0.22944197058677673, 0.44265317916870117, -0.19254255294799805, 0.07224048674106598, 0.27406084537506104, -0.1266958862543106, 0.035612236708402634, -0.06530951708555222, 0.3070811629295349, 0.14404165744781494, -0.2572271227836609, 0.09562107175588608, 0.004041291773319244, -0.11014997959136963, -0.013009496033191681, -0.025750624015927315, 0.0792459174990654, -0.22842007875442505, -0.3421907424926758, 0.2250162661075592, -0.16784855723381042, 0.2685824930667877, 0.20871514081954956, 0.24827389419078827, 0.08709130436182022, 0.3373471796512604, -0.27540260553359985, 0.022007297724485397, -0.23613813519477844, -0.19603271782398224, -0.18941564857959747, -0.13765454292297363, 0.22148294746875763, 0.33565178513526917, 0.19451121985912323, -0.3410741686820984, -0.24856320023536682, 0.07881910353899002, 0.49135810136795044, -0.1306176483631134, -0.20826470851898193, -0.13527116179466248, 0.12670336663722992, 0.4150709807872772, 0.11111826449632645, 0.425483763217926, -0.1380186229944229, -0.1203937754034996, -0.21549536287784576, 0.057632461190223694, -0.18095824122428894, -0.29855096340179443, 0.236887589097023, 0.09342896938323975, -0.14131808280944824, 0.012494992464780807, -0.19530931115150452, -0.20652753114700317, -0.10413315892219543, 0.3453899025917053, -0.04829101264476776, 0.07182597368955612, -0.05895145982503891, -0.009029572829604149, 0.16733375191688538, 0.3914467692375183, -0.46486231684684753, 0.2811201512813568, 0.06217803806066513, 0.4197710156440735, -0.2656343877315521, 0.31870418787002563, -0.07181254029273987, 0.1722499132156372, -0.11614037305116653, 0.008509308099746704, -0.244670569896698, -0.6641231179237366, -0.4377872347831726, 0.4218234121799469, -0.1620047390460968, 0.16865754127502441, 0.030979372560977936, 0.14459466934204102, 0.42355436086654663, -0.36917978525161743, 0.3288465142250061, 0.2769600749015808, -0.1284511536359787, 0.1686631292104721, -0.2560868263244629, -0.23015055060386658, -0.34304046630859375, 0.3827191889286041, 0.2105250358581543, -0.2159123718738556, 0.012101415544748306, 0.46206918358802795, 0.23962244391441345, 0.1523667424917221, 0.3582223951816559, 0.26409244537353516, 0.5892544388771057, -0.15352578461170197, -0.14096936583518982, -0.15002700686454773, -0.5206427574157715, 0.43066176772117615, 0.3863000273704529, -0.12492451071739197, -0.14289477467536926, -0.07865099608898163, -0.22074106335639954, 0.15172049403190613, -0.3061752915382385, 0.3593229055404663, -0.03207937255501747, -0.28083735704421997, -0.034529704600572586, 0.23081551492214203, 0.01316806674003601, 0.37530258297920227, -0.0534038171172142, 0.0001145191490650177, -0.08453143388032913, 0.589294970035553, 0.12691321969032288, -0.23005501925945282, 0.06565289199352264, 0.19912466406822205, 0.14771544933319092, -0.3349977135658264, -0.15287035703659058, 0.11965660005807877, 0.025633741170167923, 0.1757788360118866, 0.26884737610816956, 0.05140337347984314, 0.3028479516506195, -0.034123025834560394, 0.2301027476787567, 0.12599213421344757, -0.11914559453725815, -0.24972756206989288, -0.11160072684288025, 0.16405045986175537, -0.018670421093702316, 0.24425914883613586, -0.1308334469795227, 0.018514275550842285, 0.13719388842582703, -0.09259036928415298, 0.0758800134062767, 0.10112706571817398, 0.31888532638549805, -0.04317906126379967, 0.07725636661052704, -0.03980230540037155, 0.09870178997516632, 0.46279701590538025, 0.6134483218193054, 0.012248978018760681, -0.41306638717651367, 0.1094224750995636, -0.009646803140640259, 0.06047262251377106, 0.05362584441900253, 0.025167375802993774, -0.07241889834403992, 0.010686881840229034, -0.0824461579322815, -0.30172306299209595, -0.14531058073043823, -0.3921554684638977, -0.07417018711566925, 0.2588631510734558, 0.0007041282951831818, 0.1754174530506134, 0.08643867075443268, -0.12469619512557983, -0.139383465051651, -0.22530192136764526, 0.23488369584083557, 0.267243355512619, -0.07326918840408325, 0.01306074857711792, -0.25176653265953064, 0.19057311117649078, 0.11472766101360321, -0.3452693521976471, -0.4584461748600006, -0.5935556888580322, 0.03924757242202759, 0.41381070017814636, -0.005098491907119751, 0.15742459893226624, 0.22899895906448364, 0.227858304977417, 0.19770047068595886, -0.22055822610855103, -0.420364111661911, -0.2874385714530945, -0.06433404982089996, -0.10546663403511047, 0.6536206007003784, 0.11534883826971054, 0.1595478355884552, 0.24570858478546143, -0.060959890484809875, -0.41670650243759155, 0.036050885915756226, 0.014210517518222332, -0.1369485855102539, 0.2540033757686615, -0.3656550347805023, 0.25909745693206787, 0.044579774141311646, -0.0024777650833129883, 0.17514558136463165, -0.22877919673919678, 0.0010563060641288757, 0.2825095057487488, -0.023783313110470772, -0.23724283277988434, 0.030204840004444122, 0.19706696271896362, -0.03649286925792694, -0.5179988741874695, 0.1423984169960022, -0.1319684237241745, 0.01018792949616909, -0.03397040814161301, 0.25232237577438354, -0.07725120335817337, 0.13748645782470703, -0.5111334919929504, 0.10514205694198608, -0.4406029284000397, 0.15532219409942627, -0.03851146996021271, -0.2520192861557007, 0.038356222212314606, 0.1205354630947113, -0.09105511009693146, 0.15005257725715637, -0.6417413353919983, 0.056516218930482864, -0.4287385940551758, 0.3723188042640686, -0.027623241767287254, -0.19984112679958344, -0.044800642877817154, -0.11843064427375793, 0.021422982215881348, 0.08745451271533966, -0.0635109394788742, 0.11660970002412796, 0.44347894191741943, -0.14121459424495697, -0.03429589420557022, 0.23535628616809845, 0.19166912138462067, 0.2653641700744629, 0.23575785756111145, -0.14393195509910583, 0.27466556429862976, 0.31208908557891846, 0.2016386240720749, -0.3055754005908966, -0.20440888404846191, 0.1741175502538681, -0.07299759984016418, -0.27569931745529175, 0.0135960653424263, 0.004383929073810577, 0.3032492399215698, -0.05015849694609642, -0.13071033358573914, 0.22629301249980927, -0.5607283115386963, 0.02306339330971241, -0.21239283680915833, 0.03483888506889343, 0.0065180957317352295, -0.03357160836458206, -0.11715450882911682, -0.40232446789741516, 0.2563615143299103, -0.07678636908531189, 0.16888119280338287, -0.04085487127304077, 0.04937058687210083, 0.20073705911636353, -0.5037559270858765, 0.05050276964902878, -0.07239267230033875, 0.3635871410369873, -0.1539391577243805, 0.01953607052564621, 0.23668713867664337, -0.2818394899368286, 0.6828809380531311, -0.30027705430984497, 0.3237898051738739, -0.10701091587543488, 0.018488794565200806, -0.3644412159919739, -0.1723620593547821, -0.08260313421487808, 0.230376735329628, 0.002069476991891861, 0.7693324685096741, -0.08069546520709991, -0.3536863327026367, -0.19044020771980286, 0.1617283672094345, -0.23571264743804932, -0.22333142161369324, -0.16530045866966248, -0.2613714337348938, -0.3035412132740021, 0.22521772980690002, 0.10040123015642166, 0.15587183833122253, -0.2812294065952301, -0.3021184206008911, 0.026003604754805565, -0.0011469647288322449, 0.08619536459445953, -0.16672855615615845, -0.026849646121263504, 0.0362161323428154, 0.6639813184738159, -0.3151652216911316, 0.003426592331379652, 0.25937315821647644, 0.363582581281662, 0.2772989571094513, 0.13558177649974823, 0.1684017777442932, -0.07802929729223251, 0.16677631437778473, 0.8263382911682129, 0.1594078093767166, 0.23823609948158264, -0.2188805639743805, 0.33667007088661194, -0.4187341332435608, 0.003567427396774292, 0.19658835232257843, -0.09242197871208191, -0.16093581914901733, 0.24352499842643738, 0.41675865650177, -0.09666501730680466, 0.10659737884998322, 0.1142304539680481, 0.3840652108192444, 0.1764860451221466, 0.20738890767097473, 0.13277371227741241, 0.9799233675003052, -0.3102877736091614, 0.16982372105121613, -0.04234737157821655, -0.0031089261174201965, -0.04354431852698326, -0.6333492994308472, -0.11661183834075928, -0.20017999410629272, -0.3024233281612396, 0.11174935102462769, 0.08568943291902542, -0.10316911339759827, 0.055813271552324295, -0.09285952150821686, 0.0855586901307106, -0.19770905375480652, 0.41906434297561646, -0.19767966866493225, 0.2439996302127838, -0.32617297768592834, -0.4959625005722046, -0.15647678077220917, 0.16487178206443787, 0.031437039375305176, -0.04853859543800354, -0.059421706944704056, 0.011713005602359772, -0.13057313859462738, 0.18725842237472534, -0.31405773758888245, 0.021645426750183105, 0.31231430172920227, -0.02313263900578022, -0.14394286274909973, -0.14292877912521362, 0.05420947074890137, -0.5641478300094604, 0.30512750148773193, 0.23124092817306519, -0.17710986733436584, 0.3257598876953125, -0.15534146130084991, 0.021448682993650436, 0.17042016983032227, -0.1134125217795372, 0.26708027720451355, 0.07743698358535767, -0.11875835806131363, 0.16013307869434357, 0.16236057877540588, -0.19428834319114685, -0.09682602435350418, -0.015537142753601074, -0.015437187626957893, -0.01255611702799797, -0.06439370661973953, 0.093236543238163, -0.10974498838186264, -0.16716268658638, 0.05558819696307182, 0.05979766696691513, -0.1893545538187027, 0.3783528208732605, -0.09678718447685242, -0.15456964075565338, -0.008890262804925442, 0.3713226616382599, -0.32756173610687256, -0.19321994483470917, 0.09207242727279663, 0.31886476278305054, -0.18478575348854065, -0.20151659846305847, 0.3515964150428772, -0.012421196326613426, -0.5109376907348633, 0.2792467772960663, -0.35034340620040894, -0.01118190586566925, 0.16701765358448029, 0.016943996772170067, -0.006683635991066694, -0.19413642585277557, -0.16645605862140656, -0.09571659564971924, -0.14830030500888824, -0.05033358186483383, 0.10745757818222046, 0.2067873179912567, -0.4769432544708252, 0.09458194673061371, -0.021793771535158157, 0.40373659133911133, -0.19476406276226044, 0.16495415568351746, -0.3420085608959198, 0.23262569308280945, -0.29311177134513855, -0.45957010984420776, 0.037413790822029114, -0.2678847014904022, -0.045747481286525726, 0.09241914004087448, -0.1529419869184494, -0.12227412313222885, -0.23628827929496765, 0.19033539295196533, 0.189319908618927, 0.17391738295555115, -0.16682016849517822, -0.34320151805877686, 0.17436756193637848, -0.17570532858371735, 0.18915046751499176, 0.1338556706905365, -0.0990087017416954, -0.2690891921520233, 0.7326576113700867, 0.19018957018852234, -0.024524956941604614, 0.44166213274002075, 0.46100103855133057, 0.5311329960823059, -0.028858959674835205, 0.03738952428102493, 0.05452367290854454, 0.04260316491127014, -0.28762519359588623, 0.3660692274570465, 0.28036263585090637, 0.04939091578125954, 0.39158010482788086, -0.2303597778081894, 0.1374913603067398, 0.08632475137710571, 0.37588220834732056, 0.49084779620170593, -0.035772256553173065, -0.49716076254844666, 0.24364681541919708, 0.09298495948314667, 0.10267966985702515, -0.24107787013053894, 0.2818644344806671, -0.05562826991081238, -0.03644116222858429, 0.20599883794784546, 0.18303625285625458, -0.29970067739486694, -0.010596934705972672, 0.3796977996826172, 0.5373080372810364, -0.1991109848022461, -0.3758561313152313, -0.0419774167239666, 0.12178318202495575, -0.009604385122656822, 0.024430690333247185, -0.11847929656505585, 0.21105073392391205, 0.8026148080825806, 0.06376732885837555, 0.1803985834121704, 0.1867927610874176, -0.07245159149169922, 0.18699227273464203, -0.12172377109527588, -0.3046778440475464, 0.10303465276956558, -0.15545590221881866, -0.04155028238892555, 0.07164712250232697, 0.21780909597873688, -0.18861845135688782, -0.1876366287469864, -0.4336097240447998, 0.06782592833042145, -0.14034484326839447, 0.23643556237220764, 0.07064389437437057, 0.011292919516563416, -0.40676021575927734, 0.23104017972946167, -0.06329773366451263, 0.22097136080265045, 0.4582326114177704, 0.5591541528701782, 0.21365556120872498, 0.24056142568588257, -0.21015866100788116, -0.06845530867576599, 0.22913074493408203, -0.18099212646484375, 0.09044861048460007, 0.4119534194469452, -0.2922443151473999, -0.23383483290672302, -0.24112413823604584, 0.22108159959316254, 0.19341081380844116, -0.45813703536987305, 0.43371787667274475, 0.3062591850757599, 0.06670287996530533, 0.0987987220287323, 0.18956217169761658, -0.18546995520591736, 0.20504236221313477, 0.1533985584974289, 0.031063273549079895, -0.0819806158542633, -0.3525286018848419, -0.030681375414133072, 0.3223510682582855, -0.05932959169149399, 0.42182379961013794, 0.11201243102550507, -0.17466874420642853, -0.21328380703926086, -0.058081768453121185, -0.22172901034355164, -0.09328427910804749, 0.26636549830436707, -0.5355953574180603, 0.07447651028633118, -0.1866752654314041, 0.02572821080684662, -0.4233056902885437, 0.6617635488510132, 0.24154812097549438, 0.07221417129039764, -0.35519134998321533, -0.29439595341682434, -0.23527970910072327, 0.2907281517982483, -0.4481869339942932, -0.014662988483905792, 0.06173192709684372, 0.4491553008556366, 0.06895572692155838, 0.025518983602523804, -0.2532501816749573, -0.25601741671562195, -0.12963348627090454, 0.28376272320747375, -0.13120701909065247, 0.06262820959091187, 0.12757046520709991, 0.015935787931084633, -0.14396265149116516, -0.4498974680900574, 0.3557792901992798, 0.10339139401912689, -0.036318931728601456, 0.08136772364377975, -0.23051905632019043, 0.4120981991291046, -0.2536555528640747, 0.02452188730239868, -0.18090640008449554, 0.012954097241163254, 0.0780438557267189, -0.27691221237182617, -0.3581109642982483, -0.106882244348526, 0.034435685724020004, -0.29862281680107117, -0.1686069518327713, 0.10910940170288086, 0.020840056240558624, 0.03685014694929123, -0.1390921026468277, 0.1992226094007492, -0.08289027959108353, 0.38733887672424316, 0.08963944017887115, -0.18663540482521057, -0.26398766040802, 0.3944457173347473, 0.28055137395858765, 0.23066475987434387, 0.1072213351726532, 0.3361835479736328, -0.43927863240242004, -0.1555042266845703, 0.3613762855529785, 0.2324036955833435, -0.4046543836593628, 0.006576307117938995, 0.25290530920028687, -0.18358075618743896, -0.02321651205420494, -0.13050611317157745, -0.12933382391929626, -0.013140063732862473, -0.005518182180821896, -0.12338262796401978, 0.33634501695632935, 0.07808706164360046, -0.08841875195503235, -0.07756863534450531, 0.000375114381313324, 0.07786931842565536, 0.020994901657104492, 0.12060888111591339, 0.1628909409046173 ]
https://github.com/huggingface/datasets/issues/5990
Also, just found another related issue. One of the many that make things hang or fail when pushing to hub. In the following code: ```python train_generator = lambda: data_generator("train", percentage=1.0) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) print(f"Pushing TALI-large to hub") dataset = datasets.DatasetDict( {"train": train_data, "val": val_data, "test": test_data} ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-large", max_shard_size="2GB") succesful_competion = True except Exception as e: print(e) ``` Things keep failing in the push_to_repo step, at random places, with the following error: ```bash Pushing dataset shards to the dataset hub: 7%|██████████▋ | 67/950 [42:41<9:22:37, 38.23s/it] Error while uploading 'data/train-00067-of-00950-a4d179ed5a593486.parquet' to the Hub. Pushing split train to the Hub. Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:01<00:00, 1.81ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:11<00:00, 11.20s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.48ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:15<00:00, 15.30s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.39ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:11<00:00, 11.52s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.47ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:10<00:00, 10.39s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.26ba/s] Upload 1 LFS files: 0%| | 0/1 [16:38<?, ?it/s] Pushing dataset shards to the dataset hub: 7%|███████████▎ | 71/950 [44:37<9:12:28, 37.71s/it] Error while uploading 'data/train-00071-of-00950-72bab6e5cb223aee.parquet' to the Hub. Pushing split train to the Hub. Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.18ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:10<00:00, 10.94s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.36ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:10<00:00, 10.67s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.57ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:10<00:00, 10.16s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.68ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:09<00:00, 9.63s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.36ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:10<00:00, 10.67s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.37ba/s] Upload 1 LFS files: 0%| | 0/1 [16:39<?, ?it/s] Pushing dataset shards to the dataset hub: 8%|████████████ | 76/950 [46:21<8:53:08, 36.60s/it] Error while uploading 'data/train-00076-of-00950-b90e4e3b433db179.parquet' to the Hub. Pushing split train to the Hub. Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.21ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:25<00:00, 25.40s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:01<00:00, 1.56ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:10<00:00, 10.40s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.49ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.53s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.27ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:10<00:00, 10.25s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.42ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:11<00:00, 11.03s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.39ba/s] Upload 1 LFS files: 0%| | 0/1 [16:39<?, ?it/s] Pushing dataset shards to the dataset hub: 9%|████████████▊ | 81/950 [48:30<8:40:22, 35.93s/it] Error while uploading 'data/train-00081-of-00950-84b0450a1df093a9.parquet' to the Hub. Pushing split train to the Hub. Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.18ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:11<00:00, 11.65s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:01<00:00, 1.92ba/s] Upload 1 LFS files: 0%| | 0/1 [16:38<?, ?it/s] Pushing dataset shards to the dataset hub: 9%|█████████████ | 82/950 [48:55<8:37:57, 35.80s/it] Error while uploading 'data/train-00082-of-00950-0a1f52da35653e08.parquet' to the Hub. Pushing split train to the Hub. Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.31ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:26<00:00, 26.29s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.42ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:10<00:00, 10.57s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.64ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:10<00:00, 10.35s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.64ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:11<00:00, 11.74s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.31ba/s] Upload 1 LFS files: 0%| | 0/1 [16:40<?, ?it/s] Pushing dataset shards to the dataset hub: 9%|█████████████▋ | 86/950 [50:48<8:30:25, 35.45s/it] Error while uploading 'data/train-00086-of-00950-e1cc80dd17191b20.parquet' to the Hub. ``` I have a while loop that forces retries, but it seems that the progress itself is randomly getting lost as well. Any ideas on how to improve this? It has been blocking me for way too long. Should I build the parquet manually and then push manually as well? If I do things manually, how can I ensure my dataset works properly with "stream=True"? Thank you for your help and time.
Pushing a large dataset on the hub consistently hangs
### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
738
Pushing a large dataset on the hub consistently hangs ### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` Also, just found another related issue. One of the many that make things hang or fail when pushing to hub. In the following code: ```python train_generator = lambda: data_generator("train", percentage=1.0) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) print(f"Pushing TALI-large to hub") dataset = datasets.DatasetDict( {"train": train_data, "val": val_data, "test": test_data} ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-large", max_shard_size="2GB") succesful_competion = True except Exception as e: print(e) ``` Things keep failing in the push_to_repo step, at random places, with the following error: ```bash Pushing dataset shards to the dataset hub: 7%|██████████▋ | 67/950 [42:41<9:22:37, 38.23s/it] Error while uploading 'data/train-00067-of-00950-a4d179ed5a593486.parquet' to the Hub. Pushing split train to the Hub. Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:01<00:00, 1.81ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:11<00:00, 11.20s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.48ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:15<00:00, 15.30s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.39ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:11<00:00, 11.52s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.47ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:10<00:00, 10.39s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.26ba/s] Upload 1 LFS files: 0%| | 0/1 [16:38<?, ?it/s] Pushing dataset shards to the dataset hub: 7%|███████████▎ | 71/950 [44:37<9:12:28, 37.71s/it] Error while uploading 'data/train-00071-of-00950-72bab6e5cb223aee.parquet' to the Hub. Pushing split train to the Hub. Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.18ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:10<00:00, 10.94s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.36ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:10<00:00, 10.67s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.57ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:10<00:00, 10.16s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.68ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:09<00:00, 9.63s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.36ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:10<00:00, 10.67s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.37ba/s] Upload 1 LFS files: 0%| | 0/1 [16:39<?, ?it/s] Pushing dataset shards to the dataset hub: 8%|████████████ | 76/950 [46:21<8:53:08, 36.60s/it] Error while uploading 'data/train-00076-of-00950-b90e4e3b433db179.parquet' to the Hub. Pushing split train to the Hub. Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.21ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:25<00:00, 25.40s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:01<00:00, 1.56ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:10<00:00, 10.40s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.49ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.53s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.27ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:10<00:00, 10.25s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.42ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:11<00:00, 11.03s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.39ba/s] Upload 1 LFS files: 0%| | 0/1 [16:39<?, ?it/s] Pushing dataset shards to the dataset hub: 9%|████████████▊ | 81/950 [48:30<8:40:22, 35.93s/it] Error while uploading 'data/train-00081-of-00950-84b0450a1df093a9.parquet' to the Hub. Pushing split train to the Hub. Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.18ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:11<00:00, 11.65s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:01<00:00, 1.92ba/s] Upload 1 LFS files: 0%| | 0/1 [16:38<?, ?it/s] Pushing dataset shards to the dataset hub: 9%|█████████████ | 82/950 [48:55<8:37:57, 35.80s/it] Error while uploading 'data/train-00082-of-00950-0a1f52da35653e08.parquet' to the Hub. Pushing split train to the Hub. Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.31ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:26<00:00, 26.29s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.42ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:10<00:00, 10.57s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.64ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:10<00:00, 10.35s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.64ba/s] Upload 1 LFS files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:11<00:00, 11.74s/it] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.31ba/s] Upload 1 LFS files: 0%| | 0/1 [16:40<?, ?it/s] Pushing dataset shards to the dataset hub: 9%|█████████████▋ | 86/950 [50:48<8:30:25, 35.45s/it] Error while uploading 'data/train-00086-of-00950-e1cc80dd17191b20.parquet' to the Hub. ``` I have a while loop that forces retries, but it seems that the progress itself is randomly getting lost as well. Any ideas on how to improve this? It has been blocking me for way too long. Should I build the parquet manually and then push manually as well? If I do things manually, how can I ensure my dataset works properly with "stream=True"? Thank you for your help and time.
[ -0.3251087963581085, -0.42933112382888794, -0.06096188724040985, 0.08869528025388718, 0.21317243576049805, -0.06696006655693054, 0.1970674693584442, 0.5384528636932373, 0.05225852131843567, 0.3061686158180237, 0.08448541909456253, 0.10903309285640717, 0.03724048659205437, 0.22024406492710114, 0.14667896926403046, 0.2332618236541748, 0.25349166989326477, -0.10799236595630646, 0.27970409393310547, -0.06858120858669281, -0.06573061645030975, -0.15738080441951752, 0.10763393342494965, -0.10093242675065994, -0.7575782537460327, 0.04432877153158188, 0.22587668895721436, 0.2064542919397354, 0.1921502649784088, -0.16747573018074036, 0.20722517371177673, 0.25278791785240173, -0.16246680915355682, 0.6471035480499268, -0.00012341895489953458, -0.05790407583117485, 0.25191041827201843, 0.02304328978061676, -0.3664642572402954, 0.09019968658685684, -0.10475093126296997, -0.13000282645225525, -0.2037355899810791, 0.1003957986831665, 0.03635609894990921, 0.45928943157196045, -0.19047336280345917, -0.16487863659858704, 0.21318119764328003, -0.0651368647813797, 0.02760709449648857, 0.17410922050476074, 0.014200866222381592, -0.24395343661308289, 0.20720058679580688, 0.13026978075504303, -0.30730724334716797, -0.07190019637346268, 0.49071699380874634, 0.13820913434028625, -0.1179051548242569, -0.07936432957649231, -0.11190301179885864, -0.11168365180492401, 0.016268212348222733, -0.3535960912704468, -0.089785136282444, -0.3143678307533264, 0.34380003809928894, 0.24355612695217133, 0.14077115058898926, -0.08090770244598389, -0.2698417603969574, -0.07041946053504944, -0.11939385533332825, -0.1470957100391388, 0.28435736894607544, 0.16139265894889832, -0.2762324810028076, 0.0654551237821579, -0.13129226863384247, -0.4053599536418915, -0.12707537412643433, -0.03554612770676613, -0.14915555715560913, -0.03168031945824623, 0.1751161366701126, 0.08743235468864441, 0.2067568451166153, -0.05901416763663292, 0.3941405117511749, -0.2691796123981476, 0.0901857241988182, -0.2755673825740814, -0.41740137338638306, 0.13888457417488098, 0.08934485912322998, 0.07516989856958389, -0.042328789830207825, -0.12489776313304901, -0.22944197058677673, 0.44265317916870117, -0.19254255294799805, 0.07224048674106598, 0.27406084537506104, -0.1266958862543106, 0.035612236708402634, -0.06530951708555222, 0.3070811629295349, 0.14404165744781494, -0.2572271227836609, 0.09562107175588608, 0.004041291773319244, -0.11014997959136963, -0.013009496033191681, -0.025750624015927315, 0.0792459174990654, -0.22842007875442505, -0.3421907424926758, 0.2250162661075592, -0.16784855723381042, 0.2685824930667877, 0.20871514081954956, 0.24827389419078827, 0.08709130436182022, 0.3373471796512604, -0.27540260553359985, 0.022007297724485397, -0.23613813519477844, -0.19603271782398224, -0.18941564857959747, -0.13765454292297363, 0.22148294746875763, 0.33565178513526917, 0.19451121985912323, -0.3410741686820984, -0.24856320023536682, 0.07881910353899002, 0.49135810136795044, -0.1306176483631134, -0.20826470851898193, -0.13527116179466248, 0.12670336663722992, 0.4150709807872772, 0.11111826449632645, 0.425483763217926, -0.1380186229944229, -0.1203937754034996, -0.21549536287784576, 0.057632461190223694, -0.18095824122428894, -0.29855096340179443, 0.236887589097023, 0.09342896938323975, -0.14131808280944824, 0.012494992464780807, -0.19530931115150452, -0.20652753114700317, -0.10413315892219543, 0.3453899025917053, -0.04829101264476776, 0.07182597368955612, -0.05895145982503891, -0.009029572829604149, 0.16733375191688538, 0.3914467692375183, -0.46486231684684753, 0.2811201512813568, 0.06217803806066513, 0.4197710156440735, -0.2656343877315521, 0.31870418787002563, -0.07181254029273987, 0.1722499132156372, -0.11614037305116653, 0.008509308099746704, -0.244670569896698, -0.6641231179237366, -0.4377872347831726, 0.4218234121799469, -0.1620047390460968, 0.16865754127502441, 0.030979372560977936, 0.14459466934204102, 0.42355436086654663, -0.36917978525161743, 0.3288465142250061, 0.2769600749015808, -0.1284511536359787, 0.1686631292104721, -0.2560868263244629, -0.23015055060386658, -0.34304046630859375, 0.3827191889286041, 0.2105250358581543, -0.2159123718738556, 0.012101415544748306, 0.46206918358802795, 0.23962244391441345, 0.1523667424917221, 0.3582223951816559, 0.26409244537353516, 0.5892544388771057, -0.15352578461170197, -0.14096936583518982, -0.15002700686454773, -0.5206427574157715, 0.43066176772117615, 0.3863000273704529, -0.12492451071739197, -0.14289477467536926, -0.07865099608898163, -0.22074106335639954, 0.15172049403190613, -0.3061752915382385, 0.3593229055404663, -0.03207937255501747, -0.28083735704421997, -0.034529704600572586, 0.23081551492214203, 0.01316806674003601, 0.37530258297920227, -0.0534038171172142, 0.0001145191490650177, -0.08453143388032913, 0.589294970035553, 0.12691321969032288, -0.23005501925945282, 0.06565289199352264, 0.19912466406822205, 0.14771544933319092, -0.3349977135658264, -0.15287035703659058, 0.11965660005807877, 0.025633741170167923, 0.1757788360118866, 0.26884737610816956, 0.05140337347984314, 0.3028479516506195, -0.034123025834560394, 0.2301027476787567, 0.12599213421344757, -0.11914559453725815, -0.24972756206989288, -0.11160072684288025, 0.16405045986175537, -0.018670421093702316, 0.24425914883613586, -0.1308334469795227, 0.018514275550842285, 0.13719388842582703, -0.09259036928415298, 0.0758800134062767, 0.10112706571817398, 0.31888532638549805, -0.04317906126379967, 0.07725636661052704, -0.03980230540037155, 0.09870178997516632, 0.46279701590538025, 0.6134483218193054, 0.012248978018760681, -0.41306638717651367, 0.1094224750995636, -0.009646803140640259, 0.06047262251377106, 0.05362584441900253, 0.025167375802993774, -0.07241889834403992, 0.010686881840229034, -0.0824461579322815, -0.30172306299209595, -0.14531058073043823, -0.3921554684638977, -0.07417018711566925, 0.2588631510734558, 0.0007041282951831818, 0.1754174530506134, 0.08643867075443268, -0.12469619512557983, -0.139383465051651, -0.22530192136764526, 0.23488369584083557, 0.267243355512619, -0.07326918840408325, 0.01306074857711792, -0.25176653265953064, 0.19057311117649078, 0.11472766101360321, -0.3452693521976471, -0.4584461748600006, -0.5935556888580322, 0.03924757242202759, 0.41381070017814636, -0.005098491907119751, 0.15742459893226624, 0.22899895906448364, 0.227858304977417, 0.19770047068595886, -0.22055822610855103, -0.420364111661911, -0.2874385714530945, -0.06433404982089996, -0.10546663403511047, 0.6536206007003784, 0.11534883826971054, 0.1595478355884552, 0.24570858478546143, -0.060959890484809875, -0.41670650243759155, 0.036050885915756226, 0.014210517518222332, -0.1369485855102539, 0.2540033757686615, -0.3656550347805023, 0.25909745693206787, 0.044579774141311646, -0.0024777650833129883, 0.17514558136463165, -0.22877919673919678, 0.0010563060641288757, 0.2825095057487488, -0.023783313110470772, -0.23724283277988434, 0.030204840004444122, 0.19706696271896362, -0.03649286925792694, -0.5179988741874695, 0.1423984169960022, -0.1319684237241745, 0.01018792949616909, -0.03397040814161301, 0.25232237577438354, -0.07725120335817337, 0.13748645782470703, -0.5111334919929504, 0.10514205694198608, -0.4406029284000397, 0.15532219409942627, -0.03851146996021271, -0.2520192861557007, 0.038356222212314606, 0.1205354630947113, -0.09105511009693146, 0.15005257725715637, -0.6417413353919983, 0.056516218930482864, -0.4287385940551758, 0.3723188042640686, -0.027623241767287254, -0.19984112679958344, -0.044800642877817154, -0.11843064427375793, 0.021422982215881348, 0.08745451271533966, -0.0635109394788742, 0.11660970002412796, 0.44347894191741943, -0.14121459424495697, -0.03429589420557022, 0.23535628616809845, 0.19166912138462067, 0.2653641700744629, 0.23575785756111145, -0.14393195509910583, 0.27466556429862976, 0.31208908557891846, 0.2016386240720749, -0.3055754005908966, -0.20440888404846191, 0.1741175502538681, -0.07299759984016418, -0.27569931745529175, 0.0135960653424263, 0.004383929073810577, 0.3032492399215698, -0.05015849694609642, -0.13071033358573914, 0.22629301249980927, -0.5607283115386963, 0.02306339330971241, -0.21239283680915833, 0.03483888506889343, 0.0065180957317352295, -0.03357160836458206, -0.11715450882911682, -0.40232446789741516, 0.2563615143299103, -0.07678636908531189, 0.16888119280338287, -0.04085487127304077, 0.04937058687210083, 0.20073705911636353, -0.5037559270858765, 0.05050276964902878, -0.07239267230033875, 0.3635871410369873, -0.1539391577243805, 0.01953607052564621, 0.23668713867664337, -0.2818394899368286, 0.6828809380531311, -0.30027705430984497, 0.3237898051738739, -0.10701091587543488, 0.018488794565200806, -0.3644412159919739, -0.1723620593547821, -0.08260313421487808, 0.230376735329628, 0.002069476991891861, 0.7693324685096741, -0.08069546520709991, -0.3536863327026367, -0.19044020771980286, 0.1617283672094345, -0.23571264743804932, -0.22333142161369324, -0.16530045866966248, -0.2613714337348938, -0.3035412132740021, 0.22521772980690002, 0.10040123015642166, 0.15587183833122253, -0.2812294065952301, -0.3021184206008911, 0.026003604754805565, -0.0011469647288322449, 0.08619536459445953, -0.16672855615615845, -0.026849646121263504, 0.0362161323428154, 0.6639813184738159, -0.3151652216911316, 0.003426592331379652, 0.25937315821647644, 0.363582581281662, 0.2772989571094513, 0.13558177649974823, 0.1684017777442932, -0.07802929729223251, 0.16677631437778473, 0.8263382911682129, 0.1594078093767166, 0.23823609948158264, -0.2188805639743805, 0.33667007088661194, -0.4187341332435608, 0.003567427396774292, 0.19658835232257843, -0.09242197871208191, -0.16093581914901733, 0.24352499842643738, 0.41675865650177, -0.09666501730680466, 0.10659737884998322, 0.1142304539680481, 0.3840652108192444, 0.1764860451221466, 0.20738890767097473, 0.13277371227741241, 0.9799233675003052, -0.3102877736091614, 0.16982372105121613, -0.04234737157821655, -0.0031089261174201965, -0.04354431852698326, -0.6333492994308472, -0.11661183834075928, -0.20017999410629272, -0.3024233281612396, 0.11174935102462769, 0.08568943291902542, -0.10316911339759827, 0.055813271552324295, -0.09285952150821686, 0.0855586901307106, -0.19770905375480652, 0.41906434297561646, -0.19767966866493225, 0.2439996302127838, -0.32617297768592834, -0.4959625005722046, -0.15647678077220917, 0.16487178206443787, 0.031437039375305176, -0.04853859543800354, -0.059421706944704056, 0.011713005602359772, -0.13057313859462738, 0.18725842237472534, -0.31405773758888245, 0.021645426750183105, 0.31231430172920227, -0.02313263900578022, -0.14394286274909973, -0.14292877912521362, 0.05420947074890137, -0.5641478300094604, 0.30512750148773193, 0.23124092817306519, -0.17710986733436584, 0.3257598876953125, -0.15534146130084991, 0.021448682993650436, 0.17042016983032227, -0.1134125217795372, 0.26708027720451355, 0.07743698358535767, -0.11875835806131363, 0.16013307869434357, 0.16236057877540588, -0.19428834319114685, -0.09682602435350418, -0.015537142753601074, -0.015437187626957893, -0.01255611702799797, -0.06439370661973953, 0.093236543238163, -0.10974498838186264, -0.16716268658638, 0.05558819696307182, 0.05979766696691513, -0.1893545538187027, 0.3783528208732605, -0.09678718447685242, -0.15456964075565338, -0.008890262804925442, 0.3713226616382599, -0.32756173610687256, -0.19321994483470917, 0.09207242727279663, 0.31886476278305054, -0.18478575348854065, -0.20151659846305847, 0.3515964150428772, -0.012421196326613426, -0.5109376907348633, 0.2792467772960663, -0.35034340620040894, -0.01118190586566925, 0.16701765358448029, 0.016943996772170067, -0.006683635991066694, -0.19413642585277557, -0.16645605862140656, -0.09571659564971924, -0.14830030500888824, -0.05033358186483383, 0.10745757818222046, 0.2067873179912567, -0.4769432544708252, 0.09458194673061371, -0.021793771535158157, 0.40373659133911133, -0.19476406276226044, 0.16495415568351746, -0.3420085608959198, 0.23262569308280945, -0.29311177134513855, -0.45957010984420776, 0.037413790822029114, -0.2678847014904022, -0.045747481286525726, 0.09241914004087448, -0.1529419869184494, -0.12227412313222885, -0.23628827929496765, 0.19033539295196533, 0.189319908618927, 0.17391738295555115, -0.16682016849517822, -0.34320151805877686, 0.17436756193637848, -0.17570532858371735, 0.18915046751499176, 0.1338556706905365, -0.0990087017416954, -0.2690891921520233, 0.7326576113700867, 0.19018957018852234, -0.024524956941604614, 0.44166213274002075, 0.46100103855133057, 0.5311329960823059, -0.028858959674835205, 0.03738952428102493, 0.05452367290854454, 0.04260316491127014, -0.28762519359588623, 0.3660692274570465, 0.28036263585090637, 0.04939091578125954, 0.39158010482788086, -0.2303597778081894, 0.1374913603067398, 0.08632475137710571, 0.37588220834732056, 0.49084779620170593, -0.035772256553173065, -0.49716076254844666, 0.24364681541919708, 0.09298495948314667, 0.10267966985702515, -0.24107787013053894, 0.2818644344806671, -0.05562826991081238, -0.03644116222858429, 0.20599883794784546, 0.18303625285625458, -0.29970067739486694, -0.010596934705972672, 0.3796977996826172, 0.5373080372810364, -0.1991109848022461, -0.3758561313152313, -0.0419774167239666, 0.12178318202495575, -0.009604385122656822, 0.024430690333247185, -0.11847929656505585, 0.21105073392391205, 0.8026148080825806, 0.06376732885837555, 0.1803985834121704, 0.1867927610874176, -0.07245159149169922, 0.18699227273464203, -0.12172377109527588, -0.3046778440475464, 0.10303465276956558, -0.15545590221881866, -0.04155028238892555, 0.07164712250232697, 0.21780909597873688, -0.18861845135688782, -0.1876366287469864, -0.4336097240447998, 0.06782592833042145, -0.14034484326839447, 0.23643556237220764, 0.07064389437437057, 0.011292919516563416, -0.40676021575927734, 0.23104017972946167, -0.06329773366451263, 0.22097136080265045, 0.4582326114177704, 0.5591541528701782, 0.21365556120872498, 0.24056142568588257, -0.21015866100788116, -0.06845530867576599, 0.22913074493408203, -0.18099212646484375, 0.09044861048460007, 0.4119534194469452, -0.2922443151473999, -0.23383483290672302, -0.24112413823604584, 0.22108159959316254, 0.19341081380844116, -0.45813703536987305, 0.43371787667274475, 0.3062591850757599, 0.06670287996530533, 0.0987987220287323, 0.18956217169761658, -0.18546995520591736, 0.20504236221313477, 0.1533985584974289, 0.031063273549079895, -0.0819806158542633, -0.3525286018848419, -0.030681375414133072, 0.3223510682582855, -0.05932959169149399, 0.42182379961013794, 0.11201243102550507, -0.17466874420642853, -0.21328380703926086, -0.058081768453121185, -0.22172901034355164, -0.09328427910804749, 0.26636549830436707, -0.5355953574180603, 0.07447651028633118, -0.1866752654314041, 0.02572821080684662, -0.4233056902885437, 0.6617635488510132, 0.24154812097549438, 0.07221417129039764, -0.35519134998321533, -0.29439595341682434, -0.23527970910072327, 0.2907281517982483, -0.4481869339942932, -0.014662988483905792, 0.06173192709684372, 0.4491553008556366, 0.06895572692155838, 0.025518983602523804, -0.2532501816749573, -0.25601741671562195, -0.12963348627090454, 0.28376272320747375, -0.13120701909065247, 0.06262820959091187, 0.12757046520709991, 0.015935787931084633, -0.14396265149116516, -0.4498974680900574, 0.3557792901992798, 0.10339139401912689, -0.036318931728601456, 0.08136772364377975, -0.23051905632019043, 0.4120981991291046, -0.2536555528640747, 0.02452188730239868, -0.18090640008449554, 0.012954097241163254, 0.0780438557267189, -0.27691221237182617, -0.3581109642982483, -0.106882244348526, 0.034435685724020004, -0.29862281680107117, -0.1686069518327713, 0.10910940170288086, 0.020840056240558624, 0.03685014694929123, -0.1390921026468277, 0.1992226094007492, -0.08289027959108353, 0.38733887672424316, 0.08963944017887115, -0.18663540482521057, -0.26398766040802, 0.3944457173347473, 0.28055137395858765, 0.23066475987434387, 0.1072213351726532, 0.3361835479736328, -0.43927863240242004, -0.1555042266845703, 0.3613762855529785, 0.2324036955833435, -0.4046543836593628, 0.006576307117938995, 0.25290530920028687, -0.18358075618743896, -0.02321651205420494, -0.13050611317157745, -0.12933382391929626, -0.013140063732862473, -0.005518182180821896, -0.12338262796401978, 0.33634501695632935, 0.07808706164360046, -0.08841875195503235, -0.07756863534450531, 0.000375114381313324, 0.07786931842565536, 0.020994901657104492, 0.12060888111591339, 0.1628909409046173 ]
https://github.com/huggingface/datasets/issues/5990
> @lhoestq It's a bit odd that when uploading a dataset, one set at a time "train", "val", "test", the push_to_hub function overwrites the readme and removes differently named sets from previous commits. i.e., you push "val", all is well. Then you push "test", and the "val" entry disappears from the readme, while the data remain intact. Hmm this shouldn't happen. What code did you run exactly ? Using which version of `datasets` ?
Pushing a large dataset on the hub consistently hangs
### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
74
Pushing a large dataset on the hub consistently hangs ### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` > @lhoestq It's a bit odd that when uploading a dataset, one set at a time "train", "val", "test", the push_to_hub function overwrites the readme and removes differently named sets from previous commits. i.e., you push "val", all is well. Then you push "test", and the "val" entry disappears from the readme, while the data remain intact. Hmm this shouldn't happen. What code did you run exactly ? Using which version of `datasets` ?
[ -0.3251087963581085, -0.42933112382888794, -0.06096188724040985, 0.08869528025388718, 0.21317243576049805, -0.06696006655693054, 0.1970674693584442, 0.5384528636932373, 0.05225852131843567, 0.3061686158180237, 0.08448541909456253, 0.10903309285640717, 0.03724048659205437, 0.22024406492710114, 0.14667896926403046, 0.2332618236541748, 0.25349166989326477, -0.10799236595630646, 0.27970409393310547, -0.06858120858669281, -0.06573061645030975, -0.15738080441951752, 0.10763393342494965, -0.10093242675065994, -0.7575782537460327, 0.04432877153158188, 0.22587668895721436, 0.2064542919397354, 0.1921502649784088, -0.16747573018074036, 0.20722517371177673, 0.25278791785240173, -0.16246680915355682, 0.6471035480499268, -0.00012341895489953458, -0.05790407583117485, 0.25191041827201843, 0.02304328978061676, -0.3664642572402954, 0.09019968658685684, -0.10475093126296997, -0.13000282645225525, -0.2037355899810791, 0.1003957986831665, 0.03635609894990921, 0.45928943157196045, -0.19047336280345917, -0.16487863659858704, 0.21318119764328003, -0.0651368647813797, 0.02760709449648857, 0.17410922050476074, 0.014200866222381592, -0.24395343661308289, 0.20720058679580688, 0.13026978075504303, -0.30730724334716797, -0.07190019637346268, 0.49071699380874634, 0.13820913434028625, -0.1179051548242569, -0.07936432957649231, -0.11190301179885864, -0.11168365180492401, 0.016268212348222733, -0.3535960912704468, -0.089785136282444, -0.3143678307533264, 0.34380003809928894, 0.24355612695217133, 0.14077115058898926, -0.08090770244598389, -0.2698417603969574, -0.07041946053504944, -0.11939385533332825, -0.1470957100391388, 0.28435736894607544, 0.16139265894889832, -0.2762324810028076, 0.0654551237821579, -0.13129226863384247, -0.4053599536418915, -0.12707537412643433, -0.03554612770676613, -0.14915555715560913, -0.03168031945824623, 0.1751161366701126, 0.08743235468864441, 0.2067568451166153, -0.05901416763663292, 0.3941405117511749, -0.2691796123981476, 0.0901857241988182, -0.2755673825740814, -0.41740137338638306, 0.13888457417488098, 0.08934485912322998, 0.07516989856958389, -0.042328789830207825, -0.12489776313304901, -0.22944197058677673, 0.44265317916870117, -0.19254255294799805, 0.07224048674106598, 0.27406084537506104, -0.1266958862543106, 0.035612236708402634, -0.06530951708555222, 0.3070811629295349, 0.14404165744781494, -0.2572271227836609, 0.09562107175588608, 0.004041291773319244, -0.11014997959136963, -0.013009496033191681, -0.025750624015927315, 0.0792459174990654, -0.22842007875442505, -0.3421907424926758, 0.2250162661075592, -0.16784855723381042, 0.2685824930667877, 0.20871514081954956, 0.24827389419078827, 0.08709130436182022, 0.3373471796512604, -0.27540260553359985, 0.022007297724485397, -0.23613813519477844, -0.19603271782398224, -0.18941564857959747, -0.13765454292297363, 0.22148294746875763, 0.33565178513526917, 0.19451121985912323, -0.3410741686820984, -0.24856320023536682, 0.07881910353899002, 0.49135810136795044, -0.1306176483631134, -0.20826470851898193, -0.13527116179466248, 0.12670336663722992, 0.4150709807872772, 0.11111826449632645, 0.425483763217926, -0.1380186229944229, -0.1203937754034996, -0.21549536287784576, 0.057632461190223694, -0.18095824122428894, -0.29855096340179443, 0.236887589097023, 0.09342896938323975, -0.14131808280944824, 0.012494992464780807, -0.19530931115150452, -0.20652753114700317, -0.10413315892219543, 0.3453899025917053, -0.04829101264476776, 0.07182597368955612, -0.05895145982503891, -0.009029572829604149, 0.16733375191688538, 0.3914467692375183, -0.46486231684684753, 0.2811201512813568, 0.06217803806066513, 0.4197710156440735, -0.2656343877315521, 0.31870418787002563, -0.07181254029273987, 0.1722499132156372, -0.11614037305116653, 0.008509308099746704, -0.244670569896698, -0.6641231179237366, -0.4377872347831726, 0.4218234121799469, -0.1620047390460968, 0.16865754127502441, 0.030979372560977936, 0.14459466934204102, 0.42355436086654663, -0.36917978525161743, 0.3288465142250061, 0.2769600749015808, -0.1284511536359787, 0.1686631292104721, -0.2560868263244629, -0.23015055060386658, -0.34304046630859375, 0.3827191889286041, 0.2105250358581543, -0.2159123718738556, 0.012101415544748306, 0.46206918358802795, 0.23962244391441345, 0.1523667424917221, 0.3582223951816559, 0.26409244537353516, 0.5892544388771057, -0.15352578461170197, -0.14096936583518982, -0.15002700686454773, -0.5206427574157715, 0.43066176772117615, 0.3863000273704529, -0.12492451071739197, -0.14289477467536926, -0.07865099608898163, -0.22074106335639954, 0.15172049403190613, -0.3061752915382385, 0.3593229055404663, -0.03207937255501747, -0.28083735704421997, -0.034529704600572586, 0.23081551492214203, 0.01316806674003601, 0.37530258297920227, -0.0534038171172142, 0.0001145191490650177, -0.08453143388032913, 0.589294970035553, 0.12691321969032288, -0.23005501925945282, 0.06565289199352264, 0.19912466406822205, 0.14771544933319092, -0.3349977135658264, -0.15287035703659058, 0.11965660005807877, 0.025633741170167923, 0.1757788360118866, 0.26884737610816956, 0.05140337347984314, 0.3028479516506195, -0.034123025834560394, 0.2301027476787567, 0.12599213421344757, -0.11914559453725815, -0.24972756206989288, -0.11160072684288025, 0.16405045986175537, -0.018670421093702316, 0.24425914883613586, -0.1308334469795227, 0.018514275550842285, 0.13719388842582703, -0.09259036928415298, 0.0758800134062767, 0.10112706571817398, 0.31888532638549805, -0.04317906126379967, 0.07725636661052704, -0.03980230540037155, 0.09870178997516632, 0.46279701590538025, 0.6134483218193054, 0.012248978018760681, -0.41306638717651367, 0.1094224750995636, -0.009646803140640259, 0.06047262251377106, 0.05362584441900253, 0.025167375802993774, -0.07241889834403992, 0.010686881840229034, -0.0824461579322815, -0.30172306299209595, -0.14531058073043823, -0.3921554684638977, -0.07417018711566925, 0.2588631510734558, 0.0007041282951831818, 0.1754174530506134, 0.08643867075443268, -0.12469619512557983, -0.139383465051651, -0.22530192136764526, 0.23488369584083557, 0.267243355512619, -0.07326918840408325, 0.01306074857711792, -0.25176653265953064, 0.19057311117649078, 0.11472766101360321, -0.3452693521976471, -0.4584461748600006, -0.5935556888580322, 0.03924757242202759, 0.41381070017814636, -0.005098491907119751, 0.15742459893226624, 0.22899895906448364, 0.227858304977417, 0.19770047068595886, -0.22055822610855103, -0.420364111661911, -0.2874385714530945, -0.06433404982089996, -0.10546663403511047, 0.6536206007003784, 0.11534883826971054, 0.1595478355884552, 0.24570858478546143, -0.060959890484809875, -0.41670650243759155, 0.036050885915756226, 0.014210517518222332, -0.1369485855102539, 0.2540033757686615, -0.3656550347805023, 0.25909745693206787, 0.044579774141311646, -0.0024777650833129883, 0.17514558136463165, -0.22877919673919678, 0.0010563060641288757, 0.2825095057487488, -0.023783313110470772, -0.23724283277988434, 0.030204840004444122, 0.19706696271896362, -0.03649286925792694, -0.5179988741874695, 0.1423984169960022, -0.1319684237241745, 0.01018792949616909, -0.03397040814161301, 0.25232237577438354, -0.07725120335817337, 0.13748645782470703, -0.5111334919929504, 0.10514205694198608, -0.4406029284000397, 0.15532219409942627, -0.03851146996021271, -0.2520192861557007, 0.038356222212314606, 0.1205354630947113, -0.09105511009693146, 0.15005257725715637, -0.6417413353919983, 0.056516218930482864, -0.4287385940551758, 0.3723188042640686, -0.027623241767287254, -0.19984112679958344, -0.044800642877817154, -0.11843064427375793, 0.021422982215881348, 0.08745451271533966, -0.0635109394788742, 0.11660970002412796, 0.44347894191741943, -0.14121459424495697, -0.03429589420557022, 0.23535628616809845, 0.19166912138462067, 0.2653641700744629, 0.23575785756111145, -0.14393195509910583, 0.27466556429862976, 0.31208908557891846, 0.2016386240720749, -0.3055754005908966, -0.20440888404846191, 0.1741175502538681, -0.07299759984016418, -0.27569931745529175, 0.0135960653424263, 0.004383929073810577, 0.3032492399215698, -0.05015849694609642, -0.13071033358573914, 0.22629301249980927, -0.5607283115386963, 0.02306339330971241, -0.21239283680915833, 0.03483888506889343, 0.0065180957317352295, -0.03357160836458206, -0.11715450882911682, -0.40232446789741516, 0.2563615143299103, -0.07678636908531189, 0.16888119280338287, -0.04085487127304077, 0.04937058687210083, 0.20073705911636353, -0.5037559270858765, 0.05050276964902878, -0.07239267230033875, 0.3635871410369873, -0.1539391577243805, 0.01953607052564621, 0.23668713867664337, -0.2818394899368286, 0.6828809380531311, -0.30027705430984497, 0.3237898051738739, -0.10701091587543488, 0.018488794565200806, -0.3644412159919739, -0.1723620593547821, -0.08260313421487808, 0.230376735329628, 0.002069476991891861, 0.7693324685096741, -0.08069546520709991, -0.3536863327026367, -0.19044020771980286, 0.1617283672094345, -0.23571264743804932, -0.22333142161369324, -0.16530045866966248, -0.2613714337348938, -0.3035412132740021, 0.22521772980690002, 0.10040123015642166, 0.15587183833122253, -0.2812294065952301, -0.3021184206008911, 0.026003604754805565, -0.0011469647288322449, 0.08619536459445953, -0.16672855615615845, -0.026849646121263504, 0.0362161323428154, 0.6639813184738159, -0.3151652216911316, 0.003426592331379652, 0.25937315821647644, 0.363582581281662, 0.2772989571094513, 0.13558177649974823, 0.1684017777442932, -0.07802929729223251, 0.16677631437778473, 0.8263382911682129, 0.1594078093767166, 0.23823609948158264, -0.2188805639743805, 0.33667007088661194, -0.4187341332435608, 0.003567427396774292, 0.19658835232257843, -0.09242197871208191, -0.16093581914901733, 0.24352499842643738, 0.41675865650177, -0.09666501730680466, 0.10659737884998322, 0.1142304539680481, 0.3840652108192444, 0.1764860451221466, 0.20738890767097473, 0.13277371227741241, 0.9799233675003052, -0.3102877736091614, 0.16982372105121613, -0.04234737157821655, -0.0031089261174201965, -0.04354431852698326, -0.6333492994308472, -0.11661183834075928, -0.20017999410629272, -0.3024233281612396, 0.11174935102462769, 0.08568943291902542, -0.10316911339759827, 0.055813271552324295, -0.09285952150821686, 0.0855586901307106, -0.19770905375480652, 0.41906434297561646, -0.19767966866493225, 0.2439996302127838, -0.32617297768592834, -0.4959625005722046, -0.15647678077220917, 0.16487178206443787, 0.031437039375305176, -0.04853859543800354, -0.059421706944704056, 0.011713005602359772, -0.13057313859462738, 0.18725842237472534, -0.31405773758888245, 0.021645426750183105, 0.31231430172920227, -0.02313263900578022, -0.14394286274909973, -0.14292877912521362, 0.05420947074890137, -0.5641478300094604, 0.30512750148773193, 0.23124092817306519, -0.17710986733436584, 0.3257598876953125, -0.15534146130084991, 0.021448682993650436, 0.17042016983032227, -0.1134125217795372, 0.26708027720451355, 0.07743698358535767, -0.11875835806131363, 0.16013307869434357, 0.16236057877540588, -0.19428834319114685, -0.09682602435350418, -0.015537142753601074, -0.015437187626957893, -0.01255611702799797, -0.06439370661973953, 0.093236543238163, -0.10974498838186264, -0.16716268658638, 0.05558819696307182, 0.05979766696691513, -0.1893545538187027, 0.3783528208732605, -0.09678718447685242, -0.15456964075565338, -0.008890262804925442, 0.3713226616382599, -0.32756173610687256, -0.19321994483470917, 0.09207242727279663, 0.31886476278305054, -0.18478575348854065, -0.20151659846305847, 0.3515964150428772, -0.012421196326613426, -0.5109376907348633, 0.2792467772960663, -0.35034340620040894, -0.01118190586566925, 0.16701765358448029, 0.016943996772170067, -0.006683635991066694, -0.19413642585277557, -0.16645605862140656, -0.09571659564971924, -0.14830030500888824, -0.05033358186483383, 0.10745757818222046, 0.2067873179912567, -0.4769432544708252, 0.09458194673061371, -0.021793771535158157, 0.40373659133911133, -0.19476406276226044, 0.16495415568351746, -0.3420085608959198, 0.23262569308280945, -0.29311177134513855, -0.45957010984420776, 0.037413790822029114, -0.2678847014904022, -0.045747481286525726, 0.09241914004087448, -0.1529419869184494, -0.12227412313222885, -0.23628827929496765, 0.19033539295196533, 0.189319908618927, 0.17391738295555115, -0.16682016849517822, -0.34320151805877686, 0.17436756193637848, -0.17570532858371735, 0.18915046751499176, 0.1338556706905365, -0.0990087017416954, -0.2690891921520233, 0.7326576113700867, 0.19018957018852234, -0.024524956941604614, 0.44166213274002075, 0.46100103855133057, 0.5311329960823059, -0.028858959674835205, 0.03738952428102493, 0.05452367290854454, 0.04260316491127014, -0.28762519359588623, 0.3660692274570465, 0.28036263585090637, 0.04939091578125954, 0.39158010482788086, -0.2303597778081894, 0.1374913603067398, 0.08632475137710571, 0.37588220834732056, 0.49084779620170593, -0.035772256553173065, -0.49716076254844666, 0.24364681541919708, 0.09298495948314667, 0.10267966985702515, -0.24107787013053894, 0.2818644344806671, -0.05562826991081238, -0.03644116222858429, 0.20599883794784546, 0.18303625285625458, -0.29970067739486694, -0.010596934705972672, 0.3796977996826172, 0.5373080372810364, -0.1991109848022461, -0.3758561313152313, -0.0419774167239666, 0.12178318202495575, -0.009604385122656822, 0.024430690333247185, -0.11847929656505585, 0.21105073392391205, 0.8026148080825806, 0.06376732885837555, 0.1803985834121704, 0.1867927610874176, -0.07245159149169922, 0.18699227273464203, -0.12172377109527588, -0.3046778440475464, 0.10303465276956558, -0.15545590221881866, -0.04155028238892555, 0.07164712250232697, 0.21780909597873688, -0.18861845135688782, -0.1876366287469864, -0.4336097240447998, 0.06782592833042145, -0.14034484326839447, 0.23643556237220764, 0.07064389437437057, 0.011292919516563416, -0.40676021575927734, 0.23104017972946167, -0.06329773366451263, 0.22097136080265045, 0.4582326114177704, 0.5591541528701782, 0.21365556120872498, 0.24056142568588257, -0.21015866100788116, -0.06845530867576599, 0.22913074493408203, -0.18099212646484375, 0.09044861048460007, 0.4119534194469452, -0.2922443151473999, -0.23383483290672302, -0.24112413823604584, 0.22108159959316254, 0.19341081380844116, -0.45813703536987305, 0.43371787667274475, 0.3062591850757599, 0.06670287996530533, 0.0987987220287323, 0.18956217169761658, -0.18546995520591736, 0.20504236221313477, 0.1533985584974289, 0.031063273549079895, -0.0819806158542633, -0.3525286018848419, -0.030681375414133072, 0.3223510682582855, -0.05932959169149399, 0.42182379961013794, 0.11201243102550507, -0.17466874420642853, -0.21328380703926086, -0.058081768453121185, -0.22172901034355164, -0.09328427910804749, 0.26636549830436707, -0.5355953574180603, 0.07447651028633118, -0.1866752654314041, 0.02572821080684662, -0.4233056902885437, 0.6617635488510132, 0.24154812097549438, 0.07221417129039764, -0.35519134998321533, -0.29439595341682434, -0.23527970910072327, 0.2907281517982483, -0.4481869339942932, -0.014662988483905792, 0.06173192709684372, 0.4491553008556366, 0.06895572692155838, 0.025518983602523804, -0.2532501816749573, -0.25601741671562195, -0.12963348627090454, 0.28376272320747375, -0.13120701909065247, 0.06262820959091187, 0.12757046520709991, 0.015935787931084633, -0.14396265149116516, -0.4498974680900574, 0.3557792901992798, 0.10339139401912689, -0.036318931728601456, 0.08136772364377975, -0.23051905632019043, 0.4120981991291046, -0.2536555528640747, 0.02452188730239868, -0.18090640008449554, 0.012954097241163254, 0.0780438557267189, -0.27691221237182617, -0.3581109642982483, -0.106882244348526, 0.034435685724020004, -0.29862281680107117, -0.1686069518327713, 0.10910940170288086, 0.020840056240558624, 0.03685014694929123, -0.1390921026468277, 0.1992226094007492, -0.08289027959108353, 0.38733887672424316, 0.08963944017887115, -0.18663540482521057, -0.26398766040802, 0.3944457173347473, 0.28055137395858765, 0.23066475987434387, 0.1072213351726532, 0.3361835479736328, -0.43927863240242004, -0.1555042266845703, 0.3613762855529785, 0.2324036955833435, -0.4046543836593628, 0.006576307117938995, 0.25290530920028687, -0.18358075618743896, -0.02321651205420494, -0.13050611317157745, -0.12933382391929626, -0.013140063732862473, -0.005518182180821896, -0.12338262796401978, 0.33634501695632935, 0.07808706164360046, -0.08841875195503235, -0.07756863534450531, 0.000375114381313324, 0.07786931842565536, 0.020994901657104492, 0.12060888111591339, 0.1628909409046173 ]
https://github.com/huggingface/datasets/issues/5990
> I have a while loop that forces retries, but it seems that the progress itself is randomly getting lost as well. Any ideas on how to improve this? It has been blocking me for way too long. Could you also print the cause of the error (`e.__cause__`) ? Or show the full stack trace when the error happens ? This would give more details about why it failed and would help investigate.
Pushing a large dataset on the hub consistently hangs
### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
73
Pushing a large dataset on the hub consistently hangs ### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` > I have a while loop that forces retries, but it seems that the progress itself is randomly getting lost as well. Any ideas on how to improve this? It has been blocking me for way too long. Could you also print the cause of the error (`e.__cause__`) ? Or show the full stack trace when the error happens ? This would give more details about why it failed and would help investigate.
[ -0.3251087963581085, -0.42933112382888794, -0.06096188724040985, 0.08869528025388718, 0.21317243576049805, -0.06696006655693054, 0.1970674693584442, 0.5384528636932373, 0.05225852131843567, 0.3061686158180237, 0.08448541909456253, 0.10903309285640717, 0.03724048659205437, 0.22024406492710114, 0.14667896926403046, 0.2332618236541748, 0.25349166989326477, -0.10799236595630646, 0.27970409393310547, -0.06858120858669281, -0.06573061645030975, -0.15738080441951752, 0.10763393342494965, -0.10093242675065994, -0.7575782537460327, 0.04432877153158188, 0.22587668895721436, 0.2064542919397354, 0.1921502649784088, -0.16747573018074036, 0.20722517371177673, 0.25278791785240173, -0.16246680915355682, 0.6471035480499268, -0.00012341895489953458, -0.05790407583117485, 0.25191041827201843, 0.02304328978061676, -0.3664642572402954, 0.09019968658685684, -0.10475093126296997, -0.13000282645225525, -0.2037355899810791, 0.1003957986831665, 0.03635609894990921, 0.45928943157196045, -0.19047336280345917, -0.16487863659858704, 0.21318119764328003, -0.0651368647813797, 0.02760709449648857, 0.17410922050476074, 0.014200866222381592, -0.24395343661308289, 0.20720058679580688, 0.13026978075504303, -0.30730724334716797, -0.07190019637346268, 0.49071699380874634, 0.13820913434028625, -0.1179051548242569, -0.07936432957649231, -0.11190301179885864, -0.11168365180492401, 0.016268212348222733, -0.3535960912704468, -0.089785136282444, -0.3143678307533264, 0.34380003809928894, 0.24355612695217133, 0.14077115058898926, -0.08090770244598389, -0.2698417603969574, -0.07041946053504944, -0.11939385533332825, -0.1470957100391388, 0.28435736894607544, 0.16139265894889832, -0.2762324810028076, 0.0654551237821579, -0.13129226863384247, -0.4053599536418915, -0.12707537412643433, -0.03554612770676613, -0.14915555715560913, -0.03168031945824623, 0.1751161366701126, 0.08743235468864441, 0.2067568451166153, -0.05901416763663292, 0.3941405117511749, -0.2691796123981476, 0.0901857241988182, -0.2755673825740814, -0.41740137338638306, 0.13888457417488098, 0.08934485912322998, 0.07516989856958389, -0.042328789830207825, -0.12489776313304901, -0.22944197058677673, 0.44265317916870117, -0.19254255294799805, 0.07224048674106598, 0.27406084537506104, -0.1266958862543106, 0.035612236708402634, -0.06530951708555222, 0.3070811629295349, 0.14404165744781494, -0.2572271227836609, 0.09562107175588608, 0.004041291773319244, -0.11014997959136963, -0.013009496033191681, -0.025750624015927315, 0.0792459174990654, -0.22842007875442505, -0.3421907424926758, 0.2250162661075592, -0.16784855723381042, 0.2685824930667877, 0.20871514081954956, 0.24827389419078827, 0.08709130436182022, 0.3373471796512604, -0.27540260553359985, 0.022007297724485397, -0.23613813519477844, -0.19603271782398224, -0.18941564857959747, -0.13765454292297363, 0.22148294746875763, 0.33565178513526917, 0.19451121985912323, -0.3410741686820984, -0.24856320023536682, 0.07881910353899002, 0.49135810136795044, -0.1306176483631134, -0.20826470851898193, -0.13527116179466248, 0.12670336663722992, 0.4150709807872772, 0.11111826449632645, 0.425483763217926, -0.1380186229944229, -0.1203937754034996, -0.21549536287784576, 0.057632461190223694, -0.18095824122428894, -0.29855096340179443, 0.236887589097023, 0.09342896938323975, -0.14131808280944824, 0.012494992464780807, -0.19530931115150452, -0.20652753114700317, -0.10413315892219543, 0.3453899025917053, -0.04829101264476776, 0.07182597368955612, -0.05895145982503891, -0.009029572829604149, 0.16733375191688538, 0.3914467692375183, -0.46486231684684753, 0.2811201512813568, 0.06217803806066513, 0.4197710156440735, -0.2656343877315521, 0.31870418787002563, -0.07181254029273987, 0.1722499132156372, -0.11614037305116653, 0.008509308099746704, -0.244670569896698, -0.6641231179237366, -0.4377872347831726, 0.4218234121799469, -0.1620047390460968, 0.16865754127502441, 0.030979372560977936, 0.14459466934204102, 0.42355436086654663, -0.36917978525161743, 0.3288465142250061, 0.2769600749015808, -0.1284511536359787, 0.1686631292104721, -0.2560868263244629, -0.23015055060386658, -0.34304046630859375, 0.3827191889286041, 0.2105250358581543, -0.2159123718738556, 0.012101415544748306, 0.46206918358802795, 0.23962244391441345, 0.1523667424917221, 0.3582223951816559, 0.26409244537353516, 0.5892544388771057, -0.15352578461170197, -0.14096936583518982, -0.15002700686454773, -0.5206427574157715, 0.43066176772117615, 0.3863000273704529, -0.12492451071739197, -0.14289477467536926, -0.07865099608898163, -0.22074106335639954, 0.15172049403190613, -0.3061752915382385, 0.3593229055404663, -0.03207937255501747, -0.28083735704421997, -0.034529704600572586, 0.23081551492214203, 0.01316806674003601, 0.37530258297920227, -0.0534038171172142, 0.0001145191490650177, -0.08453143388032913, 0.589294970035553, 0.12691321969032288, -0.23005501925945282, 0.06565289199352264, 0.19912466406822205, 0.14771544933319092, -0.3349977135658264, -0.15287035703659058, 0.11965660005807877, 0.025633741170167923, 0.1757788360118866, 0.26884737610816956, 0.05140337347984314, 0.3028479516506195, -0.034123025834560394, 0.2301027476787567, 0.12599213421344757, -0.11914559453725815, -0.24972756206989288, -0.11160072684288025, 0.16405045986175537, -0.018670421093702316, 0.24425914883613586, -0.1308334469795227, 0.018514275550842285, 0.13719388842582703, -0.09259036928415298, 0.0758800134062767, 0.10112706571817398, 0.31888532638549805, -0.04317906126379967, 0.07725636661052704, -0.03980230540037155, 0.09870178997516632, 0.46279701590538025, 0.6134483218193054, 0.012248978018760681, -0.41306638717651367, 0.1094224750995636, -0.009646803140640259, 0.06047262251377106, 0.05362584441900253, 0.025167375802993774, -0.07241889834403992, 0.010686881840229034, -0.0824461579322815, -0.30172306299209595, -0.14531058073043823, -0.3921554684638977, -0.07417018711566925, 0.2588631510734558, 0.0007041282951831818, 0.1754174530506134, 0.08643867075443268, -0.12469619512557983, -0.139383465051651, -0.22530192136764526, 0.23488369584083557, 0.267243355512619, -0.07326918840408325, 0.01306074857711792, -0.25176653265953064, 0.19057311117649078, 0.11472766101360321, -0.3452693521976471, -0.4584461748600006, -0.5935556888580322, 0.03924757242202759, 0.41381070017814636, -0.005098491907119751, 0.15742459893226624, 0.22899895906448364, 0.227858304977417, 0.19770047068595886, -0.22055822610855103, -0.420364111661911, -0.2874385714530945, -0.06433404982089996, -0.10546663403511047, 0.6536206007003784, 0.11534883826971054, 0.1595478355884552, 0.24570858478546143, -0.060959890484809875, -0.41670650243759155, 0.036050885915756226, 0.014210517518222332, -0.1369485855102539, 0.2540033757686615, -0.3656550347805023, 0.25909745693206787, 0.044579774141311646, -0.0024777650833129883, 0.17514558136463165, -0.22877919673919678, 0.0010563060641288757, 0.2825095057487488, -0.023783313110470772, -0.23724283277988434, 0.030204840004444122, 0.19706696271896362, -0.03649286925792694, -0.5179988741874695, 0.1423984169960022, -0.1319684237241745, 0.01018792949616909, -0.03397040814161301, 0.25232237577438354, -0.07725120335817337, 0.13748645782470703, -0.5111334919929504, 0.10514205694198608, -0.4406029284000397, 0.15532219409942627, -0.03851146996021271, -0.2520192861557007, 0.038356222212314606, 0.1205354630947113, -0.09105511009693146, 0.15005257725715637, -0.6417413353919983, 0.056516218930482864, -0.4287385940551758, 0.3723188042640686, -0.027623241767287254, -0.19984112679958344, -0.044800642877817154, -0.11843064427375793, 0.021422982215881348, 0.08745451271533966, -0.0635109394788742, 0.11660970002412796, 0.44347894191741943, -0.14121459424495697, -0.03429589420557022, 0.23535628616809845, 0.19166912138462067, 0.2653641700744629, 0.23575785756111145, -0.14393195509910583, 0.27466556429862976, 0.31208908557891846, 0.2016386240720749, -0.3055754005908966, -0.20440888404846191, 0.1741175502538681, -0.07299759984016418, -0.27569931745529175, 0.0135960653424263, 0.004383929073810577, 0.3032492399215698, -0.05015849694609642, -0.13071033358573914, 0.22629301249980927, -0.5607283115386963, 0.02306339330971241, -0.21239283680915833, 0.03483888506889343, 0.0065180957317352295, -0.03357160836458206, -0.11715450882911682, -0.40232446789741516, 0.2563615143299103, -0.07678636908531189, 0.16888119280338287, -0.04085487127304077, 0.04937058687210083, 0.20073705911636353, -0.5037559270858765, 0.05050276964902878, -0.07239267230033875, 0.3635871410369873, -0.1539391577243805, 0.01953607052564621, 0.23668713867664337, -0.2818394899368286, 0.6828809380531311, -0.30027705430984497, 0.3237898051738739, -0.10701091587543488, 0.018488794565200806, -0.3644412159919739, -0.1723620593547821, -0.08260313421487808, 0.230376735329628, 0.002069476991891861, 0.7693324685096741, -0.08069546520709991, -0.3536863327026367, -0.19044020771980286, 0.1617283672094345, -0.23571264743804932, -0.22333142161369324, -0.16530045866966248, -0.2613714337348938, -0.3035412132740021, 0.22521772980690002, 0.10040123015642166, 0.15587183833122253, -0.2812294065952301, -0.3021184206008911, 0.026003604754805565, -0.0011469647288322449, 0.08619536459445953, -0.16672855615615845, -0.026849646121263504, 0.0362161323428154, 0.6639813184738159, -0.3151652216911316, 0.003426592331379652, 0.25937315821647644, 0.363582581281662, 0.2772989571094513, 0.13558177649974823, 0.1684017777442932, -0.07802929729223251, 0.16677631437778473, 0.8263382911682129, 0.1594078093767166, 0.23823609948158264, -0.2188805639743805, 0.33667007088661194, -0.4187341332435608, 0.003567427396774292, 0.19658835232257843, -0.09242197871208191, -0.16093581914901733, 0.24352499842643738, 0.41675865650177, -0.09666501730680466, 0.10659737884998322, 0.1142304539680481, 0.3840652108192444, 0.1764860451221466, 0.20738890767097473, 0.13277371227741241, 0.9799233675003052, -0.3102877736091614, 0.16982372105121613, -0.04234737157821655, -0.0031089261174201965, -0.04354431852698326, -0.6333492994308472, -0.11661183834075928, -0.20017999410629272, -0.3024233281612396, 0.11174935102462769, 0.08568943291902542, -0.10316911339759827, 0.055813271552324295, -0.09285952150821686, 0.0855586901307106, -0.19770905375480652, 0.41906434297561646, -0.19767966866493225, 0.2439996302127838, -0.32617297768592834, -0.4959625005722046, -0.15647678077220917, 0.16487178206443787, 0.031437039375305176, -0.04853859543800354, -0.059421706944704056, 0.011713005602359772, -0.13057313859462738, 0.18725842237472534, -0.31405773758888245, 0.021645426750183105, 0.31231430172920227, -0.02313263900578022, -0.14394286274909973, -0.14292877912521362, 0.05420947074890137, -0.5641478300094604, 0.30512750148773193, 0.23124092817306519, -0.17710986733436584, 0.3257598876953125, -0.15534146130084991, 0.021448682993650436, 0.17042016983032227, -0.1134125217795372, 0.26708027720451355, 0.07743698358535767, -0.11875835806131363, 0.16013307869434357, 0.16236057877540588, -0.19428834319114685, -0.09682602435350418, -0.015537142753601074, -0.015437187626957893, -0.01255611702799797, -0.06439370661973953, 0.093236543238163, -0.10974498838186264, -0.16716268658638, 0.05558819696307182, 0.05979766696691513, -0.1893545538187027, 0.3783528208732605, -0.09678718447685242, -0.15456964075565338, -0.008890262804925442, 0.3713226616382599, -0.32756173610687256, -0.19321994483470917, 0.09207242727279663, 0.31886476278305054, -0.18478575348854065, -0.20151659846305847, 0.3515964150428772, -0.012421196326613426, -0.5109376907348633, 0.2792467772960663, -0.35034340620040894, -0.01118190586566925, 0.16701765358448029, 0.016943996772170067, -0.006683635991066694, -0.19413642585277557, -0.16645605862140656, -0.09571659564971924, -0.14830030500888824, -0.05033358186483383, 0.10745757818222046, 0.2067873179912567, -0.4769432544708252, 0.09458194673061371, -0.021793771535158157, 0.40373659133911133, -0.19476406276226044, 0.16495415568351746, -0.3420085608959198, 0.23262569308280945, -0.29311177134513855, -0.45957010984420776, 0.037413790822029114, -0.2678847014904022, -0.045747481286525726, 0.09241914004087448, -0.1529419869184494, -0.12227412313222885, -0.23628827929496765, 0.19033539295196533, 0.189319908618927, 0.17391738295555115, -0.16682016849517822, -0.34320151805877686, 0.17436756193637848, -0.17570532858371735, 0.18915046751499176, 0.1338556706905365, -0.0990087017416954, -0.2690891921520233, 0.7326576113700867, 0.19018957018852234, -0.024524956941604614, 0.44166213274002075, 0.46100103855133057, 0.5311329960823059, -0.028858959674835205, 0.03738952428102493, 0.05452367290854454, 0.04260316491127014, -0.28762519359588623, 0.3660692274570465, 0.28036263585090637, 0.04939091578125954, 0.39158010482788086, -0.2303597778081894, 0.1374913603067398, 0.08632475137710571, 0.37588220834732056, 0.49084779620170593, -0.035772256553173065, -0.49716076254844666, 0.24364681541919708, 0.09298495948314667, 0.10267966985702515, -0.24107787013053894, 0.2818644344806671, -0.05562826991081238, -0.03644116222858429, 0.20599883794784546, 0.18303625285625458, -0.29970067739486694, -0.010596934705972672, 0.3796977996826172, 0.5373080372810364, -0.1991109848022461, -0.3758561313152313, -0.0419774167239666, 0.12178318202495575, -0.009604385122656822, 0.024430690333247185, -0.11847929656505585, 0.21105073392391205, 0.8026148080825806, 0.06376732885837555, 0.1803985834121704, 0.1867927610874176, -0.07245159149169922, 0.18699227273464203, -0.12172377109527588, -0.3046778440475464, 0.10303465276956558, -0.15545590221881866, -0.04155028238892555, 0.07164712250232697, 0.21780909597873688, -0.18861845135688782, -0.1876366287469864, -0.4336097240447998, 0.06782592833042145, -0.14034484326839447, 0.23643556237220764, 0.07064389437437057, 0.011292919516563416, -0.40676021575927734, 0.23104017972946167, -0.06329773366451263, 0.22097136080265045, 0.4582326114177704, 0.5591541528701782, 0.21365556120872498, 0.24056142568588257, -0.21015866100788116, -0.06845530867576599, 0.22913074493408203, -0.18099212646484375, 0.09044861048460007, 0.4119534194469452, -0.2922443151473999, -0.23383483290672302, -0.24112413823604584, 0.22108159959316254, 0.19341081380844116, -0.45813703536987305, 0.43371787667274475, 0.3062591850757599, 0.06670287996530533, 0.0987987220287323, 0.18956217169761658, -0.18546995520591736, 0.20504236221313477, 0.1533985584974289, 0.031063273549079895, -0.0819806158542633, -0.3525286018848419, -0.030681375414133072, 0.3223510682582855, -0.05932959169149399, 0.42182379961013794, 0.11201243102550507, -0.17466874420642853, -0.21328380703926086, -0.058081768453121185, -0.22172901034355164, -0.09328427910804749, 0.26636549830436707, -0.5355953574180603, 0.07447651028633118, -0.1866752654314041, 0.02572821080684662, -0.4233056902885437, 0.6617635488510132, 0.24154812097549438, 0.07221417129039764, -0.35519134998321533, -0.29439595341682434, -0.23527970910072327, 0.2907281517982483, -0.4481869339942932, -0.014662988483905792, 0.06173192709684372, 0.4491553008556366, 0.06895572692155838, 0.025518983602523804, -0.2532501816749573, -0.25601741671562195, -0.12963348627090454, 0.28376272320747375, -0.13120701909065247, 0.06262820959091187, 0.12757046520709991, 0.015935787931084633, -0.14396265149116516, -0.4498974680900574, 0.3557792901992798, 0.10339139401912689, -0.036318931728601456, 0.08136772364377975, -0.23051905632019043, 0.4120981991291046, -0.2536555528640747, 0.02452188730239868, -0.18090640008449554, 0.012954097241163254, 0.0780438557267189, -0.27691221237182617, -0.3581109642982483, -0.106882244348526, 0.034435685724020004, -0.29862281680107117, -0.1686069518327713, 0.10910940170288086, 0.020840056240558624, 0.03685014694929123, -0.1390921026468277, 0.1992226094007492, -0.08289027959108353, 0.38733887672424316, 0.08963944017887115, -0.18663540482521057, -0.26398766040802, 0.3944457173347473, 0.28055137395858765, 0.23066475987434387, 0.1072213351726532, 0.3361835479736328, -0.43927863240242004, -0.1555042266845703, 0.3613762855529785, 0.2324036955833435, -0.4046543836593628, 0.006576307117938995, 0.25290530920028687, -0.18358075618743896, -0.02321651205420494, -0.13050611317157745, -0.12933382391929626, -0.013140063732862473, -0.005518182180821896, -0.12338262796401978, 0.33634501695632935, 0.07808706164360046, -0.08841875195503235, -0.07756863534450531, 0.000375114381313324, 0.07786931842565536, 0.020994901657104492, 0.12060888111591339, 0.1628909409046173 ]
https://github.com/huggingface/datasets/issues/5990
> Should I build the parquet manually and then push manually as well? If I do things manually, how can I ensure my dataset works properly with "stream=True"? Parquet is supported out of the box ^^ If you want to make sure it works as expected you can try locally first: ```python ds = load_dataset("path/to/local", streaming=True) ```
Pushing a large dataset on the hub consistently hangs
### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
57
Pushing a large dataset on the hub consistently hangs ### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` > Should I build the parquet manually and then push manually as well? If I do things manually, how can I ensure my dataset works properly with "stream=True"? Parquet is supported out of the box ^^ If you want to make sure it works as expected you can try locally first: ```python ds = load_dataset("path/to/local", streaming=True) ```
[ -0.3251087963581085, -0.42933112382888794, -0.06096188724040985, 0.08869528025388718, 0.21317243576049805, -0.06696006655693054, 0.1970674693584442, 0.5384528636932373, 0.05225852131843567, 0.3061686158180237, 0.08448541909456253, 0.10903309285640717, 0.03724048659205437, 0.22024406492710114, 0.14667896926403046, 0.2332618236541748, 0.25349166989326477, -0.10799236595630646, 0.27970409393310547, -0.06858120858669281, -0.06573061645030975, -0.15738080441951752, 0.10763393342494965, -0.10093242675065994, -0.7575782537460327, 0.04432877153158188, 0.22587668895721436, 0.2064542919397354, 0.1921502649784088, -0.16747573018074036, 0.20722517371177673, 0.25278791785240173, -0.16246680915355682, 0.6471035480499268, -0.00012341895489953458, -0.05790407583117485, 0.25191041827201843, 0.02304328978061676, -0.3664642572402954, 0.09019968658685684, -0.10475093126296997, -0.13000282645225525, -0.2037355899810791, 0.1003957986831665, 0.03635609894990921, 0.45928943157196045, -0.19047336280345917, -0.16487863659858704, 0.21318119764328003, -0.0651368647813797, 0.02760709449648857, 0.17410922050476074, 0.014200866222381592, -0.24395343661308289, 0.20720058679580688, 0.13026978075504303, -0.30730724334716797, -0.07190019637346268, 0.49071699380874634, 0.13820913434028625, -0.1179051548242569, -0.07936432957649231, -0.11190301179885864, -0.11168365180492401, 0.016268212348222733, -0.3535960912704468, -0.089785136282444, -0.3143678307533264, 0.34380003809928894, 0.24355612695217133, 0.14077115058898926, -0.08090770244598389, -0.2698417603969574, -0.07041946053504944, -0.11939385533332825, -0.1470957100391388, 0.28435736894607544, 0.16139265894889832, -0.2762324810028076, 0.0654551237821579, -0.13129226863384247, -0.4053599536418915, -0.12707537412643433, -0.03554612770676613, -0.14915555715560913, -0.03168031945824623, 0.1751161366701126, 0.08743235468864441, 0.2067568451166153, -0.05901416763663292, 0.3941405117511749, -0.2691796123981476, 0.0901857241988182, -0.2755673825740814, -0.41740137338638306, 0.13888457417488098, 0.08934485912322998, 0.07516989856958389, -0.042328789830207825, -0.12489776313304901, -0.22944197058677673, 0.44265317916870117, -0.19254255294799805, 0.07224048674106598, 0.27406084537506104, -0.1266958862543106, 0.035612236708402634, -0.06530951708555222, 0.3070811629295349, 0.14404165744781494, -0.2572271227836609, 0.09562107175588608, 0.004041291773319244, -0.11014997959136963, -0.013009496033191681, -0.025750624015927315, 0.0792459174990654, -0.22842007875442505, -0.3421907424926758, 0.2250162661075592, -0.16784855723381042, 0.2685824930667877, 0.20871514081954956, 0.24827389419078827, 0.08709130436182022, 0.3373471796512604, -0.27540260553359985, 0.022007297724485397, -0.23613813519477844, -0.19603271782398224, -0.18941564857959747, -0.13765454292297363, 0.22148294746875763, 0.33565178513526917, 0.19451121985912323, -0.3410741686820984, -0.24856320023536682, 0.07881910353899002, 0.49135810136795044, -0.1306176483631134, -0.20826470851898193, -0.13527116179466248, 0.12670336663722992, 0.4150709807872772, 0.11111826449632645, 0.425483763217926, -0.1380186229944229, -0.1203937754034996, -0.21549536287784576, 0.057632461190223694, -0.18095824122428894, -0.29855096340179443, 0.236887589097023, 0.09342896938323975, -0.14131808280944824, 0.012494992464780807, -0.19530931115150452, -0.20652753114700317, -0.10413315892219543, 0.3453899025917053, -0.04829101264476776, 0.07182597368955612, -0.05895145982503891, -0.009029572829604149, 0.16733375191688538, 0.3914467692375183, -0.46486231684684753, 0.2811201512813568, 0.06217803806066513, 0.4197710156440735, -0.2656343877315521, 0.31870418787002563, -0.07181254029273987, 0.1722499132156372, -0.11614037305116653, 0.008509308099746704, -0.244670569896698, -0.6641231179237366, -0.4377872347831726, 0.4218234121799469, -0.1620047390460968, 0.16865754127502441, 0.030979372560977936, 0.14459466934204102, 0.42355436086654663, -0.36917978525161743, 0.3288465142250061, 0.2769600749015808, -0.1284511536359787, 0.1686631292104721, -0.2560868263244629, -0.23015055060386658, -0.34304046630859375, 0.3827191889286041, 0.2105250358581543, -0.2159123718738556, 0.012101415544748306, 0.46206918358802795, 0.23962244391441345, 0.1523667424917221, 0.3582223951816559, 0.26409244537353516, 0.5892544388771057, -0.15352578461170197, -0.14096936583518982, -0.15002700686454773, -0.5206427574157715, 0.43066176772117615, 0.3863000273704529, -0.12492451071739197, -0.14289477467536926, -0.07865099608898163, -0.22074106335639954, 0.15172049403190613, -0.3061752915382385, 0.3593229055404663, -0.03207937255501747, -0.28083735704421997, -0.034529704600572586, 0.23081551492214203, 0.01316806674003601, 0.37530258297920227, -0.0534038171172142, 0.0001145191490650177, -0.08453143388032913, 0.589294970035553, 0.12691321969032288, -0.23005501925945282, 0.06565289199352264, 0.19912466406822205, 0.14771544933319092, -0.3349977135658264, -0.15287035703659058, 0.11965660005807877, 0.025633741170167923, 0.1757788360118866, 0.26884737610816956, 0.05140337347984314, 0.3028479516506195, -0.034123025834560394, 0.2301027476787567, 0.12599213421344757, -0.11914559453725815, -0.24972756206989288, -0.11160072684288025, 0.16405045986175537, -0.018670421093702316, 0.24425914883613586, -0.1308334469795227, 0.018514275550842285, 0.13719388842582703, -0.09259036928415298, 0.0758800134062767, 0.10112706571817398, 0.31888532638549805, -0.04317906126379967, 0.07725636661052704, -0.03980230540037155, 0.09870178997516632, 0.46279701590538025, 0.6134483218193054, 0.012248978018760681, -0.41306638717651367, 0.1094224750995636, -0.009646803140640259, 0.06047262251377106, 0.05362584441900253, 0.025167375802993774, -0.07241889834403992, 0.010686881840229034, -0.0824461579322815, -0.30172306299209595, -0.14531058073043823, -0.3921554684638977, -0.07417018711566925, 0.2588631510734558, 0.0007041282951831818, 0.1754174530506134, 0.08643867075443268, -0.12469619512557983, -0.139383465051651, -0.22530192136764526, 0.23488369584083557, 0.267243355512619, -0.07326918840408325, 0.01306074857711792, -0.25176653265953064, 0.19057311117649078, 0.11472766101360321, -0.3452693521976471, -0.4584461748600006, -0.5935556888580322, 0.03924757242202759, 0.41381070017814636, -0.005098491907119751, 0.15742459893226624, 0.22899895906448364, 0.227858304977417, 0.19770047068595886, -0.22055822610855103, -0.420364111661911, -0.2874385714530945, -0.06433404982089996, -0.10546663403511047, 0.6536206007003784, 0.11534883826971054, 0.1595478355884552, 0.24570858478546143, -0.060959890484809875, -0.41670650243759155, 0.036050885915756226, 0.014210517518222332, -0.1369485855102539, 0.2540033757686615, -0.3656550347805023, 0.25909745693206787, 0.044579774141311646, -0.0024777650833129883, 0.17514558136463165, -0.22877919673919678, 0.0010563060641288757, 0.2825095057487488, -0.023783313110470772, -0.23724283277988434, 0.030204840004444122, 0.19706696271896362, -0.03649286925792694, -0.5179988741874695, 0.1423984169960022, -0.1319684237241745, 0.01018792949616909, -0.03397040814161301, 0.25232237577438354, -0.07725120335817337, 0.13748645782470703, -0.5111334919929504, 0.10514205694198608, -0.4406029284000397, 0.15532219409942627, -0.03851146996021271, -0.2520192861557007, 0.038356222212314606, 0.1205354630947113, -0.09105511009693146, 0.15005257725715637, -0.6417413353919983, 0.056516218930482864, -0.4287385940551758, 0.3723188042640686, -0.027623241767287254, -0.19984112679958344, -0.044800642877817154, -0.11843064427375793, 0.021422982215881348, 0.08745451271533966, -0.0635109394788742, 0.11660970002412796, 0.44347894191741943, -0.14121459424495697, -0.03429589420557022, 0.23535628616809845, 0.19166912138462067, 0.2653641700744629, 0.23575785756111145, -0.14393195509910583, 0.27466556429862976, 0.31208908557891846, 0.2016386240720749, -0.3055754005908966, -0.20440888404846191, 0.1741175502538681, -0.07299759984016418, -0.27569931745529175, 0.0135960653424263, 0.004383929073810577, 0.3032492399215698, -0.05015849694609642, -0.13071033358573914, 0.22629301249980927, -0.5607283115386963, 0.02306339330971241, -0.21239283680915833, 0.03483888506889343, 0.0065180957317352295, -0.03357160836458206, -0.11715450882911682, -0.40232446789741516, 0.2563615143299103, -0.07678636908531189, 0.16888119280338287, -0.04085487127304077, 0.04937058687210083, 0.20073705911636353, -0.5037559270858765, 0.05050276964902878, -0.07239267230033875, 0.3635871410369873, -0.1539391577243805, 0.01953607052564621, 0.23668713867664337, -0.2818394899368286, 0.6828809380531311, -0.30027705430984497, 0.3237898051738739, -0.10701091587543488, 0.018488794565200806, -0.3644412159919739, -0.1723620593547821, -0.08260313421487808, 0.230376735329628, 0.002069476991891861, 0.7693324685096741, -0.08069546520709991, -0.3536863327026367, -0.19044020771980286, 0.1617283672094345, -0.23571264743804932, -0.22333142161369324, -0.16530045866966248, -0.2613714337348938, -0.3035412132740021, 0.22521772980690002, 0.10040123015642166, 0.15587183833122253, -0.2812294065952301, -0.3021184206008911, 0.026003604754805565, -0.0011469647288322449, 0.08619536459445953, -0.16672855615615845, -0.026849646121263504, 0.0362161323428154, 0.6639813184738159, -0.3151652216911316, 0.003426592331379652, 0.25937315821647644, 0.363582581281662, 0.2772989571094513, 0.13558177649974823, 0.1684017777442932, -0.07802929729223251, 0.16677631437778473, 0.8263382911682129, 0.1594078093767166, 0.23823609948158264, -0.2188805639743805, 0.33667007088661194, -0.4187341332435608, 0.003567427396774292, 0.19658835232257843, -0.09242197871208191, -0.16093581914901733, 0.24352499842643738, 0.41675865650177, -0.09666501730680466, 0.10659737884998322, 0.1142304539680481, 0.3840652108192444, 0.1764860451221466, 0.20738890767097473, 0.13277371227741241, 0.9799233675003052, -0.3102877736091614, 0.16982372105121613, -0.04234737157821655, -0.0031089261174201965, -0.04354431852698326, -0.6333492994308472, -0.11661183834075928, -0.20017999410629272, -0.3024233281612396, 0.11174935102462769, 0.08568943291902542, -0.10316911339759827, 0.055813271552324295, -0.09285952150821686, 0.0855586901307106, -0.19770905375480652, 0.41906434297561646, -0.19767966866493225, 0.2439996302127838, -0.32617297768592834, -0.4959625005722046, -0.15647678077220917, 0.16487178206443787, 0.031437039375305176, -0.04853859543800354, -0.059421706944704056, 0.011713005602359772, -0.13057313859462738, 0.18725842237472534, -0.31405773758888245, 0.021645426750183105, 0.31231430172920227, -0.02313263900578022, -0.14394286274909973, -0.14292877912521362, 0.05420947074890137, -0.5641478300094604, 0.30512750148773193, 0.23124092817306519, -0.17710986733436584, 0.3257598876953125, -0.15534146130084991, 0.021448682993650436, 0.17042016983032227, -0.1134125217795372, 0.26708027720451355, 0.07743698358535767, -0.11875835806131363, 0.16013307869434357, 0.16236057877540588, -0.19428834319114685, -0.09682602435350418, -0.015537142753601074, -0.015437187626957893, -0.01255611702799797, -0.06439370661973953, 0.093236543238163, -0.10974498838186264, -0.16716268658638, 0.05558819696307182, 0.05979766696691513, -0.1893545538187027, 0.3783528208732605, -0.09678718447685242, -0.15456964075565338, -0.008890262804925442, 0.3713226616382599, -0.32756173610687256, -0.19321994483470917, 0.09207242727279663, 0.31886476278305054, -0.18478575348854065, -0.20151659846305847, 0.3515964150428772, -0.012421196326613426, -0.5109376907348633, 0.2792467772960663, -0.35034340620040894, -0.01118190586566925, 0.16701765358448029, 0.016943996772170067, -0.006683635991066694, -0.19413642585277557, -0.16645605862140656, -0.09571659564971924, -0.14830030500888824, -0.05033358186483383, 0.10745757818222046, 0.2067873179912567, -0.4769432544708252, 0.09458194673061371, -0.021793771535158157, 0.40373659133911133, -0.19476406276226044, 0.16495415568351746, -0.3420085608959198, 0.23262569308280945, -0.29311177134513855, -0.45957010984420776, 0.037413790822029114, -0.2678847014904022, -0.045747481286525726, 0.09241914004087448, -0.1529419869184494, -0.12227412313222885, -0.23628827929496765, 0.19033539295196533, 0.189319908618927, 0.17391738295555115, -0.16682016849517822, -0.34320151805877686, 0.17436756193637848, -0.17570532858371735, 0.18915046751499176, 0.1338556706905365, -0.0990087017416954, -0.2690891921520233, 0.7326576113700867, 0.19018957018852234, -0.024524956941604614, 0.44166213274002075, 0.46100103855133057, 0.5311329960823059, -0.028858959674835205, 0.03738952428102493, 0.05452367290854454, 0.04260316491127014, -0.28762519359588623, 0.3660692274570465, 0.28036263585090637, 0.04939091578125954, 0.39158010482788086, -0.2303597778081894, 0.1374913603067398, 0.08632475137710571, 0.37588220834732056, 0.49084779620170593, -0.035772256553173065, -0.49716076254844666, 0.24364681541919708, 0.09298495948314667, 0.10267966985702515, -0.24107787013053894, 0.2818644344806671, -0.05562826991081238, -0.03644116222858429, 0.20599883794784546, 0.18303625285625458, -0.29970067739486694, -0.010596934705972672, 0.3796977996826172, 0.5373080372810364, -0.1991109848022461, -0.3758561313152313, -0.0419774167239666, 0.12178318202495575, -0.009604385122656822, 0.024430690333247185, -0.11847929656505585, 0.21105073392391205, 0.8026148080825806, 0.06376732885837555, 0.1803985834121704, 0.1867927610874176, -0.07245159149169922, 0.18699227273464203, -0.12172377109527588, -0.3046778440475464, 0.10303465276956558, -0.15545590221881866, -0.04155028238892555, 0.07164712250232697, 0.21780909597873688, -0.18861845135688782, -0.1876366287469864, -0.4336097240447998, 0.06782592833042145, -0.14034484326839447, 0.23643556237220764, 0.07064389437437057, 0.011292919516563416, -0.40676021575927734, 0.23104017972946167, -0.06329773366451263, 0.22097136080265045, 0.4582326114177704, 0.5591541528701782, 0.21365556120872498, 0.24056142568588257, -0.21015866100788116, -0.06845530867576599, 0.22913074493408203, -0.18099212646484375, 0.09044861048460007, 0.4119534194469452, -0.2922443151473999, -0.23383483290672302, -0.24112413823604584, 0.22108159959316254, 0.19341081380844116, -0.45813703536987305, 0.43371787667274475, 0.3062591850757599, 0.06670287996530533, 0.0987987220287323, 0.18956217169761658, -0.18546995520591736, 0.20504236221313477, 0.1533985584974289, 0.031063273549079895, -0.0819806158542633, -0.3525286018848419, -0.030681375414133072, 0.3223510682582855, -0.05932959169149399, 0.42182379961013794, 0.11201243102550507, -0.17466874420642853, -0.21328380703926086, -0.058081768453121185, -0.22172901034355164, -0.09328427910804749, 0.26636549830436707, -0.5355953574180603, 0.07447651028633118, -0.1866752654314041, 0.02572821080684662, -0.4233056902885437, 0.6617635488510132, 0.24154812097549438, 0.07221417129039764, -0.35519134998321533, -0.29439595341682434, -0.23527970910072327, 0.2907281517982483, -0.4481869339942932, -0.014662988483905792, 0.06173192709684372, 0.4491553008556366, 0.06895572692155838, 0.025518983602523804, -0.2532501816749573, -0.25601741671562195, -0.12963348627090454, 0.28376272320747375, -0.13120701909065247, 0.06262820959091187, 0.12757046520709991, 0.015935787931084633, -0.14396265149116516, -0.4498974680900574, 0.3557792901992798, 0.10339139401912689, -0.036318931728601456, 0.08136772364377975, -0.23051905632019043, 0.4120981991291046, -0.2536555528640747, 0.02452188730239868, -0.18090640008449554, 0.012954097241163254, 0.0780438557267189, -0.27691221237182617, -0.3581109642982483, -0.106882244348526, 0.034435685724020004, -0.29862281680107117, -0.1686069518327713, 0.10910940170288086, 0.020840056240558624, 0.03685014694929123, -0.1390921026468277, 0.1992226094007492, -0.08289027959108353, 0.38733887672424316, 0.08963944017887115, -0.18663540482521057, -0.26398766040802, 0.3944457173347473, 0.28055137395858765, 0.23066475987434387, 0.1072213351726532, 0.3361835479736328, -0.43927863240242004, -0.1555042266845703, 0.3613762855529785, 0.2324036955833435, -0.4046543836593628, 0.006576307117938995, 0.25290530920028687, -0.18358075618743896, -0.02321651205420494, -0.13050611317157745, -0.12933382391929626, -0.013140063732862473, -0.005518182180821896, -0.12338262796401978, 0.33634501695632935, 0.07808706164360046, -0.08841875195503235, -0.07756863534450531, 0.000375114381313324, 0.07786931842565536, 0.020994901657104492, 0.12060888111591339, 0.1628909409046173 ]
https://github.com/huggingface/datasets/issues/5990
@lhoestq @AntreasAntoniou I transferred this issue to the `datasets` repository as the questions and answers are more related to this repo. Hope it can help other users find the bug and fixes more easily (like updating [tqdm](https://github.com/huggingface/datasets/issues/5990#issuecomment-1607120204) and [pyarrow](https://github.com/huggingface/datasets/issues/5990#issuecomment-1607120278) or [setting a lower `max_shard_size`](https://github.com/huggingface/datasets/issues/5990#issuecomment-1607120328)). ~For the initial "pushing large dataset consistently hangs"-issue, I still think it's best to try to `save_to_disk` first and then upload it manually/with a script (see [upload_folder](https://huggingface.co/docs/huggingface_hub/guides/upload#upload-a-folder)). It's not the most satisfying solution but at least it would confirm from where the problem comes from.~ **EDIT:** removed suggestion about saving to disk first (see https://github.com/huggingface/datasets/issues/5990#issuecomment-1607186914).
Pushing a large dataset on the hub consistently hangs
### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
99
Pushing a large dataset on the hub consistently hangs ### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` @lhoestq @AntreasAntoniou I transferred this issue to the `datasets` repository as the questions and answers are more related to this repo. Hope it can help other users find the bug and fixes more easily (like updating [tqdm](https://github.com/huggingface/datasets/issues/5990#issuecomment-1607120204) and [pyarrow](https://github.com/huggingface/datasets/issues/5990#issuecomment-1607120278) or [setting a lower `max_shard_size`](https://github.com/huggingface/datasets/issues/5990#issuecomment-1607120328)). ~For the initial "pushing large dataset consistently hangs"-issue, I still think it's best to try to `save_to_disk` first and then upload it manually/with a script (see [upload_folder](https://huggingface.co/docs/huggingface_hub/guides/upload#upload-a-folder)). It's not the most satisfying solution but at least it would confirm from where the problem comes from.~ **EDIT:** removed suggestion about saving to disk first (see https://github.com/huggingface/datasets/issues/5990#issuecomment-1607186914).
[ -0.3251087963581085, -0.42933112382888794, -0.06096188724040985, 0.08869528025388718, 0.21317243576049805, -0.06696006655693054, 0.1970674693584442, 0.5384528636932373, 0.05225852131843567, 0.3061686158180237, 0.08448541909456253, 0.10903309285640717, 0.03724048659205437, 0.22024406492710114, 0.14667896926403046, 0.2332618236541748, 0.25349166989326477, -0.10799236595630646, 0.27970409393310547, -0.06858120858669281, -0.06573061645030975, -0.15738080441951752, 0.10763393342494965, -0.10093242675065994, -0.7575782537460327, 0.04432877153158188, 0.22587668895721436, 0.2064542919397354, 0.1921502649784088, -0.16747573018074036, 0.20722517371177673, 0.25278791785240173, -0.16246680915355682, 0.6471035480499268, -0.00012341895489953458, -0.05790407583117485, 0.25191041827201843, 0.02304328978061676, -0.3664642572402954, 0.09019968658685684, -0.10475093126296997, -0.13000282645225525, -0.2037355899810791, 0.1003957986831665, 0.03635609894990921, 0.45928943157196045, -0.19047336280345917, -0.16487863659858704, 0.21318119764328003, -0.0651368647813797, 0.02760709449648857, 0.17410922050476074, 0.014200866222381592, -0.24395343661308289, 0.20720058679580688, 0.13026978075504303, -0.30730724334716797, -0.07190019637346268, 0.49071699380874634, 0.13820913434028625, -0.1179051548242569, -0.07936432957649231, -0.11190301179885864, -0.11168365180492401, 0.016268212348222733, -0.3535960912704468, -0.089785136282444, -0.3143678307533264, 0.34380003809928894, 0.24355612695217133, 0.14077115058898926, -0.08090770244598389, -0.2698417603969574, -0.07041946053504944, -0.11939385533332825, -0.1470957100391388, 0.28435736894607544, 0.16139265894889832, -0.2762324810028076, 0.0654551237821579, -0.13129226863384247, -0.4053599536418915, -0.12707537412643433, -0.03554612770676613, -0.14915555715560913, -0.03168031945824623, 0.1751161366701126, 0.08743235468864441, 0.2067568451166153, -0.05901416763663292, 0.3941405117511749, -0.2691796123981476, 0.0901857241988182, -0.2755673825740814, -0.41740137338638306, 0.13888457417488098, 0.08934485912322998, 0.07516989856958389, -0.042328789830207825, -0.12489776313304901, -0.22944197058677673, 0.44265317916870117, -0.19254255294799805, 0.07224048674106598, 0.27406084537506104, -0.1266958862543106, 0.035612236708402634, -0.06530951708555222, 0.3070811629295349, 0.14404165744781494, -0.2572271227836609, 0.09562107175588608, 0.004041291773319244, -0.11014997959136963, -0.013009496033191681, -0.025750624015927315, 0.0792459174990654, -0.22842007875442505, -0.3421907424926758, 0.2250162661075592, -0.16784855723381042, 0.2685824930667877, 0.20871514081954956, 0.24827389419078827, 0.08709130436182022, 0.3373471796512604, -0.27540260553359985, 0.022007297724485397, -0.23613813519477844, -0.19603271782398224, -0.18941564857959747, -0.13765454292297363, 0.22148294746875763, 0.33565178513526917, 0.19451121985912323, -0.3410741686820984, -0.24856320023536682, 0.07881910353899002, 0.49135810136795044, -0.1306176483631134, -0.20826470851898193, -0.13527116179466248, 0.12670336663722992, 0.4150709807872772, 0.11111826449632645, 0.425483763217926, -0.1380186229944229, -0.1203937754034996, -0.21549536287784576, 0.057632461190223694, -0.18095824122428894, -0.29855096340179443, 0.236887589097023, 0.09342896938323975, -0.14131808280944824, 0.012494992464780807, -0.19530931115150452, -0.20652753114700317, -0.10413315892219543, 0.3453899025917053, -0.04829101264476776, 0.07182597368955612, -0.05895145982503891, -0.009029572829604149, 0.16733375191688538, 0.3914467692375183, -0.46486231684684753, 0.2811201512813568, 0.06217803806066513, 0.4197710156440735, -0.2656343877315521, 0.31870418787002563, -0.07181254029273987, 0.1722499132156372, -0.11614037305116653, 0.008509308099746704, -0.244670569896698, -0.6641231179237366, -0.4377872347831726, 0.4218234121799469, -0.1620047390460968, 0.16865754127502441, 0.030979372560977936, 0.14459466934204102, 0.42355436086654663, -0.36917978525161743, 0.3288465142250061, 0.2769600749015808, -0.1284511536359787, 0.1686631292104721, -0.2560868263244629, -0.23015055060386658, -0.34304046630859375, 0.3827191889286041, 0.2105250358581543, -0.2159123718738556, 0.012101415544748306, 0.46206918358802795, 0.23962244391441345, 0.1523667424917221, 0.3582223951816559, 0.26409244537353516, 0.5892544388771057, -0.15352578461170197, -0.14096936583518982, -0.15002700686454773, -0.5206427574157715, 0.43066176772117615, 0.3863000273704529, -0.12492451071739197, -0.14289477467536926, -0.07865099608898163, -0.22074106335639954, 0.15172049403190613, -0.3061752915382385, 0.3593229055404663, -0.03207937255501747, -0.28083735704421997, -0.034529704600572586, 0.23081551492214203, 0.01316806674003601, 0.37530258297920227, -0.0534038171172142, 0.0001145191490650177, -0.08453143388032913, 0.589294970035553, 0.12691321969032288, -0.23005501925945282, 0.06565289199352264, 0.19912466406822205, 0.14771544933319092, -0.3349977135658264, -0.15287035703659058, 0.11965660005807877, 0.025633741170167923, 0.1757788360118866, 0.26884737610816956, 0.05140337347984314, 0.3028479516506195, -0.034123025834560394, 0.2301027476787567, 0.12599213421344757, -0.11914559453725815, -0.24972756206989288, -0.11160072684288025, 0.16405045986175537, -0.018670421093702316, 0.24425914883613586, -0.1308334469795227, 0.018514275550842285, 0.13719388842582703, -0.09259036928415298, 0.0758800134062767, 0.10112706571817398, 0.31888532638549805, -0.04317906126379967, 0.07725636661052704, -0.03980230540037155, 0.09870178997516632, 0.46279701590538025, 0.6134483218193054, 0.012248978018760681, -0.41306638717651367, 0.1094224750995636, -0.009646803140640259, 0.06047262251377106, 0.05362584441900253, 0.025167375802993774, -0.07241889834403992, 0.010686881840229034, -0.0824461579322815, -0.30172306299209595, -0.14531058073043823, -0.3921554684638977, -0.07417018711566925, 0.2588631510734558, 0.0007041282951831818, 0.1754174530506134, 0.08643867075443268, -0.12469619512557983, -0.139383465051651, -0.22530192136764526, 0.23488369584083557, 0.267243355512619, -0.07326918840408325, 0.01306074857711792, -0.25176653265953064, 0.19057311117649078, 0.11472766101360321, -0.3452693521976471, -0.4584461748600006, -0.5935556888580322, 0.03924757242202759, 0.41381070017814636, -0.005098491907119751, 0.15742459893226624, 0.22899895906448364, 0.227858304977417, 0.19770047068595886, -0.22055822610855103, -0.420364111661911, -0.2874385714530945, -0.06433404982089996, -0.10546663403511047, 0.6536206007003784, 0.11534883826971054, 0.1595478355884552, 0.24570858478546143, -0.060959890484809875, -0.41670650243759155, 0.036050885915756226, 0.014210517518222332, -0.1369485855102539, 0.2540033757686615, -0.3656550347805023, 0.25909745693206787, 0.044579774141311646, -0.0024777650833129883, 0.17514558136463165, -0.22877919673919678, 0.0010563060641288757, 0.2825095057487488, -0.023783313110470772, -0.23724283277988434, 0.030204840004444122, 0.19706696271896362, -0.03649286925792694, -0.5179988741874695, 0.1423984169960022, -0.1319684237241745, 0.01018792949616909, -0.03397040814161301, 0.25232237577438354, -0.07725120335817337, 0.13748645782470703, -0.5111334919929504, 0.10514205694198608, -0.4406029284000397, 0.15532219409942627, -0.03851146996021271, -0.2520192861557007, 0.038356222212314606, 0.1205354630947113, -0.09105511009693146, 0.15005257725715637, -0.6417413353919983, 0.056516218930482864, -0.4287385940551758, 0.3723188042640686, -0.027623241767287254, -0.19984112679958344, -0.044800642877817154, -0.11843064427375793, 0.021422982215881348, 0.08745451271533966, -0.0635109394788742, 0.11660970002412796, 0.44347894191741943, -0.14121459424495697, -0.03429589420557022, 0.23535628616809845, 0.19166912138462067, 0.2653641700744629, 0.23575785756111145, -0.14393195509910583, 0.27466556429862976, 0.31208908557891846, 0.2016386240720749, -0.3055754005908966, -0.20440888404846191, 0.1741175502538681, -0.07299759984016418, -0.27569931745529175, 0.0135960653424263, 0.004383929073810577, 0.3032492399215698, -0.05015849694609642, -0.13071033358573914, 0.22629301249980927, -0.5607283115386963, 0.02306339330971241, -0.21239283680915833, 0.03483888506889343, 0.0065180957317352295, -0.03357160836458206, -0.11715450882911682, -0.40232446789741516, 0.2563615143299103, -0.07678636908531189, 0.16888119280338287, -0.04085487127304077, 0.04937058687210083, 0.20073705911636353, -0.5037559270858765, 0.05050276964902878, -0.07239267230033875, 0.3635871410369873, -0.1539391577243805, 0.01953607052564621, 0.23668713867664337, -0.2818394899368286, 0.6828809380531311, -0.30027705430984497, 0.3237898051738739, -0.10701091587543488, 0.018488794565200806, -0.3644412159919739, -0.1723620593547821, -0.08260313421487808, 0.230376735329628, 0.002069476991891861, 0.7693324685096741, -0.08069546520709991, -0.3536863327026367, -0.19044020771980286, 0.1617283672094345, -0.23571264743804932, -0.22333142161369324, -0.16530045866966248, -0.2613714337348938, -0.3035412132740021, 0.22521772980690002, 0.10040123015642166, 0.15587183833122253, -0.2812294065952301, -0.3021184206008911, 0.026003604754805565, -0.0011469647288322449, 0.08619536459445953, -0.16672855615615845, -0.026849646121263504, 0.0362161323428154, 0.6639813184738159, -0.3151652216911316, 0.003426592331379652, 0.25937315821647644, 0.363582581281662, 0.2772989571094513, 0.13558177649974823, 0.1684017777442932, -0.07802929729223251, 0.16677631437778473, 0.8263382911682129, 0.1594078093767166, 0.23823609948158264, -0.2188805639743805, 0.33667007088661194, -0.4187341332435608, 0.003567427396774292, 0.19658835232257843, -0.09242197871208191, -0.16093581914901733, 0.24352499842643738, 0.41675865650177, -0.09666501730680466, 0.10659737884998322, 0.1142304539680481, 0.3840652108192444, 0.1764860451221466, 0.20738890767097473, 0.13277371227741241, 0.9799233675003052, -0.3102877736091614, 0.16982372105121613, -0.04234737157821655, -0.0031089261174201965, -0.04354431852698326, -0.6333492994308472, -0.11661183834075928, -0.20017999410629272, -0.3024233281612396, 0.11174935102462769, 0.08568943291902542, -0.10316911339759827, 0.055813271552324295, -0.09285952150821686, 0.0855586901307106, -0.19770905375480652, 0.41906434297561646, -0.19767966866493225, 0.2439996302127838, -0.32617297768592834, -0.4959625005722046, -0.15647678077220917, 0.16487178206443787, 0.031437039375305176, -0.04853859543800354, -0.059421706944704056, 0.011713005602359772, -0.13057313859462738, 0.18725842237472534, -0.31405773758888245, 0.021645426750183105, 0.31231430172920227, -0.02313263900578022, -0.14394286274909973, -0.14292877912521362, 0.05420947074890137, -0.5641478300094604, 0.30512750148773193, 0.23124092817306519, -0.17710986733436584, 0.3257598876953125, -0.15534146130084991, 0.021448682993650436, 0.17042016983032227, -0.1134125217795372, 0.26708027720451355, 0.07743698358535767, -0.11875835806131363, 0.16013307869434357, 0.16236057877540588, -0.19428834319114685, -0.09682602435350418, -0.015537142753601074, -0.015437187626957893, -0.01255611702799797, -0.06439370661973953, 0.093236543238163, -0.10974498838186264, -0.16716268658638, 0.05558819696307182, 0.05979766696691513, -0.1893545538187027, 0.3783528208732605, -0.09678718447685242, -0.15456964075565338, -0.008890262804925442, 0.3713226616382599, -0.32756173610687256, -0.19321994483470917, 0.09207242727279663, 0.31886476278305054, -0.18478575348854065, -0.20151659846305847, 0.3515964150428772, -0.012421196326613426, -0.5109376907348633, 0.2792467772960663, -0.35034340620040894, -0.01118190586566925, 0.16701765358448029, 0.016943996772170067, -0.006683635991066694, -0.19413642585277557, -0.16645605862140656, -0.09571659564971924, -0.14830030500888824, -0.05033358186483383, 0.10745757818222046, 0.2067873179912567, -0.4769432544708252, 0.09458194673061371, -0.021793771535158157, 0.40373659133911133, -0.19476406276226044, 0.16495415568351746, -0.3420085608959198, 0.23262569308280945, -0.29311177134513855, -0.45957010984420776, 0.037413790822029114, -0.2678847014904022, -0.045747481286525726, 0.09241914004087448, -0.1529419869184494, -0.12227412313222885, -0.23628827929496765, 0.19033539295196533, 0.189319908618927, 0.17391738295555115, -0.16682016849517822, -0.34320151805877686, 0.17436756193637848, -0.17570532858371735, 0.18915046751499176, 0.1338556706905365, -0.0990087017416954, -0.2690891921520233, 0.7326576113700867, 0.19018957018852234, -0.024524956941604614, 0.44166213274002075, 0.46100103855133057, 0.5311329960823059, -0.028858959674835205, 0.03738952428102493, 0.05452367290854454, 0.04260316491127014, -0.28762519359588623, 0.3660692274570465, 0.28036263585090637, 0.04939091578125954, 0.39158010482788086, -0.2303597778081894, 0.1374913603067398, 0.08632475137710571, 0.37588220834732056, 0.49084779620170593, -0.035772256553173065, -0.49716076254844666, 0.24364681541919708, 0.09298495948314667, 0.10267966985702515, -0.24107787013053894, 0.2818644344806671, -0.05562826991081238, -0.03644116222858429, 0.20599883794784546, 0.18303625285625458, -0.29970067739486694, -0.010596934705972672, 0.3796977996826172, 0.5373080372810364, -0.1991109848022461, -0.3758561313152313, -0.0419774167239666, 0.12178318202495575, -0.009604385122656822, 0.024430690333247185, -0.11847929656505585, 0.21105073392391205, 0.8026148080825806, 0.06376732885837555, 0.1803985834121704, 0.1867927610874176, -0.07245159149169922, 0.18699227273464203, -0.12172377109527588, -0.3046778440475464, 0.10303465276956558, -0.15545590221881866, -0.04155028238892555, 0.07164712250232697, 0.21780909597873688, -0.18861845135688782, -0.1876366287469864, -0.4336097240447998, 0.06782592833042145, -0.14034484326839447, 0.23643556237220764, 0.07064389437437057, 0.011292919516563416, -0.40676021575927734, 0.23104017972946167, -0.06329773366451263, 0.22097136080265045, 0.4582326114177704, 0.5591541528701782, 0.21365556120872498, 0.24056142568588257, -0.21015866100788116, -0.06845530867576599, 0.22913074493408203, -0.18099212646484375, 0.09044861048460007, 0.4119534194469452, -0.2922443151473999, -0.23383483290672302, -0.24112413823604584, 0.22108159959316254, 0.19341081380844116, -0.45813703536987305, 0.43371787667274475, 0.3062591850757599, 0.06670287996530533, 0.0987987220287323, 0.18956217169761658, -0.18546995520591736, 0.20504236221313477, 0.1533985584974289, 0.031063273549079895, -0.0819806158542633, -0.3525286018848419, -0.030681375414133072, 0.3223510682582855, -0.05932959169149399, 0.42182379961013794, 0.11201243102550507, -0.17466874420642853, -0.21328380703926086, -0.058081768453121185, -0.22172901034355164, -0.09328427910804749, 0.26636549830436707, -0.5355953574180603, 0.07447651028633118, -0.1866752654314041, 0.02572821080684662, -0.4233056902885437, 0.6617635488510132, 0.24154812097549438, 0.07221417129039764, -0.35519134998321533, -0.29439595341682434, -0.23527970910072327, 0.2907281517982483, -0.4481869339942932, -0.014662988483905792, 0.06173192709684372, 0.4491553008556366, 0.06895572692155838, 0.025518983602523804, -0.2532501816749573, -0.25601741671562195, -0.12963348627090454, 0.28376272320747375, -0.13120701909065247, 0.06262820959091187, 0.12757046520709991, 0.015935787931084633, -0.14396265149116516, -0.4498974680900574, 0.3557792901992798, 0.10339139401912689, -0.036318931728601456, 0.08136772364377975, -0.23051905632019043, 0.4120981991291046, -0.2536555528640747, 0.02452188730239868, -0.18090640008449554, 0.012954097241163254, 0.0780438557267189, -0.27691221237182617, -0.3581109642982483, -0.106882244348526, 0.034435685724020004, -0.29862281680107117, -0.1686069518327713, 0.10910940170288086, 0.020840056240558624, 0.03685014694929123, -0.1390921026468277, 0.1992226094007492, -0.08289027959108353, 0.38733887672424316, 0.08963944017887115, -0.18663540482521057, -0.26398766040802, 0.3944457173347473, 0.28055137395858765, 0.23066475987434387, 0.1072213351726532, 0.3361835479736328, -0.43927863240242004, -0.1555042266845703, 0.3613762855529785, 0.2324036955833435, -0.4046543836593628, 0.006576307117938995, 0.25290530920028687, -0.18358075618743896, -0.02321651205420494, -0.13050611317157745, -0.12933382391929626, -0.013140063732862473, -0.005518182180821896, -0.12338262796401978, 0.33634501695632935, 0.07808706164360046, -0.08841875195503235, -0.07756863534450531, 0.000375114381313324, 0.07786931842565536, 0.020994901657104492, 0.12060888111591339, 0.1628909409046173 ]
https://github.com/huggingface/datasets/issues/5990
> @lhoestq @AntreasAntoniou I transferred this issue to the datasets repository as the questions and answers are more related to this repo. Hope it can help other users find the bug and fixes more easily (like updating https://github.com/huggingface/datasets/issues/5990#issuecomment-1607120204 and https://github.com/huggingface/datasets/issues/5990#issuecomment-1607120278 or https://github.com/huggingface/datasets/issues/5990#issuecomment-1607120328). thanks :) > For the initial "pushing large dataset consistently hangs"-issue, I still think it's best to try to save_to_disk first and then upload it manually/with a script (see [upload_folder](https://huggingface.co/docs/huggingface_hub/guides/upload#upload-a-folder)). It's not the most satisfying solution but at least it would confirm from where the problem comes from. As I've already said in other discussions, I would not recommend pushing files saved with `save_to_disk` to the Hub but save to parquet shards and upload them instead. The Hub does not support datasets saved with `save_to_disk`, which is meant for disk only.
Pushing a large dataset on the hub consistently hangs
### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
133
Pushing a large dataset on the hub consistently hangs ### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` > @lhoestq @AntreasAntoniou I transferred this issue to the datasets repository as the questions and answers are more related to this repo. Hope it can help other users find the bug and fixes more easily (like updating https://github.com/huggingface/datasets/issues/5990#issuecomment-1607120204 and https://github.com/huggingface/datasets/issues/5990#issuecomment-1607120278 or https://github.com/huggingface/datasets/issues/5990#issuecomment-1607120328). thanks :) > For the initial "pushing large dataset consistently hangs"-issue, I still think it's best to try to save_to_disk first and then upload it manually/with a script (see [upload_folder](https://huggingface.co/docs/huggingface_hub/guides/upload#upload-a-folder)). It's not the most satisfying solution but at least it would confirm from where the problem comes from. As I've already said in other discussions, I would not recommend pushing files saved with `save_to_disk` to the Hub but save to parquet shards and upload them instead. The Hub does not support datasets saved with `save_to_disk`, which is meant for disk only.
[ -0.3251087963581085, -0.42933112382888794, -0.06096188724040985, 0.08869528025388718, 0.21317243576049805, -0.06696006655693054, 0.1970674693584442, 0.5384528636932373, 0.05225852131843567, 0.3061686158180237, 0.08448541909456253, 0.10903309285640717, 0.03724048659205437, 0.22024406492710114, 0.14667896926403046, 0.2332618236541748, 0.25349166989326477, -0.10799236595630646, 0.27970409393310547, -0.06858120858669281, -0.06573061645030975, -0.15738080441951752, 0.10763393342494965, -0.10093242675065994, -0.7575782537460327, 0.04432877153158188, 0.22587668895721436, 0.2064542919397354, 0.1921502649784088, -0.16747573018074036, 0.20722517371177673, 0.25278791785240173, -0.16246680915355682, 0.6471035480499268, -0.00012341895489953458, -0.05790407583117485, 0.25191041827201843, 0.02304328978061676, -0.3664642572402954, 0.09019968658685684, -0.10475093126296997, -0.13000282645225525, -0.2037355899810791, 0.1003957986831665, 0.03635609894990921, 0.45928943157196045, -0.19047336280345917, -0.16487863659858704, 0.21318119764328003, -0.0651368647813797, 0.02760709449648857, 0.17410922050476074, 0.014200866222381592, -0.24395343661308289, 0.20720058679580688, 0.13026978075504303, -0.30730724334716797, -0.07190019637346268, 0.49071699380874634, 0.13820913434028625, -0.1179051548242569, -0.07936432957649231, -0.11190301179885864, -0.11168365180492401, 0.016268212348222733, -0.3535960912704468, -0.089785136282444, -0.3143678307533264, 0.34380003809928894, 0.24355612695217133, 0.14077115058898926, -0.08090770244598389, -0.2698417603969574, -0.07041946053504944, -0.11939385533332825, -0.1470957100391388, 0.28435736894607544, 0.16139265894889832, -0.2762324810028076, 0.0654551237821579, -0.13129226863384247, -0.4053599536418915, -0.12707537412643433, -0.03554612770676613, -0.14915555715560913, -0.03168031945824623, 0.1751161366701126, 0.08743235468864441, 0.2067568451166153, -0.05901416763663292, 0.3941405117511749, -0.2691796123981476, 0.0901857241988182, -0.2755673825740814, -0.41740137338638306, 0.13888457417488098, 0.08934485912322998, 0.07516989856958389, -0.042328789830207825, -0.12489776313304901, -0.22944197058677673, 0.44265317916870117, -0.19254255294799805, 0.07224048674106598, 0.27406084537506104, -0.1266958862543106, 0.035612236708402634, -0.06530951708555222, 0.3070811629295349, 0.14404165744781494, -0.2572271227836609, 0.09562107175588608, 0.004041291773319244, -0.11014997959136963, -0.013009496033191681, -0.025750624015927315, 0.0792459174990654, -0.22842007875442505, -0.3421907424926758, 0.2250162661075592, -0.16784855723381042, 0.2685824930667877, 0.20871514081954956, 0.24827389419078827, 0.08709130436182022, 0.3373471796512604, -0.27540260553359985, 0.022007297724485397, -0.23613813519477844, -0.19603271782398224, -0.18941564857959747, -0.13765454292297363, 0.22148294746875763, 0.33565178513526917, 0.19451121985912323, -0.3410741686820984, -0.24856320023536682, 0.07881910353899002, 0.49135810136795044, -0.1306176483631134, -0.20826470851898193, -0.13527116179466248, 0.12670336663722992, 0.4150709807872772, 0.11111826449632645, 0.425483763217926, -0.1380186229944229, -0.1203937754034996, -0.21549536287784576, 0.057632461190223694, -0.18095824122428894, -0.29855096340179443, 0.236887589097023, 0.09342896938323975, -0.14131808280944824, 0.012494992464780807, -0.19530931115150452, -0.20652753114700317, -0.10413315892219543, 0.3453899025917053, -0.04829101264476776, 0.07182597368955612, -0.05895145982503891, -0.009029572829604149, 0.16733375191688538, 0.3914467692375183, -0.46486231684684753, 0.2811201512813568, 0.06217803806066513, 0.4197710156440735, -0.2656343877315521, 0.31870418787002563, -0.07181254029273987, 0.1722499132156372, -0.11614037305116653, 0.008509308099746704, -0.244670569896698, -0.6641231179237366, -0.4377872347831726, 0.4218234121799469, -0.1620047390460968, 0.16865754127502441, 0.030979372560977936, 0.14459466934204102, 0.42355436086654663, -0.36917978525161743, 0.3288465142250061, 0.2769600749015808, -0.1284511536359787, 0.1686631292104721, -0.2560868263244629, -0.23015055060386658, -0.34304046630859375, 0.3827191889286041, 0.2105250358581543, -0.2159123718738556, 0.012101415544748306, 0.46206918358802795, 0.23962244391441345, 0.1523667424917221, 0.3582223951816559, 0.26409244537353516, 0.5892544388771057, -0.15352578461170197, -0.14096936583518982, -0.15002700686454773, -0.5206427574157715, 0.43066176772117615, 0.3863000273704529, -0.12492451071739197, -0.14289477467536926, -0.07865099608898163, -0.22074106335639954, 0.15172049403190613, -0.3061752915382385, 0.3593229055404663, -0.03207937255501747, -0.28083735704421997, -0.034529704600572586, 0.23081551492214203, 0.01316806674003601, 0.37530258297920227, -0.0534038171172142, 0.0001145191490650177, -0.08453143388032913, 0.589294970035553, 0.12691321969032288, -0.23005501925945282, 0.06565289199352264, 0.19912466406822205, 0.14771544933319092, -0.3349977135658264, -0.15287035703659058, 0.11965660005807877, 0.025633741170167923, 0.1757788360118866, 0.26884737610816956, 0.05140337347984314, 0.3028479516506195, -0.034123025834560394, 0.2301027476787567, 0.12599213421344757, -0.11914559453725815, -0.24972756206989288, -0.11160072684288025, 0.16405045986175537, -0.018670421093702316, 0.24425914883613586, -0.1308334469795227, 0.018514275550842285, 0.13719388842582703, -0.09259036928415298, 0.0758800134062767, 0.10112706571817398, 0.31888532638549805, -0.04317906126379967, 0.07725636661052704, -0.03980230540037155, 0.09870178997516632, 0.46279701590538025, 0.6134483218193054, 0.012248978018760681, -0.41306638717651367, 0.1094224750995636, -0.009646803140640259, 0.06047262251377106, 0.05362584441900253, 0.025167375802993774, -0.07241889834403992, 0.010686881840229034, -0.0824461579322815, -0.30172306299209595, -0.14531058073043823, -0.3921554684638977, -0.07417018711566925, 0.2588631510734558, 0.0007041282951831818, 0.1754174530506134, 0.08643867075443268, -0.12469619512557983, -0.139383465051651, -0.22530192136764526, 0.23488369584083557, 0.267243355512619, -0.07326918840408325, 0.01306074857711792, -0.25176653265953064, 0.19057311117649078, 0.11472766101360321, -0.3452693521976471, -0.4584461748600006, -0.5935556888580322, 0.03924757242202759, 0.41381070017814636, -0.005098491907119751, 0.15742459893226624, 0.22899895906448364, 0.227858304977417, 0.19770047068595886, -0.22055822610855103, -0.420364111661911, -0.2874385714530945, -0.06433404982089996, -0.10546663403511047, 0.6536206007003784, 0.11534883826971054, 0.1595478355884552, 0.24570858478546143, -0.060959890484809875, -0.41670650243759155, 0.036050885915756226, 0.014210517518222332, -0.1369485855102539, 0.2540033757686615, -0.3656550347805023, 0.25909745693206787, 0.044579774141311646, -0.0024777650833129883, 0.17514558136463165, -0.22877919673919678, 0.0010563060641288757, 0.2825095057487488, -0.023783313110470772, -0.23724283277988434, 0.030204840004444122, 0.19706696271896362, -0.03649286925792694, -0.5179988741874695, 0.1423984169960022, -0.1319684237241745, 0.01018792949616909, -0.03397040814161301, 0.25232237577438354, -0.07725120335817337, 0.13748645782470703, -0.5111334919929504, 0.10514205694198608, -0.4406029284000397, 0.15532219409942627, -0.03851146996021271, -0.2520192861557007, 0.038356222212314606, 0.1205354630947113, -0.09105511009693146, 0.15005257725715637, -0.6417413353919983, 0.056516218930482864, -0.4287385940551758, 0.3723188042640686, -0.027623241767287254, -0.19984112679958344, -0.044800642877817154, -0.11843064427375793, 0.021422982215881348, 0.08745451271533966, -0.0635109394788742, 0.11660970002412796, 0.44347894191741943, -0.14121459424495697, -0.03429589420557022, 0.23535628616809845, 0.19166912138462067, 0.2653641700744629, 0.23575785756111145, -0.14393195509910583, 0.27466556429862976, 0.31208908557891846, 0.2016386240720749, -0.3055754005908966, -0.20440888404846191, 0.1741175502538681, -0.07299759984016418, -0.27569931745529175, 0.0135960653424263, 0.004383929073810577, 0.3032492399215698, -0.05015849694609642, -0.13071033358573914, 0.22629301249980927, -0.5607283115386963, 0.02306339330971241, -0.21239283680915833, 0.03483888506889343, 0.0065180957317352295, -0.03357160836458206, -0.11715450882911682, -0.40232446789741516, 0.2563615143299103, -0.07678636908531189, 0.16888119280338287, -0.04085487127304077, 0.04937058687210083, 0.20073705911636353, -0.5037559270858765, 0.05050276964902878, -0.07239267230033875, 0.3635871410369873, -0.1539391577243805, 0.01953607052564621, 0.23668713867664337, -0.2818394899368286, 0.6828809380531311, -0.30027705430984497, 0.3237898051738739, -0.10701091587543488, 0.018488794565200806, -0.3644412159919739, -0.1723620593547821, -0.08260313421487808, 0.230376735329628, 0.002069476991891861, 0.7693324685096741, -0.08069546520709991, -0.3536863327026367, -0.19044020771980286, 0.1617283672094345, -0.23571264743804932, -0.22333142161369324, -0.16530045866966248, -0.2613714337348938, -0.3035412132740021, 0.22521772980690002, 0.10040123015642166, 0.15587183833122253, -0.2812294065952301, -0.3021184206008911, 0.026003604754805565, -0.0011469647288322449, 0.08619536459445953, -0.16672855615615845, -0.026849646121263504, 0.0362161323428154, 0.6639813184738159, -0.3151652216911316, 0.003426592331379652, 0.25937315821647644, 0.363582581281662, 0.2772989571094513, 0.13558177649974823, 0.1684017777442932, -0.07802929729223251, 0.16677631437778473, 0.8263382911682129, 0.1594078093767166, 0.23823609948158264, -0.2188805639743805, 0.33667007088661194, -0.4187341332435608, 0.003567427396774292, 0.19658835232257843, -0.09242197871208191, -0.16093581914901733, 0.24352499842643738, 0.41675865650177, -0.09666501730680466, 0.10659737884998322, 0.1142304539680481, 0.3840652108192444, 0.1764860451221466, 0.20738890767097473, 0.13277371227741241, 0.9799233675003052, -0.3102877736091614, 0.16982372105121613, -0.04234737157821655, -0.0031089261174201965, -0.04354431852698326, -0.6333492994308472, -0.11661183834075928, -0.20017999410629272, -0.3024233281612396, 0.11174935102462769, 0.08568943291902542, -0.10316911339759827, 0.055813271552324295, -0.09285952150821686, 0.0855586901307106, -0.19770905375480652, 0.41906434297561646, -0.19767966866493225, 0.2439996302127838, -0.32617297768592834, -0.4959625005722046, -0.15647678077220917, 0.16487178206443787, 0.031437039375305176, -0.04853859543800354, -0.059421706944704056, 0.011713005602359772, -0.13057313859462738, 0.18725842237472534, -0.31405773758888245, 0.021645426750183105, 0.31231430172920227, -0.02313263900578022, -0.14394286274909973, -0.14292877912521362, 0.05420947074890137, -0.5641478300094604, 0.30512750148773193, 0.23124092817306519, -0.17710986733436584, 0.3257598876953125, -0.15534146130084991, 0.021448682993650436, 0.17042016983032227, -0.1134125217795372, 0.26708027720451355, 0.07743698358535767, -0.11875835806131363, 0.16013307869434357, 0.16236057877540588, -0.19428834319114685, -0.09682602435350418, -0.015537142753601074, -0.015437187626957893, -0.01255611702799797, -0.06439370661973953, 0.093236543238163, -0.10974498838186264, -0.16716268658638, 0.05558819696307182, 0.05979766696691513, -0.1893545538187027, 0.3783528208732605, -0.09678718447685242, -0.15456964075565338, -0.008890262804925442, 0.3713226616382599, -0.32756173610687256, -0.19321994483470917, 0.09207242727279663, 0.31886476278305054, -0.18478575348854065, -0.20151659846305847, 0.3515964150428772, -0.012421196326613426, -0.5109376907348633, 0.2792467772960663, -0.35034340620040894, -0.01118190586566925, 0.16701765358448029, 0.016943996772170067, -0.006683635991066694, -0.19413642585277557, -0.16645605862140656, -0.09571659564971924, -0.14830030500888824, -0.05033358186483383, 0.10745757818222046, 0.2067873179912567, -0.4769432544708252, 0.09458194673061371, -0.021793771535158157, 0.40373659133911133, -0.19476406276226044, 0.16495415568351746, -0.3420085608959198, 0.23262569308280945, -0.29311177134513855, -0.45957010984420776, 0.037413790822029114, -0.2678847014904022, -0.045747481286525726, 0.09241914004087448, -0.1529419869184494, -0.12227412313222885, -0.23628827929496765, 0.19033539295196533, 0.189319908618927, 0.17391738295555115, -0.16682016849517822, -0.34320151805877686, 0.17436756193637848, -0.17570532858371735, 0.18915046751499176, 0.1338556706905365, -0.0990087017416954, -0.2690891921520233, 0.7326576113700867, 0.19018957018852234, -0.024524956941604614, 0.44166213274002075, 0.46100103855133057, 0.5311329960823059, -0.028858959674835205, 0.03738952428102493, 0.05452367290854454, 0.04260316491127014, -0.28762519359588623, 0.3660692274570465, 0.28036263585090637, 0.04939091578125954, 0.39158010482788086, -0.2303597778081894, 0.1374913603067398, 0.08632475137710571, 0.37588220834732056, 0.49084779620170593, -0.035772256553173065, -0.49716076254844666, 0.24364681541919708, 0.09298495948314667, 0.10267966985702515, -0.24107787013053894, 0.2818644344806671, -0.05562826991081238, -0.03644116222858429, 0.20599883794784546, 0.18303625285625458, -0.29970067739486694, -0.010596934705972672, 0.3796977996826172, 0.5373080372810364, -0.1991109848022461, -0.3758561313152313, -0.0419774167239666, 0.12178318202495575, -0.009604385122656822, 0.024430690333247185, -0.11847929656505585, 0.21105073392391205, 0.8026148080825806, 0.06376732885837555, 0.1803985834121704, 0.1867927610874176, -0.07245159149169922, 0.18699227273464203, -0.12172377109527588, -0.3046778440475464, 0.10303465276956558, -0.15545590221881866, -0.04155028238892555, 0.07164712250232697, 0.21780909597873688, -0.18861845135688782, -0.1876366287469864, -0.4336097240447998, 0.06782592833042145, -0.14034484326839447, 0.23643556237220764, 0.07064389437437057, 0.011292919516563416, -0.40676021575927734, 0.23104017972946167, -0.06329773366451263, 0.22097136080265045, 0.4582326114177704, 0.5591541528701782, 0.21365556120872498, 0.24056142568588257, -0.21015866100788116, -0.06845530867576599, 0.22913074493408203, -0.18099212646484375, 0.09044861048460007, 0.4119534194469452, -0.2922443151473999, -0.23383483290672302, -0.24112413823604584, 0.22108159959316254, 0.19341081380844116, -0.45813703536987305, 0.43371787667274475, 0.3062591850757599, 0.06670287996530533, 0.0987987220287323, 0.18956217169761658, -0.18546995520591736, 0.20504236221313477, 0.1533985584974289, 0.031063273549079895, -0.0819806158542633, -0.3525286018848419, -0.030681375414133072, 0.3223510682582855, -0.05932959169149399, 0.42182379961013794, 0.11201243102550507, -0.17466874420642853, -0.21328380703926086, -0.058081768453121185, -0.22172901034355164, -0.09328427910804749, 0.26636549830436707, -0.5355953574180603, 0.07447651028633118, -0.1866752654314041, 0.02572821080684662, -0.4233056902885437, 0.6617635488510132, 0.24154812097549438, 0.07221417129039764, -0.35519134998321533, -0.29439595341682434, -0.23527970910072327, 0.2907281517982483, -0.4481869339942932, -0.014662988483905792, 0.06173192709684372, 0.4491553008556366, 0.06895572692155838, 0.025518983602523804, -0.2532501816749573, -0.25601741671562195, -0.12963348627090454, 0.28376272320747375, -0.13120701909065247, 0.06262820959091187, 0.12757046520709991, 0.015935787931084633, -0.14396265149116516, -0.4498974680900574, 0.3557792901992798, 0.10339139401912689, -0.036318931728601456, 0.08136772364377975, -0.23051905632019043, 0.4120981991291046, -0.2536555528640747, 0.02452188730239868, -0.18090640008449554, 0.012954097241163254, 0.0780438557267189, -0.27691221237182617, -0.3581109642982483, -0.106882244348526, 0.034435685724020004, -0.29862281680107117, -0.1686069518327713, 0.10910940170288086, 0.020840056240558624, 0.03685014694929123, -0.1390921026468277, 0.1992226094007492, -0.08289027959108353, 0.38733887672424316, 0.08963944017887115, -0.18663540482521057, -0.26398766040802, 0.3944457173347473, 0.28055137395858765, 0.23066475987434387, 0.1072213351726532, 0.3361835479736328, -0.43927863240242004, -0.1555042266845703, 0.3613762855529785, 0.2324036955833435, -0.4046543836593628, 0.006576307117938995, 0.25290530920028687, -0.18358075618743896, -0.02321651205420494, -0.13050611317157745, -0.12933382391929626, -0.013140063732862473, -0.005518182180821896, -0.12338262796401978, 0.33634501695632935, 0.07808706164360046, -0.08841875195503235, -0.07756863534450531, 0.000375114381313324, 0.07786931842565536, 0.020994901657104492, 0.12060888111591339, 0.1628909409046173 ]
https://github.com/huggingface/datasets/issues/5990
> As I've already said in other discussions, I would not recommend pushing files saved with save_to_disk to the Hub but save to parquet shards and upload them instead. The Hub does not support datasets saved with save_to_disk, which is meant for disk only. Well noted, thanks. That part was not clear to me :)
Pushing a large dataset on the hub consistently hangs
### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
55
Pushing a large dataset on the hub consistently hangs ### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` > As I've already said in other discussions, I would not recommend pushing files saved with save_to_disk to the Hub but save to parquet shards and upload them instead. The Hub does not support datasets saved with save_to_disk, which is meant for disk only. Well noted, thanks. That part was not clear to me :)
[ -0.3251087963581085, -0.42933112382888794, -0.06096188724040985, 0.08869528025388718, 0.21317243576049805, -0.06696006655693054, 0.1970674693584442, 0.5384528636932373, 0.05225852131843567, 0.3061686158180237, 0.08448541909456253, 0.10903309285640717, 0.03724048659205437, 0.22024406492710114, 0.14667896926403046, 0.2332618236541748, 0.25349166989326477, -0.10799236595630646, 0.27970409393310547, -0.06858120858669281, -0.06573061645030975, -0.15738080441951752, 0.10763393342494965, -0.10093242675065994, -0.7575782537460327, 0.04432877153158188, 0.22587668895721436, 0.2064542919397354, 0.1921502649784088, -0.16747573018074036, 0.20722517371177673, 0.25278791785240173, -0.16246680915355682, 0.6471035480499268, -0.00012341895489953458, -0.05790407583117485, 0.25191041827201843, 0.02304328978061676, -0.3664642572402954, 0.09019968658685684, -0.10475093126296997, -0.13000282645225525, -0.2037355899810791, 0.1003957986831665, 0.03635609894990921, 0.45928943157196045, -0.19047336280345917, -0.16487863659858704, 0.21318119764328003, -0.0651368647813797, 0.02760709449648857, 0.17410922050476074, 0.014200866222381592, -0.24395343661308289, 0.20720058679580688, 0.13026978075504303, -0.30730724334716797, -0.07190019637346268, 0.49071699380874634, 0.13820913434028625, -0.1179051548242569, -0.07936432957649231, -0.11190301179885864, -0.11168365180492401, 0.016268212348222733, -0.3535960912704468, -0.089785136282444, -0.3143678307533264, 0.34380003809928894, 0.24355612695217133, 0.14077115058898926, -0.08090770244598389, -0.2698417603969574, -0.07041946053504944, -0.11939385533332825, -0.1470957100391388, 0.28435736894607544, 0.16139265894889832, -0.2762324810028076, 0.0654551237821579, -0.13129226863384247, -0.4053599536418915, -0.12707537412643433, -0.03554612770676613, -0.14915555715560913, -0.03168031945824623, 0.1751161366701126, 0.08743235468864441, 0.2067568451166153, -0.05901416763663292, 0.3941405117511749, -0.2691796123981476, 0.0901857241988182, -0.2755673825740814, -0.41740137338638306, 0.13888457417488098, 0.08934485912322998, 0.07516989856958389, -0.042328789830207825, -0.12489776313304901, -0.22944197058677673, 0.44265317916870117, -0.19254255294799805, 0.07224048674106598, 0.27406084537506104, -0.1266958862543106, 0.035612236708402634, -0.06530951708555222, 0.3070811629295349, 0.14404165744781494, -0.2572271227836609, 0.09562107175588608, 0.004041291773319244, -0.11014997959136963, -0.013009496033191681, -0.025750624015927315, 0.0792459174990654, -0.22842007875442505, -0.3421907424926758, 0.2250162661075592, -0.16784855723381042, 0.2685824930667877, 0.20871514081954956, 0.24827389419078827, 0.08709130436182022, 0.3373471796512604, -0.27540260553359985, 0.022007297724485397, -0.23613813519477844, -0.19603271782398224, -0.18941564857959747, -0.13765454292297363, 0.22148294746875763, 0.33565178513526917, 0.19451121985912323, -0.3410741686820984, -0.24856320023536682, 0.07881910353899002, 0.49135810136795044, -0.1306176483631134, -0.20826470851898193, -0.13527116179466248, 0.12670336663722992, 0.4150709807872772, 0.11111826449632645, 0.425483763217926, -0.1380186229944229, -0.1203937754034996, -0.21549536287784576, 0.057632461190223694, -0.18095824122428894, -0.29855096340179443, 0.236887589097023, 0.09342896938323975, -0.14131808280944824, 0.012494992464780807, -0.19530931115150452, -0.20652753114700317, -0.10413315892219543, 0.3453899025917053, -0.04829101264476776, 0.07182597368955612, -0.05895145982503891, -0.009029572829604149, 0.16733375191688538, 0.3914467692375183, -0.46486231684684753, 0.2811201512813568, 0.06217803806066513, 0.4197710156440735, -0.2656343877315521, 0.31870418787002563, -0.07181254029273987, 0.1722499132156372, -0.11614037305116653, 0.008509308099746704, -0.244670569896698, -0.6641231179237366, -0.4377872347831726, 0.4218234121799469, -0.1620047390460968, 0.16865754127502441, 0.030979372560977936, 0.14459466934204102, 0.42355436086654663, -0.36917978525161743, 0.3288465142250061, 0.2769600749015808, -0.1284511536359787, 0.1686631292104721, -0.2560868263244629, -0.23015055060386658, -0.34304046630859375, 0.3827191889286041, 0.2105250358581543, -0.2159123718738556, 0.012101415544748306, 0.46206918358802795, 0.23962244391441345, 0.1523667424917221, 0.3582223951816559, 0.26409244537353516, 0.5892544388771057, -0.15352578461170197, -0.14096936583518982, -0.15002700686454773, -0.5206427574157715, 0.43066176772117615, 0.3863000273704529, -0.12492451071739197, -0.14289477467536926, -0.07865099608898163, -0.22074106335639954, 0.15172049403190613, -0.3061752915382385, 0.3593229055404663, -0.03207937255501747, -0.28083735704421997, -0.034529704600572586, 0.23081551492214203, 0.01316806674003601, 0.37530258297920227, -0.0534038171172142, 0.0001145191490650177, -0.08453143388032913, 0.589294970035553, 0.12691321969032288, -0.23005501925945282, 0.06565289199352264, 0.19912466406822205, 0.14771544933319092, -0.3349977135658264, -0.15287035703659058, 0.11965660005807877, 0.025633741170167923, 0.1757788360118866, 0.26884737610816956, 0.05140337347984314, 0.3028479516506195, -0.034123025834560394, 0.2301027476787567, 0.12599213421344757, -0.11914559453725815, -0.24972756206989288, -0.11160072684288025, 0.16405045986175537, -0.018670421093702316, 0.24425914883613586, -0.1308334469795227, 0.018514275550842285, 0.13719388842582703, -0.09259036928415298, 0.0758800134062767, 0.10112706571817398, 0.31888532638549805, -0.04317906126379967, 0.07725636661052704, -0.03980230540037155, 0.09870178997516632, 0.46279701590538025, 0.6134483218193054, 0.012248978018760681, -0.41306638717651367, 0.1094224750995636, -0.009646803140640259, 0.06047262251377106, 0.05362584441900253, 0.025167375802993774, -0.07241889834403992, 0.010686881840229034, -0.0824461579322815, -0.30172306299209595, -0.14531058073043823, -0.3921554684638977, -0.07417018711566925, 0.2588631510734558, 0.0007041282951831818, 0.1754174530506134, 0.08643867075443268, -0.12469619512557983, -0.139383465051651, -0.22530192136764526, 0.23488369584083557, 0.267243355512619, -0.07326918840408325, 0.01306074857711792, -0.25176653265953064, 0.19057311117649078, 0.11472766101360321, -0.3452693521976471, -0.4584461748600006, -0.5935556888580322, 0.03924757242202759, 0.41381070017814636, -0.005098491907119751, 0.15742459893226624, 0.22899895906448364, 0.227858304977417, 0.19770047068595886, -0.22055822610855103, -0.420364111661911, -0.2874385714530945, -0.06433404982089996, -0.10546663403511047, 0.6536206007003784, 0.11534883826971054, 0.1595478355884552, 0.24570858478546143, -0.060959890484809875, -0.41670650243759155, 0.036050885915756226, 0.014210517518222332, -0.1369485855102539, 0.2540033757686615, -0.3656550347805023, 0.25909745693206787, 0.044579774141311646, -0.0024777650833129883, 0.17514558136463165, -0.22877919673919678, 0.0010563060641288757, 0.2825095057487488, -0.023783313110470772, -0.23724283277988434, 0.030204840004444122, 0.19706696271896362, -0.03649286925792694, -0.5179988741874695, 0.1423984169960022, -0.1319684237241745, 0.01018792949616909, -0.03397040814161301, 0.25232237577438354, -0.07725120335817337, 0.13748645782470703, -0.5111334919929504, 0.10514205694198608, -0.4406029284000397, 0.15532219409942627, -0.03851146996021271, -0.2520192861557007, 0.038356222212314606, 0.1205354630947113, -0.09105511009693146, 0.15005257725715637, -0.6417413353919983, 0.056516218930482864, -0.4287385940551758, 0.3723188042640686, -0.027623241767287254, -0.19984112679958344, -0.044800642877817154, -0.11843064427375793, 0.021422982215881348, 0.08745451271533966, -0.0635109394788742, 0.11660970002412796, 0.44347894191741943, -0.14121459424495697, -0.03429589420557022, 0.23535628616809845, 0.19166912138462067, 0.2653641700744629, 0.23575785756111145, -0.14393195509910583, 0.27466556429862976, 0.31208908557891846, 0.2016386240720749, -0.3055754005908966, -0.20440888404846191, 0.1741175502538681, -0.07299759984016418, -0.27569931745529175, 0.0135960653424263, 0.004383929073810577, 0.3032492399215698, -0.05015849694609642, -0.13071033358573914, 0.22629301249980927, -0.5607283115386963, 0.02306339330971241, -0.21239283680915833, 0.03483888506889343, 0.0065180957317352295, -0.03357160836458206, -0.11715450882911682, -0.40232446789741516, 0.2563615143299103, -0.07678636908531189, 0.16888119280338287, -0.04085487127304077, 0.04937058687210083, 0.20073705911636353, -0.5037559270858765, 0.05050276964902878, -0.07239267230033875, 0.3635871410369873, -0.1539391577243805, 0.01953607052564621, 0.23668713867664337, -0.2818394899368286, 0.6828809380531311, -0.30027705430984497, 0.3237898051738739, -0.10701091587543488, 0.018488794565200806, -0.3644412159919739, -0.1723620593547821, -0.08260313421487808, 0.230376735329628, 0.002069476991891861, 0.7693324685096741, -0.08069546520709991, -0.3536863327026367, -0.19044020771980286, 0.1617283672094345, -0.23571264743804932, -0.22333142161369324, -0.16530045866966248, -0.2613714337348938, -0.3035412132740021, 0.22521772980690002, 0.10040123015642166, 0.15587183833122253, -0.2812294065952301, -0.3021184206008911, 0.026003604754805565, -0.0011469647288322449, 0.08619536459445953, -0.16672855615615845, -0.026849646121263504, 0.0362161323428154, 0.6639813184738159, -0.3151652216911316, 0.003426592331379652, 0.25937315821647644, 0.363582581281662, 0.2772989571094513, 0.13558177649974823, 0.1684017777442932, -0.07802929729223251, 0.16677631437778473, 0.8263382911682129, 0.1594078093767166, 0.23823609948158264, -0.2188805639743805, 0.33667007088661194, -0.4187341332435608, 0.003567427396774292, 0.19658835232257843, -0.09242197871208191, -0.16093581914901733, 0.24352499842643738, 0.41675865650177, -0.09666501730680466, 0.10659737884998322, 0.1142304539680481, 0.3840652108192444, 0.1764860451221466, 0.20738890767097473, 0.13277371227741241, 0.9799233675003052, -0.3102877736091614, 0.16982372105121613, -0.04234737157821655, -0.0031089261174201965, -0.04354431852698326, -0.6333492994308472, -0.11661183834075928, -0.20017999410629272, -0.3024233281612396, 0.11174935102462769, 0.08568943291902542, -0.10316911339759827, 0.055813271552324295, -0.09285952150821686, 0.0855586901307106, -0.19770905375480652, 0.41906434297561646, -0.19767966866493225, 0.2439996302127838, -0.32617297768592834, -0.4959625005722046, -0.15647678077220917, 0.16487178206443787, 0.031437039375305176, -0.04853859543800354, -0.059421706944704056, 0.011713005602359772, -0.13057313859462738, 0.18725842237472534, -0.31405773758888245, 0.021645426750183105, 0.31231430172920227, -0.02313263900578022, -0.14394286274909973, -0.14292877912521362, 0.05420947074890137, -0.5641478300094604, 0.30512750148773193, 0.23124092817306519, -0.17710986733436584, 0.3257598876953125, -0.15534146130084991, 0.021448682993650436, 0.17042016983032227, -0.1134125217795372, 0.26708027720451355, 0.07743698358535767, -0.11875835806131363, 0.16013307869434357, 0.16236057877540588, -0.19428834319114685, -0.09682602435350418, -0.015537142753601074, -0.015437187626957893, -0.01255611702799797, -0.06439370661973953, 0.093236543238163, -0.10974498838186264, -0.16716268658638, 0.05558819696307182, 0.05979766696691513, -0.1893545538187027, 0.3783528208732605, -0.09678718447685242, -0.15456964075565338, -0.008890262804925442, 0.3713226616382599, -0.32756173610687256, -0.19321994483470917, 0.09207242727279663, 0.31886476278305054, -0.18478575348854065, -0.20151659846305847, 0.3515964150428772, -0.012421196326613426, -0.5109376907348633, 0.2792467772960663, -0.35034340620040894, -0.01118190586566925, 0.16701765358448029, 0.016943996772170067, -0.006683635991066694, -0.19413642585277557, -0.16645605862140656, -0.09571659564971924, -0.14830030500888824, -0.05033358186483383, 0.10745757818222046, 0.2067873179912567, -0.4769432544708252, 0.09458194673061371, -0.021793771535158157, 0.40373659133911133, -0.19476406276226044, 0.16495415568351746, -0.3420085608959198, 0.23262569308280945, -0.29311177134513855, -0.45957010984420776, 0.037413790822029114, -0.2678847014904022, -0.045747481286525726, 0.09241914004087448, -0.1529419869184494, -0.12227412313222885, -0.23628827929496765, 0.19033539295196533, 0.189319908618927, 0.17391738295555115, -0.16682016849517822, -0.34320151805877686, 0.17436756193637848, -0.17570532858371735, 0.18915046751499176, 0.1338556706905365, -0.0990087017416954, -0.2690891921520233, 0.7326576113700867, 0.19018957018852234, -0.024524956941604614, 0.44166213274002075, 0.46100103855133057, 0.5311329960823059, -0.028858959674835205, 0.03738952428102493, 0.05452367290854454, 0.04260316491127014, -0.28762519359588623, 0.3660692274570465, 0.28036263585090637, 0.04939091578125954, 0.39158010482788086, -0.2303597778081894, 0.1374913603067398, 0.08632475137710571, 0.37588220834732056, 0.49084779620170593, -0.035772256553173065, -0.49716076254844666, 0.24364681541919708, 0.09298495948314667, 0.10267966985702515, -0.24107787013053894, 0.2818644344806671, -0.05562826991081238, -0.03644116222858429, 0.20599883794784546, 0.18303625285625458, -0.29970067739486694, -0.010596934705972672, 0.3796977996826172, 0.5373080372810364, -0.1991109848022461, -0.3758561313152313, -0.0419774167239666, 0.12178318202495575, -0.009604385122656822, 0.024430690333247185, -0.11847929656505585, 0.21105073392391205, 0.8026148080825806, 0.06376732885837555, 0.1803985834121704, 0.1867927610874176, -0.07245159149169922, 0.18699227273464203, -0.12172377109527588, -0.3046778440475464, 0.10303465276956558, -0.15545590221881866, -0.04155028238892555, 0.07164712250232697, 0.21780909597873688, -0.18861845135688782, -0.1876366287469864, -0.4336097240447998, 0.06782592833042145, -0.14034484326839447, 0.23643556237220764, 0.07064389437437057, 0.011292919516563416, -0.40676021575927734, 0.23104017972946167, -0.06329773366451263, 0.22097136080265045, 0.4582326114177704, 0.5591541528701782, 0.21365556120872498, 0.24056142568588257, -0.21015866100788116, -0.06845530867576599, 0.22913074493408203, -0.18099212646484375, 0.09044861048460007, 0.4119534194469452, -0.2922443151473999, -0.23383483290672302, -0.24112413823604584, 0.22108159959316254, 0.19341081380844116, -0.45813703536987305, 0.43371787667274475, 0.3062591850757599, 0.06670287996530533, 0.0987987220287323, 0.18956217169761658, -0.18546995520591736, 0.20504236221313477, 0.1533985584974289, 0.031063273549079895, -0.0819806158542633, -0.3525286018848419, -0.030681375414133072, 0.3223510682582855, -0.05932959169149399, 0.42182379961013794, 0.11201243102550507, -0.17466874420642853, -0.21328380703926086, -0.058081768453121185, -0.22172901034355164, -0.09328427910804749, 0.26636549830436707, -0.5355953574180603, 0.07447651028633118, -0.1866752654314041, 0.02572821080684662, -0.4233056902885437, 0.6617635488510132, 0.24154812097549438, 0.07221417129039764, -0.35519134998321533, -0.29439595341682434, -0.23527970910072327, 0.2907281517982483, -0.4481869339942932, -0.014662988483905792, 0.06173192709684372, 0.4491553008556366, 0.06895572692155838, 0.025518983602523804, -0.2532501816749573, -0.25601741671562195, -0.12963348627090454, 0.28376272320747375, -0.13120701909065247, 0.06262820959091187, 0.12757046520709991, 0.015935787931084633, -0.14396265149116516, -0.4498974680900574, 0.3557792901992798, 0.10339139401912689, -0.036318931728601456, 0.08136772364377975, -0.23051905632019043, 0.4120981991291046, -0.2536555528640747, 0.02452188730239868, -0.18090640008449554, 0.012954097241163254, 0.0780438557267189, -0.27691221237182617, -0.3581109642982483, -0.106882244348526, 0.034435685724020004, -0.29862281680107117, -0.1686069518327713, 0.10910940170288086, 0.020840056240558624, 0.03685014694929123, -0.1390921026468277, 0.1992226094007492, -0.08289027959108353, 0.38733887672424316, 0.08963944017887115, -0.18663540482521057, -0.26398766040802, 0.3944457173347473, 0.28055137395858765, 0.23066475987434387, 0.1072213351726532, 0.3361835479736328, -0.43927863240242004, -0.1555042266845703, 0.3613762855529785, 0.2324036955833435, -0.4046543836593628, 0.006576307117938995, 0.25290530920028687, -0.18358075618743896, -0.02321651205420494, -0.13050611317157745, -0.12933382391929626, -0.013140063732862473, -0.005518182180821896, -0.12338262796401978, 0.33634501695632935, 0.07808706164360046, -0.08841875195503235, -0.07756863534450531, 0.000375114381313324, 0.07786931842565536, 0.020994901657104492, 0.12060888111591339, 0.1628909409046173 ]
https://github.com/huggingface/datasets/issues/5990
Sorry for not replying in a few days, I was on leave. :) So, here are more information as to the error that causes some of the delay ```bash Pushing Antreas/TALI-tiny to hub Attempting to push to hub Pushing split train to the Hub. Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6/6 [00:24<00:00, 4.06s/ba] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6/6 [00:24<00:00, 4.15s/ba] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6/6 [00:26<00:00, 4.45s/ba] /opt/conda/envs/main/lib/python3.10/site-packages/huggingface_hub/lfs.py:310: UserWarning: hf_transfer is enabled but does not support uploading from bytes or BinaryIO, falling back to regular upload warnings.warn( Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6/6 [00:25<00:00, 4.26s/ba] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6/6 [00:27<00:00, 4.58s/ba] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6/6 [00:24<00:00, 4.10s/ba] Pushing dataset shards to the dataset hub: 22%|████████████████████████▎ | 5/23 [52:23<3:08:37, 628.74s/it] Exception: Error while uploading 'data/train-00005-of-00023-e224d901fd65e062.parquet' to the Hub., with stacktrace: <traceback object at 0x7f745458d0c0>, and type: <class 'RuntimeError'>, and cause: HTTPSConnectionPool(host='s3.us-east-1.amazonaws.com', port=443): Max retries exceeded with url: /lfs.huggingface.co/repos/7c/d3/7cd385d9324302dc13e3986331d72d9be6fa0174c63dcfe0e08cd474f7f1e8b7/3415166ae28c0beccbbc692f38742b8dea2c197f5c805321104e888d21d7eb90?X-Amz-Algorithm=AWS4-HMAC-SHA256 &X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA4N7VTDGO27GPWFUO%2F20230627%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230627T003349Z&X-Amz-Expires=86400&X-Amz-Signature=5a12ff96f2 91f644134170992a6628e5f3c4e7b2e7fc3e940b4378fe11ae5390&X-Amz-SignedHeaders=host&partNumber=1&uploadId=JSsK8r63XSF.VlKQx3Vf8OW4DEVp5YIIY7LPnuapNIegsxs5EHgM1p4u0.Nn6_wlPlQnvxm8HKMxZhczKE9KB74t0etB oLcxqBIvsgey3uXBTZMAEGwU6y7CDUADiEIO&x-id=UploadPart (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:2426)'))) Push failed, retrying Attempting to push to hub Pushing split train to the Hub. ``` One issue is that the uploading does not continue from the chunk it failed off. It often continues from a very old chunk. e.g. if it failed on chunk 192/250, it will continue from say 53/250, and this behaviour appears almost random.
Pushing a large dataset on the hub consistently hangs
### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
228
Pushing a large dataset on the hub consistently hangs ### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` Sorry for not replying in a few days, I was on leave. :) So, here are more information as to the error that causes some of the delay ```bash Pushing Antreas/TALI-tiny to hub Attempting to push to hub Pushing split train to the Hub. Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6/6 [00:24<00:00, 4.06s/ba] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6/6 [00:24<00:00, 4.15s/ba] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6/6 [00:26<00:00, 4.45s/ba] /opt/conda/envs/main/lib/python3.10/site-packages/huggingface_hub/lfs.py:310: UserWarning: hf_transfer is enabled but does not support uploading from bytes or BinaryIO, falling back to regular upload warnings.warn( Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6/6 [00:25<00:00, 4.26s/ba] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6/6 [00:27<00:00, 4.58s/ba] Creating parquet from Arrow format: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6/6 [00:24<00:00, 4.10s/ba] Pushing dataset shards to the dataset hub: 22%|████████████████████████▎ | 5/23 [52:23<3:08:37, 628.74s/it] Exception: Error while uploading 'data/train-00005-of-00023-e224d901fd65e062.parquet' to the Hub., with stacktrace: <traceback object at 0x7f745458d0c0>, and type: <class 'RuntimeError'>, and cause: HTTPSConnectionPool(host='s3.us-east-1.amazonaws.com', port=443): Max retries exceeded with url: /lfs.huggingface.co/repos/7c/d3/7cd385d9324302dc13e3986331d72d9be6fa0174c63dcfe0e08cd474f7f1e8b7/3415166ae28c0beccbbc692f38742b8dea2c197f5c805321104e888d21d7eb90?X-Amz-Algorithm=AWS4-HMAC-SHA256 &X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA4N7VTDGO27GPWFUO%2F20230627%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230627T003349Z&X-Amz-Expires=86400&X-Amz-Signature=5a12ff96f2 91f644134170992a6628e5f3c4e7b2e7fc3e940b4378fe11ae5390&X-Amz-SignedHeaders=host&partNumber=1&uploadId=JSsK8r63XSF.VlKQx3Vf8OW4DEVp5YIIY7LPnuapNIegsxs5EHgM1p4u0.Nn6_wlPlQnvxm8HKMxZhczKE9KB74t0etB oLcxqBIvsgey3uXBTZMAEGwU6y7CDUADiEIO&x-id=UploadPart (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:2426)'))) Push failed, retrying Attempting to push to hub Pushing split train to the Hub. ``` One issue is that the uploading does not continue from the chunk it failed off. It often continues from a very old chunk. e.g. if it failed on chunk 192/250, it will continue from say 53/250, and this behaviour appears almost random.
[ -0.3251087963581085, -0.42933112382888794, -0.06096188724040985, 0.08869528025388718, 0.21317243576049805, -0.06696006655693054, 0.1970674693584442, 0.5384528636932373, 0.05225852131843567, 0.3061686158180237, 0.08448541909456253, 0.10903309285640717, 0.03724048659205437, 0.22024406492710114, 0.14667896926403046, 0.2332618236541748, 0.25349166989326477, -0.10799236595630646, 0.27970409393310547, -0.06858120858669281, -0.06573061645030975, -0.15738080441951752, 0.10763393342494965, -0.10093242675065994, -0.7575782537460327, 0.04432877153158188, 0.22587668895721436, 0.2064542919397354, 0.1921502649784088, -0.16747573018074036, 0.20722517371177673, 0.25278791785240173, -0.16246680915355682, 0.6471035480499268, -0.00012341895489953458, -0.05790407583117485, 0.25191041827201843, 0.02304328978061676, -0.3664642572402954, 0.09019968658685684, -0.10475093126296997, -0.13000282645225525, -0.2037355899810791, 0.1003957986831665, 0.03635609894990921, 0.45928943157196045, -0.19047336280345917, -0.16487863659858704, 0.21318119764328003, -0.0651368647813797, 0.02760709449648857, 0.17410922050476074, 0.014200866222381592, -0.24395343661308289, 0.20720058679580688, 0.13026978075504303, -0.30730724334716797, -0.07190019637346268, 0.49071699380874634, 0.13820913434028625, -0.1179051548242569, -0.07936432957649231, -0.11190301179885864, -0.11168365180492401, 0.016268212348222733, -0.3535960912704468, -0.089785136282444, -0.3143678307533264, 0.34380003809928894, 0.24355612695217133, 0.14077115058898926, -0.08090770244598389, -0.2698417603969574, -0.07041946053504944, -0.11939385533332825, -0.1470957100391388, 0.28435736894607544, 0.16139265894889832, -0.2762324810028076, 0.0654551237821579, -0.13129226863384247, -0.4053599536418915, -0.12707537412643433, -0.03554612770676613, -0.14915555715560913, -0.03168031945824623, 0.1751161366701126, 0.08743235468864441, 0.2067568451166153, -0.05901416763663292, 0.3941405117511749, -0.2691796123981476, 0.0901857241988182, -0.2755673825740814, -0.41740137338638306, 0.13888457417488098, 0.08934485912322998, 0.07516989856958389, -0.042328789830207825, -0.12489776313304901, -0.22944197058677673, 0.44265317916870117, -0.19254255294799805, 0.07224048674106598, 0.27406084537506104, -0.1266958862543106, 0.035612236708402634, -0.06530951708555222, 0.3070811629295349, 0.14404165744781494, -0.2572271227836609, 0.09562107175588608, 0.004041291773319244, -0.11014997959136963, -0.013009496033191681, -0.025750624015927315, 0.0792459174990654, -0.22842007875442505, -0.3421907424926758, 0.2250162661075592, -0.16784855723381042, 0.2685824930667877, 0.20871514081954956, 0.24827389419078827, 0.08709130436182022, 0.3373471796512604, -0.27540260553359985, 0.022007297724485397, -0.23613813519477844, -0.19603271782398224, -0.18941564857959747, -0.13765454292297363, 0.22148294746875763, 0.33565178513526917, 0.19451121985912323, -0.3410741686820984, -0.24856320023536682, 0.07881910353899002, 0.49135810136795044, -0.1306176483631134, -0.20826470851898193, -0.13527116179466248, 0.12670336663722992, 0.4150709807872772, 0.11111826449632645, 0.425483763217926, -0.1380186229944229, -0.1203937754034996, -0.21549536287784576, 0.057632461190223694, -0.18095824122428894, -0.29855096340179443, 0.236887589097023, 0.09342896938323975, -0.14131808280944824, 0.012494992464780807, -0.19530931115150452, -0.20652753114700317, -0.10413315892219543, 0.3453899025917053, -0.04829101264476776, 0.07182597368955612, -0.05895145982503891, -0.009029572829604149, 0.16733375191688538, 0.3914467692375183, -0.46486231684684753, 0.2811201512813568, 0.06217803806066513, 0.4197710156440735, -0.2656343877315521, 0.31870418787002563, -0.07181254029273987, 0.1722499132156372, -0.11614037305116653, 0.008509308099746704, -0.244670569896698, -0.6641231179237366, -0.4377872347831726, 0.4218234121799469, -0.1620047390460968, 0.16865754127502441, 0.030979372560977936, 0.14459466934204102, 0.42355436086654663, -0.36917978525161743, 0.3288465142250061, 0.2769600749015808, -0.1284511536359787, 0.1686631292104721, -0.2560868263244629, -0.23015055060386658, -0.34304046630859375, 0.3827191889286041, 0.2105250358581543, -0.2159123718738556, 0.012101415544748306, 0.46206918358802795, 0.23962244391441345, 0.1523667424917221, 0.3582223951816559, 0.26409244537353516, 0.5892544388771057, -0.15352578461170197, -0.14096936583518982, -0.15002700686454773, -0.5206427574157715, 0.43066176772117615, 0.3863000273704529, -0.12492451071739197, -0.14289477467536926, -0.07865099608898163, -0.22074106335639954, 0.15172049403190613, -0.3061752915382385, 0.3593229055404663, -0.03207937255501747, -0.28083735704421997, -0.034529704600572586, 0.23081551492214203, 0.01316806674003601, 0.37530258297920227, -0.0534038171172142, 0.0001145191490650177, -0.08453143388032913, 0.589294970035553, 0.12691321969032288, -0.23005501925945282, 0.06565289199352264, 0.19912466406822205, 0.14771544933319092, -0.3349977135658264, -0.15287035703659058, 0.11965660005807877, 0.025633741170167923, 0.1757788360118866, 0.26884737610816956, 0.05140337347984314, 0.3028479516506195, -0.034123025834560394, 0.2301027476787567, 0.12599213421344757, -0.11914559453725815, -0.24972756206989288, -0.11160072684288025, 0.16405045986175537, -0.018670421093702316, 0.24425914883613586, -0.1308334469795227, 0.018514275550842285, 0.13719388842582703, -0.09259036928415298, 0.0758800134062767, 0.10112706571817398, 0.31888532638549805, -0.04317906126379967, 0.07725636661052704, -0.03980230540037155, 0.09870178997516632, 0.46279701590538025, 0.6134483218193054, 0.012248978018760681, -0.41306638717651367, 0.1094224750995636, -0.009646803140640259, 0.06047262251377106, 0.05362584441900253, 0.025167375802993774, -0.07241889834403992, 0.010686881840229034, -0.0824461579322815, -0.30172306299209595, -0.14531058073043823, -0.3921554684638977, -0.07417018711566925, 0.2588631510734558, 0.0007041282951831818, 0.1754174530506134, 0.08643867075443268, -0.12469619512557983, -0.139383465051651, -0.22530192136764526, 0.23488369584083557, 0.267243355512619, -0.07326918840408325, 0.01306074857711792, -0.25176653265953064, 0.19057311117649078, 0.11472766101360321, -0.3452693521976471, -0.4584461748600006, -0.5935556888580322, 0.03924757242202759, 0.41381070017814636, -0.005098491907119751, 0.15742459893226624, 0.22899895906448364, 0.227858304977417, 0.19770047068595886, -0.22055822610855103, -0.420364111661911, -0.2874385714530945, -0.06433404982089996, -0.10546663403511047, 0.6536206007003784, 0.11534883826971054, 0.1595478355884552, 0.24570858478546143, -0.060959890484809875, -0.41670650243759155, 0.036050885915756226, 0.014210517518222332, -0.1369485855102539, 0.2540033757686615, -0.3656550347805023, 0.25909745693206787, 0.044579774141311646, -0.0024777650833129883, 0.17514558136463165, -0.22877919673919678, 0.0010563060641288757, 0.2825095057487488, -0.023783313110470772, -0.23724283277988434, 0.030204840004444122, 0.19706696271896362, -0.03649286925792694, -0.5179988741874695, 0.1423984169960022, -0.1319684237241745, 0.01018792949616909, -0.03397040814161301, 0.25232237577438354, -0.07725120335817337, 0.13748645782470703, -0.5111334919929504, 0.10514205694198608, -0.4406029284000397, 0.15532219409942627, -0.03851146996021271, -0.2520192861557007, 0.038356222212314606, 0.1205354630947113, -0.09105511009693146, 0.15005257725715637, -0.6417413353919983, 0.056516218930482864, -0.4287385940551758, 0.3723188042640686, -0.027623241767287254, -0.19984112679958344, -0.044800642877817154, -0.11843064427375793, 0.021422982215881348, 0.08745451271533966, -0.0635109394788742, 0.11660970002412796, 0.44347894191741943, -0.14121459424495697, -0.03429589420557022, 0.23535628616809845, 0.19166912138462067, 0.2653641700744629, 0.23575785756111145, -0.14393195509910583, 0.27466556429862976, 0.31208908557891846, 0.2016386240720749, -0.3055754005908966, -0.20440888404846191, 0.1741175502538681, -0.07299759984016418, -0.27569931745529175, 0.0135960653424263, 0.004383929073810577, 0.3032492399215698, -0.05015849694609642, -0.13071033358573914, 0.22629301249980927, -0.5607283115386963, 0.02306339330971241, -0.21239283680915833, 0.03483888506889343, 0.0065180957317352295, -0.03357160836458206, -0.11715450882911682, -0.40232446789741516, 0.2563615143299103, -0.07678636908531189, 0.16888119280338287, -0.04085487127304077, 0.04937058687210083, 0.20073705911636353, -0.5037559270858765, 0.05050276964902878, -0.07239267230033875, 0.3635871410369873, -0.1539391577243805, 0.01953607052564621, 0.23668713867664337, -0.2818394899368286, 0.6828809380531311, -0.30027705430984497, 0.3237898051738739, -0.10701091587543488, 0.018488794565200806, -0.3644412159919739, -0.1723620593547821, -0.08260313421487808, 0.230376735329628, 0.002069476991891861, 0.7693324685096741, -0.08069546520709991, -0.3536863327026367, -0.19044020771980286, 0.1617283672094345, -0.23571264743804932, -0.22333142161369324, -0.16530045866966248, -0.2613714337348938, -0.3035412132740021, 0.22521772980690002, 0.10040123015642166, 0.15587183833122253, -0.2812294065952301, -0.3021184206008911, 0.026003604754805565, -0.0011469647288322449, 0.08619536459445953, -0.16672855615615845, -0.026849646121263504, 0.0362161323428154, 0.6639813184738159, -0.3151652216911316, 0.003426592331379652, 0.25937315821647644, 0.363582581281662, 0.2772989571094513, 0.13558177649974823, 0.1684017777442932, -0.07802929729223251, 0.16677631437778473, 0.8263382911682129, 0.1594078093767166, 0.23823609948158264, -0.2188805639743805, 0.33667007088661194, -0.4187341332435608, 0.003567427396774292, 0.19658835232257843, -0.09242197871208191, -0.16093581914901733, 0.24352499842643738, 0.41675865650177, -0.09666501730680466, 0.10659737884998322, 0.1142304539680481, 0.3840652108192444, 0.1764860451221466, 0.20738890767097473, 0.13277371227741241, 0.9799233675003052, -0.3102877736091614, 0.16982372105121613, -0.04234737157821655, -0.0031089261174201965, -0.04354431852698326, -0.6333492994308472, -0.11661183834075928, -0.20017999410629272, -0.3024233281612396, 0.11174935102462769, 0.08568943291902542, -0.10316911339759827, 0.055813271552324295, -0.09285952150821686, 0.0855586901307106, -0.19770905375480652, 0.41906434297561646, -0.19767966866493225, 0.2439996302127838, -0.32617297768592834, -0.4959625005722046, -0.15647678077220917, 0.16487178206443787, 0.031437039375305176, -0.04853859543800354, -0.059421706944704056, 0.011713005602359772, -0.13057313859462738, 0.18725842237472534, -0.31405773758888245, 0.021645426750183105, 0.31231430172920227, -0.02313263900578022, -0.14394286274909973, -0.14292877912521362, 0.05420947074890137, -0.5641478300094604, 0.30512750148773193, 0.23124092817306519, -0.17710986733436584, 0.3257598876953125, -0.15534146130084991, 0.021448682993650436, 0.17042016983032227, -0.1134125217795372, 0.26708027720451355, 0.07743698358535767, -0.11875835806131363, 0.16013307869434357, 0.16236057877540588, -0.19428834319114685, -0.09682602435350418, -0.015537142753601074, -0.015437187626957893, -0.01255611702799797, -0.06439370661973953, 0.093236543238163, -0.10974498838186264, -0.16716268658638, 0.05558819696307182, 0.05979766696691513, -0.1893545538187027, 0.3783528208732605, -0.09678718447685242, -0.15456964075565338, -0.008890262804925442, 0.3713226616382599, -0.32756173610687256, -0.19321994483470917, 0.09207242727279663, 0.31886476278305054, -0.18478575348854065, -0.20151659846305847, 0.3515964150428772, -0.012421196326613426, -0.5109376907348633, 0.2792467772960663, -0.35034340620040894, -0.01118190586566925, 0.16701765358448029, 0.016943996772170067, -0.006683635991066694, -0.19413642585277557, -0.16645605862140656, -0.09571659564971924, -0.14830030500888824, -0.05033358186483383, 0.10745757818222046, 0.2067873179912567, -0.4769432544708252, 0.09458194673061371, -0.021793771535158157, 0.40373659133911133, -0.19476406276226044, 0.16495415568351746, -0.3420085608959198, 0.23262569308280945, -0.29311177134513855, -0.45957010984420776, 0.037413790822029114, -0.2678847014904022, -0.045747481286525726, 0.09241914004087448, -0.1529419869184494, -0.12227412313222885, -0.23628827929496765, 0.19033539295196533, 0.189319908618927, 0.17391738295555115, -0.16682016849517822, -0.34320151805877686, 0.17436756193637848, -0.17570532858371735, 0.18915046751499176, 0.1338556706905365, -0.0990087017416954, -0.2690891921520233, 0.7326576113700867, 0.19018957018852234, -0.024524956941604614, 0.44166213274002075, 0.46100103855133057, 0.5311329960823059, -0.028858959674835205, 0.03738952428102493, 0.05452367290854454, 0.04260316491127014, -0.28762519359588623, 0.3660692274570465, 0.28036263585090637, 0.04939091578125954, 0.39158010482788086, -0.2303597778081894, 0.1374913603067398, 0.08632475137710571, 0.37588220834732056, 0.49084779620170593, -0.035772256553173065, -0.49716076254844666, 0.24364681541919708, 0.09298495948314667, 0.10267966985702515, -0.24107787013053894, 0.2818644344806671, -0.05562826991081238, -0.03644116222858429, 0.20599883794784546, 0.18303625285625458, -0.29970067739486694, -0.010596934705972672, 0.3796977996826172, 0.5373080372810364, -0.1991109848022461, -0.3758561313152313, -0.0419774167239666, 0.12178318202495575, -0.009604385122656822, 0.024430690333247185, -0.11847929656505585, 0.21105073392391205, 0.8026148080825806, 0.06376732885837555, 0.1803985834121704, 0.1867927610874176, -0.07245159149169922, 0.18699227273464203, -0.12172377109527588, -0.3046778440475464, 0.10303465276956558, -0.15545590221881866, -0.04155028238892555, 0.07164712250232697, 0.21780909597873688, -0.18861845135688782, -0.1876366287469864, -0.4336097240447998, 0.06782592833042145, -0.14034484326839447, 0.23643556237220764, 0.07064389437437057, 0.011292919516563416, -0.40676021575927734, 0.23104017972946167, -0.06329773366451263, 0.22097136080265045, 0.4582326114177704, 0.5591541528701782, 0.21365556120872498, 0.24056142568588257, -0.21015866100788116, -0.06845530867576599, 0.22913074493408203, -0.18099212646484375, 0.09044861048460007, 0.4119534194469452, -0.2922443151473999, -0.23383483290672302, -0.24112413823604584, 0.22108159959316254, 0.19341081380844116, -0.45813703536987305, 0.43371787667274475, 0.3062591850757599, 0.06670287996530533, 0.0987987220287323, 0.18956217169761658, -0.18546995520591736, 0.20504236221313477, 0.1533985584974289, 0.031063273549079895, -0.0819806158542633, -0.3525286018848419, -0.030681375414133072, 0.3223510682582855, -0.05932959169149399, 0.42182379961013794, 0.11201243102550507, -0.17466874420642853, -0.21328380703926086, -0.058081768453121185, -0.22172901034355164, -0.09328427910804749, 0.26636549830436707, -0.5355953574180603, 0.07447651028633118, -0.1866752654314041, 0.02572821080684662, -0.4233056902885437, 0.6617635488510132, 0.24154812097549438, 0.07221417129039764, -0.35519134998321533, -0.29439595341682434, -0.23527970910072327, 0.2907281517982483, -0.4481869339942932, -0.014662988483905792, 0.06173192709684372, 0.4491553008556366, 0.06895572692155838, 0.025518983602523804, -0.2532501816749573, -0.25601741671562195, -0.12963348627090454, 0.28376272320747375, -0.13120701909065247, 0.06262820959091187, 0.12757046520709991, 0.015935787931084633, -0.14396265149116516, -0.4498974680900574, 0.3557792901992798, 0.10339139401912689, -0.036318931728601456, 0.08136772364377975, -0.23051905632019043, 0.4120981991291046, -0.2536555528640747, 0.02452188730239868, -0.18090640008449554, 0.012954097241163254, 0.0780438557267189, -0.27691221237182617, -0.3581109642982483, -0.106882244348526, 0.034435685724020004, -0.29862281680107117, -0.1686069518327713, 0.10910940170288086, 0.020840056240558624, 0.03685014694929123, -0.1390921026468277, 0.1992226094007492, -0.08289027959108353, 0.38733887672424316, 0.08963944017887115, -0.18663540482521057, -0.26398766040802, 0.3944457173347473, 0.28055137395858765, 0.23066475987434387, 0.1072213351726532, 0.3361835479736328, -0.43927863240242004, -0.1555042266845703, 0.3613762855529785, 0.2324036955833435, -0.4046543836593628, 0.006576307117938995, 0.25290530920028687, -0.18358075618743896, -0.02321651205420494, -0.13050611317157745, -0.12933382391929626, -0.013140063732862473, -0.005518182180821896, -0.12338262796401978, 0.33634501695632935, 0.07808706164360046, -0.08841875195503235, -0.07756863534450531, 0.000375114381313324, 0.07786931842565536, 0.020994901657104492, 0.12060888111591339, 0.1628909409046173 ]
https://github.com/huggingface/datasets/issues/5990
So, other than the random connection drops here and there, any idea why the progress does not continue where it left off? ```bash Pushing split train to the Hub. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 28/28 [00:02<00:00, 10.79ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 28/28 [00:02<00:00, 13.65ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 28/28 [00:02<00:00, 13.39ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 28/28 [00:02<00:00, 13.04ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 28/28 [00:02<00:00, 13.52ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 28/28 [00:02<00:00, 12.28ba/s] Pushing dataset shards to the dataset hub: 20%|██████████████████████ | 75/381 [1:34:39<6:26:11, 75.72s/it] Exception: Error while uploading 'data/train-00075-of-00381-1614bc251b778766.parquet' to the Hub., with stacktrace: <traceback object at 0x7fab6d9a4980>, and type: <class 'RuntimeError'>, and cause: HTTPSConnectionPool(host='s3.us-east-1.amazonaws.com', port=443): Max retries exceeded with url: /lfs.huggingface.co/repos/3b/31/3b311464573d8d63b137fcd5b40af1e7a5b1306843c88e80372d0117157504e5/ed8dae933fb79ae1ef5fb1f698f5125d3e1c02977ac69438631f152bb3bfdd1e?X-Amz-Algorithm=AWS4-HMAC-SHA256&X- Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA4N7VTDGO27GPWFUO%2F20230629%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230629T053004Z&X-Amz-Expires=86400&X-Amz-Signature=da2b26270edfd6d0 d069c015a5a432031107a8664c3f0917717e5e40c688183c&X-Amz-SignedHeaders=host&partNumber=1&uploadId=2erWGHTh3ICqBLU_QvHfnygZ2tkMWbL0rEqpJdYohCKHUHnfwMjvoBIg0TI_KSGn4rSKxUxOyqSIzFUFSRSzixZeLeneaXJOw.Qx8 zLKSV5xV7HRQDj4RBesNve6cSoo&x-id=UploadPart (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:2426)'))) Push failed, retrying Attempting to push to hub Pushing split train to the Hub. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 28/28 [00:02<00:00, 12.09ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 28/28 [00:02<00:00, 11.51ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 28/28 [00:02<00:00, 10.77ba/s] Pushing dataset shards to the dataset hub: 20%|██████████████████████▋ | 77/381 [1:32:50<6:06:34, 72.35s/it] Exception: Error while uploading 'data/train-00077-of-00381-368b2327a9908aab.parquet' to the Hub., with stacktrace: <traceback object at 0x7fab45b27f80>, and type: <class 'RuntimeError'>, and cause: HTTPSConnectionPool(host='s3.us-east-1.amazonaws.com', port=443): Max retries exceeded with url: /lfs.huggingface.co/repos/3b/31/3b311464573d8d63b137fcd5b40af1e7a5b1306843c88e80372d0117157504e5/9462ff2c5e61283b53b091984a22de2f41a2f6e37b681171e2eca4a998f979cb?X-Amz-Algorithm=AWS4-HMAC-SHA256&X- Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA4N7VTDGO27GPWFUO%2F20230629%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230629T070510Z&X-Amz-Expires=86400&X-Amz-Signature=9ab8487b93d443cd 21f05476405855d46051a0771b4986bbb20f770ded21b1a4&X-Amz-SignedHeaders=host&partNumber=1&uploadId=UiHX1B.DcoAO2QmIHpWpCuNPwhXU_o1dsTkTGPqZt1P51o9k0yz.EsFD9eKpQMwgAST3jOatRG78I_JWRBeLBDYYVNp8r0TpIdeSg eUg8uwPZOCPw9y5mWOw8MWJrnBo&x-id=UploadPart (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:2426)'))) Push failed, retrying Attempting to push to hub Pushing split train to the Hub. Pushing dataset shards to the dataset hub: 8%|████████▋ | 29/381 [27:39<5:50:03, 59.67s/it] Map: 36%|████████████████████████████████████████████████████ | 1000/2764 [00:35<00:34, 51.63 examples/Map: 72%|████████████████████████████████████████████████████████████████████████████████████████████████████████▏ | 2000/2764 [00:40<00:15, 49.06 examples/Map: 72%|████████████████████████████████████████████████████████████████████████████████████████████████████████▏ | 2000/2764 [00:55<00:15, 49.06 examples/Map: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2764/2764 [00:56<00:00, 48.82 examples/Pushing dataset shards to the dataset hub: 8%|████████▉ | 30/381 [28:35<5:43:03, 58.64s/iPushing dataset shards to the dataset hub: 8%|█████████▎ | 31/381 [29:40<5:52:18, 60.40s/iPushing dataset shards to the dataset hub: 8%|█████████▌ | 32/381 [30:46<6:02:20, 62.29s/it] Map: 36%|███████████████████████████████████████████████████▎ ``` This is actually the issue that wastes the most time for me, and I need it fixed. Please advice on how I can go about it. Notice how the progress goes from | 77/381 to 30/381
Pushing a large dataset on the hub consistently hangs
### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
352
Pushing a large dataset on the hub consistently hangs ### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` So, other than the random connection drops here and there, any idea why the progress does not continue where it left off? ```bash Pushing split train to the Hub. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 28/28 [00:02<00:00, 10.79ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 28/28 [00:02<00:00, 13.65ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 28/28 [00:02<00:00, 13.39ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 28/28 [00:02<00:00, 13.04ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 28/28 [00:02<00:00, 13.52ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 28/28 [00:02<00:00, 12.28ba/s] Pushing dataset shards to the dataset hub: 20%|██████████████████████ | 75/381 [1:34:39<6:26:11, 75.72s/it] Exception: Error while uploading 'data/train-00075-of-00381-1614bc251b778766.parquet' to the Hub., with stacktrace: <traceback object at 0x7fab6d9a4980>, and type: <class 'RuntimeError'>, and cause: HTTPSConnectionPool(host='s3.us-east-1.amazonaws.com', port=443): Max retries exceeded with url: /lfs.huggingface.co/repos/3b/31/3b311464573d8d63b137fcd5b40af1e7a5b1306843c88e80372d0117157504e5/ed8dae933fb79ae1ef5fb1f698f5125d3e1c02977ac69438631f152bb3bfdd1e?X-Amz-Algorithm=AWS4-HMAC-SHA256&X- Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA4N7VTDGO27GPWFUO%2F20230629%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230629T053004Z&X-Amz-Expires=86400&X-Amz-Signature=da2b26270edfd6d0 d069c015a5a432031107a8664c3f0917717e5e40c688183c&X-Amz-SignedHeaders=host&partNumber=1&uploadId=2erWGHTh3ICqBLU_QvHfnygZ2tkMWbL0rEqpJdYohCKHUHnfwMjvoBIg0TI_KSGn4rSKxUxOyqSIzFUFSRSzixZeLeneaXJOw.Qx8 zLKSV5xV7HRQDj4RBesNve6cSoo&x-id=UploadPart (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:2426)'))) Push failed, retrying Attempting to push to hub Pushing split train to the Hub. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 28/28 [00:02<00:00, 12.09ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 28/28 [00:02<00:00, 11.51ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 28/28 [00:02<00:00, 10.77ba/s] Pushing dataset shards to the dataset hub: 20%|██████████████████████▋ | 77/381 [1:32:50<6:06:34, 72.35s/it] Exception: Error while uploading 'data/train-00077-of-00381-368b2327a9908aab.parquet' to the Hub., with stacktrace: <traceback object at 0x7fab45b27f80>, and type: <class 'RuntimeError'>, and cause: HTTPSConnectionPool(host='s3.us-east-1.amazonaws.com', port=443): Max retries exceeded with url: /lfs.huggingface.co/repos/3b/31/3b311464573d8d63b137fcd5b40af1e7a5b1306843c88e80372d0117157504e5/9462ff2c5e61283b53b091984a22de2f41a2f6e37b681171e2eca4a998f979cb?X-Amz-Algorithm=AWS4-HMAC-SHA256&X- Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA4N7VTDGO27GPWFUO%2F20230629%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230629T070510Z&X-Amz-Expires=86400&X-Amz-Signature=9ab8487b93d443cd 21f05476405855d46051a0771b4986bbb20f770ded21b1a4&X-Amz-SignedHeaders=host&partNumber=1&uploadId=UiHX1B.DcoAO2QmIHpWpCuNPwhXU_o1dsTkTGPqZt1P51o9k0yz.EsFD9eKpQMwgAST3jOatRG78I_JWRBeLBDYYVNp8r0TpIdeSg eUg8uwPZOCPw9y5mWOw8MWJrnBo&x-id=UploadPart (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:2426)'))) Push failed, retrying Attempting to push to hub Pushing split train to the Hub. Pushing dataset shards to the dataset hub: 8%|████████▋ | 29/381 [27:39<5:50:03, 59.67s/it] Map: 36%|████████████████████████████████████████████████████ | 1000/2764 [00:35<00:34, 51.63 examples/Map: 72%|████████████████████████████████████████████████████████████████████████████████████████████████████████▏ | 2000/2764 [00:40<00:15, 49.06 examples/Map: 72%|████████████████████████████████████████████████████████████████████████████████████████████████████████▏ | 2000/2764 [00:55<00:15, 49.06 examples/Map: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2764/2764 [00:56<00:00, 48.82 examples/Pushing dataset shards to the dataset hub: 8%|████████▉ | 30/381 [28:35<5:43:03, 58.64s/iPushing dataset shards to the dataset hub: 8%|█████████▎ | 31/381 [29:40<5:52:18, 60.40s/iPushing dataset shards to the dataset hub: 8%|█████████▌ | 32/381 [30:46<6:02:20, 62.29s/it] Map: 36%|███████████████████████████████████████████████████▎ ``` This is actually the issue that wastes the most time for me, and I need it fixed. Please advice on how I can go about it. Notice how the progress goes from | 77/381 to 30/381
[ -0.3251087963581085, -0.42933112382888794, -0.06096188724040985, 0.08869528025388718, 0.21317243576049805, -0.06696006655693054, 0.1970674693584442, 0.5384528636932373, 0.05225852131843567, 0.3061686158180237, 0.08448541909456253, 0.10903309285640717, 0.03724048659205437, 0.22024406492710114, 0.14667896926403046, 0.2332618236541748, 0.25349166989326477, -0.10799236595630646, 0.27970409393310547, -0.06858120858669281, -0.06573061645030975, -0.15738080441951752, 0.10763393342494965, -0.10093242675065994, -0.7575782537460327, 0.04432877153158188, 0.22587668895721436, 0.2064542919397354, 0.1921502649784088, -0.16747573018074036, 0.20722517371177673, 0.25278791785240173, -0.16246680915355682, 0.6471035480499268, -0.00012341895489953458, -0.05790407583117485, 0.25191041827201843, 0.02304328978061676, -0.3664642572402954, 0.09019968658685684, -0.10475093126296997, -0.13000282645225525, -0.2037355899810791, 0.1003957986831665, 0.03635609894990921, 0.45928943157196045, -0.19047336280345917, -0.16487863659858704, 0.21318119764328003, -0.0651368647813797, 0.02760709449648857, 0.17410922050476074, 0.014200866222381592, -0.24395343661308289, 0.20720058679580688, 0.13026978075504303, -0.30730724334716797, -0.07190019637346268, 0.49071699380874634, 0.13820913434028625, -0.1179051548242569, -0.07936432957649231, -0.11190301179885864, -0.11168365180492401, 0.016268212348222733, -0.3535960912704468, -0.089785136282444, -0.3143678307533264, 0.34380003809928894, 0.24355612695217133, 0.14077115058898926, -0.08090770244598389, -0.2698417603969574, -0.07041946053504944, -0.11939385533332825, -0.1470957100391388, 0.28435736894607544, 0.16139265894889832, -0.2762324810028076, 0.0654551237821579, -0.13129226863384247, -0.4053599536418915, -0.12707537412643433, -0.03554612770676613, -0.14915555715560913, -0.03168031945824623, 0.1751161366701126, 0.08743235468864441, 0.2067568451166153, -0.05901416763663292, 0.3941405117511749, -0.2691796123981476, 0.0901857241988182, -0.2755673825740814, -0.41740137338638306, 0.13888457417488098, 0.08934485912322998, 0.07516989856958389, -0.042328789830207825, -0.12489776313304901, -0.22944197058677673, 0.44265317916870117, -0.19254255294799805, 0.07224048674106598, 0.27406084537506104, -0.1266958862543106, 0.035612236708402634, -0.06530951708555222, 0.3070811629295349, 0.14404165744781494, -0.2572271227836609, 0.09562107175588608, 0.004041291773319244, -0.11014997959136963, -0.013009496033191681, -0.025750624015927315, 0.0792459174990654, -0.22842007875442505, -0.3421907424926758, 0.2250162661075592, -0.16784855723381042, 0.2685824930667877, 0.20871514081954956, 0.24827389419078827, 0.08709130436182022, 0.3373471796512604, -0.27540260553359985, 0.022007297724485397, -0.23613813519477844, -0.19603271782398224, -0.18941564857959747, -0.13765454292297363, 0.22148294746875763, 0.33565178513526917, 0.19451121985912323, -0.3410741686820984, -0.24856320023536682, 0.07881910353899002, 0.49135810136795044, -0.1306176483631134, -0.20826470851898193, -0.13527116179466248, 0.12670336663722992, 0.4150709807872772, 0.11111826449632645, 0.425483763217926, -0.1380186229944229, -0.1203937754034996, -0.21549536287784576, 0.057632461190223694, -0.18095824122428894, -0.29855096340179443, 0.236887589097023, 0.09342896938323975, -0.14131808280944824, 0.012494992464780807, -0.19530931115150452, -0.20652753114700317, -0.10413315892219543, 0.3453899025917053, -0.04829101264476776, 0.07182597368955612, -0.05895145982503891, -0.009029572829604149, 0.16733375191688538, 0.3914467692375183, -0.46486231684684753, 0.2811201512813568, 0.06217803806066513, 0.4197710156440735, -0.2656343877315521, 0.31870418787002563, -0.07181254029273987, 0.1722499132156372, -0.11614037305116653, 0.008509308099746704, -0.244670569896698, -0.6641231179237366, -0.4377872347831726, 0.4218234121799469, -0.1620047390460968, 0.16865754127502441, 0.030979372560977936, 0.14459466934204102, 0.42355436086654663, -0.36917978525161743, 0.3288465142250061, 0.2769600749015808, -0.1284511536359787, 0.1686631292104721, -0.2560868263244629, -0.23015055060386658, -0.34304046630859375, 0.3827191889286041, 0.2105250358581543, -0.2159123718738556, 0.012101415544748306, 0.46206918358802795, 0.23962244391441345, 0.1523667424917221, 0.3582223951816559, 0.26409244537353516, 0.5892544388771057, -0.15352578461170197, -0.14096936583518982, -0.15002700686454773, -0.5206427574157715, 0.43066176772117615, 0.3863000273704529, -0.12492451071739197, -0.14289477467536926, -0.07865099608898163, -0.22074106335639954, 0.15172049403190613, -0.3061752915382385, 0.3593229055404663, -0.03207937255501747, -0.28083735704421997, -0.034529704600572586, 0.23081551492214203, 0.01316806674003601, 0.37530258297920227, -0.0534038171172142, 0.0001145191490650177, -0.08453143388032913, 0.589294970035553, 0.12691321969032288, -0.23005501925945282, 0.06565289199352264, 0.19912466406822205, 0.14771544933319092, -0.3349977135658264, -0.15287035703659058, 0.11965660005807877, 0.025633741170167923, 0.1757788360118866, 0.26884737610816956, 0.05140337347984314, 0.3028479516506195, -0.034123025834560394, 0.2301027476787567, 0.12599213421344757, -0.11914559453725815, -0.24972756206989288, -0.11160072684288025, 0.16405045986175537, -0.018670421093702316, 0.24425914883613586, -0.1308334469795227, 0.018514275550842285, 0.13719388842582703, -0.09259036928415298, 0.0758800134062767, 0.10112706571817398, 0.31888532638549805, -0.04317906126379967, 0.07725636661052704, -0.03980230540037155, 0.09870178997516632, 0.46279701590538025, 0.6134483218193054, 0.012248978018760681, -0.41306638717651367, 0.1094224750995636, -0.009646803140640259, 0.06047262251377106, 0.05362584441900253, 0.025167375802993774, -0.07241889834403992, 0.010686881840229034, -0.0824461579322815, -0.30172306299209595, -0.14531058073043823, -0.3921554684638977, -0.07417018711566925, 0.2588631510734558, 0.0007041282951831818, 0.1754174530506134, 0.08643867075443268, -0.12469619512557983, -0.139383465051651, -0.22530192136764526, 0.23488369584083557, 0.267243355512619, -0.07326918840408325, 0.01306074857711792, -0.25176653265953064, 0.19057311117649078, 0.11472766101360321, -0.3452693521976471, -0.4584461748600006, -0.5935556888580322, 0.03924757242202759, 0.41381070017814636, -0.005098491907119751, 0.15742459893226624, 0.22899895906448364, 0.227858304977417, 0.19770047068595886, -0.22055822610855103, -0.420364111661911, -0.2874385714530945, -0.06433404982089996, -0.10546663403511047, 0.6536206007003784, 0.11534883826971054, 0.1595478355884552, 0.24570858478546143, -0.060959890484809875, -0.41670650243759155, 0.036050885915756226, 0.014210517518222332, -0.1369485855102539, 0.2540033757686615, -0.3656550347805023, 0.25909745693206787, 0.044579774141311646, -0.0024777650833129883, 0.17514558136463165, -0.22877919673919678, 0.0010563060641288757, 0.2825095057487488, -0.023783313110470772, -0.23724283277988434, 0.030204840004444122, 0.19706696271896362, -0.03649286925792694, -0.5179988741874695, 0.1423984169960022, -0.1319684237241745, 0.01018792949616909, -0.03397040814161301, 0.25232237577438354, -0.07725120335817337, 0.13748645782470703, -0.5111334919929504, 0.10514205694198608, -0.4406029284000397, 0.15532219409942627, -0.03851146996021271, -0.2520192861557007, 0.038356222212314606, 0.1205354630947113, -0.09105511009693146, 0.15005257725715637, -0.6417413353919983, 0.056516218930482864, -0.4287385940551758, 0.3723188042640686, -0.027623241767287254, -0.19984112679958344, -0.044800642877817154, -0.11843064427375793, 0.021422982215881348, 0.08745451271533966, -0.0635109394788742, 0.11660970002412796, 0.44347894191741943, -0.14121459424495697, -0.03429589420557022, 0.23535628616809845, 0.19166912138462067, 0.2653641700744629, 0.23575785756111145, -0.14393195509910583, 0.27466556429862976, 0.31208908557891846, 0.2016386240720749, -0.3055754005908966, -0.20440888404846191, 0.1741175502538681, -0.07299759984016418, -0.27569931745529175, 0.0135960653424263, 0.004383929073810577, 0.3032492399215698, -0.05015849694609642, -0.13071033358573914, 0.22629301249980927, -0.5607283115386963, 0.02306339330971241, -0.21239283680915833, 0.03483888506889343, 0.0065180957317352295, -0.03357160836458206, -0.11715450882911682, -0.40232446789741516, 0.2563615143299103, -0.07678636908531189, 0.16888119280338287, -0.04085487127304077, 0.04937058687210083, 0.20073705911636353, -0.5037559270858765, 0.05050276964902878, -0.07239267230033875, 0.3635871410369873, -0.1539391577243805, 0.01953607052564621, 0.23668713867664337, -0.2818394899368286, 0.6828809380531311, -0.30027705430984497, 0.3237898051738739, -0.10701091587543488, 0.018488794565200806, -0.3644412159919739, -0.1723620593547821, -0.08260313421487808, 0.230376735329628, 0.002069476991891861, 0.7693324685096741, -0.08069546520709991, -0.3536863327026367, -0.19044020771980286, 0.1617283672094345, -0.23571264743804932, -0.22333142161369324, -0.16530045866966248, -0.2613714337348938, -0.3035412132740021, 0.22521772980690002, 0.10040123015642166, 0.15587183833122253, -0.2812294065952301, -0.3021184206008911, 0.026003604754805565, -0.0011469647288322449, 0.08619536459445953, -0.16672855615615845, -0.026849646121263504, 0.0362161323428154, 0.6639813184738159, -0.3151652216911316, 0.003426592331379652, 0.25937315821647644, 0.363582581281662, 0.2772989571094513, 0.13558177649974823, 0.1684017777442932, -0.07802929729223251, 0.16677631437778473, 0.8263382911682129, 0.1594078093767166, 0.23823609948158264, -0.2188805639743805, 0.33667007088661194, -0.4187341332435608, 0.003567427396774292, 0.19658835232257843, -0.09242197871208191, -0.16093581914901733, 0.24352499842643738, 0.41675865650177, -0.09666501730680466, 0.10659737884998322, 0.1142304539680481, 0.3840652108192444, 0.1764860451221466, 0.20738890767097473, 0.13277371227741241, 0.9799233675003052, -0.3102877736091614, 0.16982372105121613, -0.04234737157821655, -0.0031089261174201965, -0.04354431852698326, -0.6333492994308472, -0.11661183834075928, -0.20017999410629272, -0.3024233281612396, 0.11174935102462769, 0.08568943291902542, -0.10316911339759827, 0.055813271552324295, -0.09285952150821686, 0.0855586901307106, -0.19770905375480652, 0.41906434297561646, -0.19767966866493225, 0.2439996302127838, -0.32617297768592834, -0.4959625005722046, -0.15647678077220917, 0.16487178206443787, 0.031437039375305176, -0.04853859543800354, -0.059421706944704056, 0.011713005602359772, -0.13057313859462738, 0.18725842237472534, -0.31405773758888245, 0.021645426750183105, 0.31231430172920227, -0.02313263900578022, -0.14394286274909973, -0.14292877912521362, 0.05420947074890137, -0.5641478300094604, 0.30512750148773193, 0.23124092817306519, -0.17710986733436584, 0.3257598876953125, -0.15534146130084991, 0.021448682993650436, 0.17042016983032227, -0.1134125217795372, 0.26708027720451355, 0.07743698358535767, -0.11875835806131363, 0.16013307869434357, 0.16236057877540588, -0.19428834319114685, -0.09682602435350418, -0.015537142753601074, -0.015437187626957893, -0.01255611702799797, -0.06439370661973953, 0.093236543238163, -0.10974498838186264, -0.16716268658638, 0.05558819696307182, 0.05979766696691513, -0.1893545538187027, 0.3783528208732605, -0.09678718447685242, -0.15456964075565338, -0.008890262804925442, 0.3713226616382599, -0.32756173610687256, -0.19321994483470917, 0.09207242727279663, 0.31886476278305054, -0.18478575348854065, -0.20151659846305847, 0.3515964150428772, -0.012421196326613426, -0.5109376907348633, 0.2792467772960663, -0.35034340620040894, -0.01118190586566925, 0.16701765358448029, 0.016943996772170067, -0.006683635991066694, -0.19413642585277557, -0.16645605862140656, -0.09571659564971924, -0.14830030500888824, -0.05033358186483383, 0.10745757818222046, 0.2067873179912567, -0.4769432544708252, 0.09458194673061371, -0.021793771535158157, 0.40373659133911133, -0.19476406276226044, 0.16495415568351746, -0.3420085608959198, 0.23262569308280945, -0.29311177134513855, -0.45957010984420776, 0.037413790822029114, -0.2678847014904022, -0.045747481286525726, 0.09241914004087448, -0.1529419869184494, -0.12227412313222885, -0.23628827929496765, 0.19033539295196533, 0.189319908618927, 0.17391738295555115, -0.16682016849517822, -0.34320151805877686, 0.17436756193637848, -0.17570532858371735, 0.18915046751499176, 0.1338556706905365, -0.0990087017416954, -0.2690891921520233, 0.7326576113700867, 0.19018957018852234, -0.024524956941604614, 0.44166213274002075, 0.46100103855133057, 0.5311329960823059, -0.028858959674835205, 0.03738952428102493, 0.05452367290854454, 0.04260316491127014, -0.28762519359588623, 0.3660692274570465, 0.28036263585090637, 0.04939091578125954, 0.39158010482788086, -0.2303597778081894, 0.1374913603067398, 0.08632475137710571, 0.37588220834732056, 0.49084779620170593, -0.035772256553173065, -0.49716076254844666, 0.24364681541919708, 0.09298495948314667, 0.10267966985702515, -0.24107787013053894, 0.2818644344806671, -0.05562826991081238, -0.03644116222858429, 0.20599883794784546, 0.18303625285625458, -0.29970067739486694, -0.010596934705972672, 0.3796977996826172, 0.5373080372810364, -0.1991109848022461, -0.3758561313152313, -0.0419774167239666, 0.12178318202495575, -0.009604385122656822, 0.024430690333247185, -0.11847929656505585, 0.21105073392391205, 0.8026148080825806, 0.06376732885837555, 0.1803985834121704, 0.1867927610874176, -0.07245159149169922, 0.18699227273464203, -0.12172377109527588, -0.3046778440475464, 0.10303465276956558, -0.15545590221881866, -0.04155028238892555, 0.07164712250232697, 0.21780909597873688, -0.18861845135688782, -0.1876366287469864, -0.4336097240447998, 0.06782592833042145, -0.14034484326839447, 0.23643556237220764, 0.07064389437437057, 0.011292919516563416, -0.40676021575927734, 0.23104017972946167, -0.06329773366451263, 0.22097136080265045, 0.4582326114177704, 0.5591541528701782, 0.21365556120872498, 0.24056142568588257, -0.21015866100788116, -0.06845530867576599, 0.22913074493408203, -0.18099212646484375, 0.09044861048460007, 0.4119534194469452, -0.2922443151473999, -0.23383483290672302, -0.24112413823604584, 0.22108159959316254, 0.19341081380844116, -0.45813703536987305, 0.43371787667274475, 0.3062591850757599, 0.06670287996530533, 0.0987987220287323, 0.18956217169761658, -0.18546995520591736, 0.20504236221313477, 0.1533985584974289, 0.031063273549079895, -0.0819806158542633, -0.3525286018848419, -0.030681375414133072, 0.3223510682582855, -0.05932959169149399, 0.42182379961013794, 0.11201243102550507, -0.17466874420642853, -0.21328380703926086, -0.058081768453121185, -0.22172901034355164, -0.09328427910804749, 0.26636549830436707, -0.5355953574180603, 0.07447651028633118, -0.1866752654314041, 0.02572821080684662, -0.4233056902885437, 0.6617635488510132, 0.24154812097549438, 0.07221417129039764, -0.35519134998321533, -0.29439595341682434, -0.23527970910072327, 0.2907281517982483, -0.4481869339942932, -0.014662988483905792, 0.06173192709684372, 0.4491553008556366, 0.06895572692155838, 0.025518983602523804, -0.2532501816749573, -0.25601741671562195, -0.12963348627090454, 0.28376272320747375, -0.13120701909065247, 0.06262820959091187, 0.12757046520709991, 0.015935787931084633, -0.14396265149116516, -0.4498974680900574, 0.3557792901992798, 0.10339139401912689, -0.036318931728601456, 0.08136772364377975, -0.23051905632019043, 0.4120981991291046, -0.2536555528640747, 0.02452188730239868, -0.18090640008449554, 0.012954097241163254, 0.0780438557267189, -0.27691221237182617, -0.3581109642982483, -0.106882244348526, 0.034435685724020004, -0.29862281680107117, -0.1686069518327713, 0.10910940170288086, 0.020840056240558624, 0.03685014694929123, -0.1390921026468277, 0.1992226094007492, -0.08289027959108353, 0.38733887672424316, 0.08963944017887115, -0.18663540482521057, -0.26398766040802, 0.3944457173347473, 0.28055137395858765, 0.23066475987434387, 0.1072213351726532, 0.3361835479736328, -0.43927863240242004, -0.1555042266845703, 0.3613762855529785, 0.2324036955833435, -0.4046543836593628, 0.006576307117938995, 0.25290530920028687, -0.18358075618743896, -0.02321651205420494, -0.13050611317157745, -0.12933382391929626, -0.013140063732862473, -0.005518182180821896, -0.12338262796401978, 0.33634501695632935, 0.07808706164360046, -0.08841875195503235, -0.07756863534450531, 0.000375114381313324, 0.07786931842565536, 0.020994901657104492, 0.12060888111591339, 0.1628909409046173 ]
https://github.com/huggingface/datasets/issues/5990
If the any shard is missing on the Hub, it will re-upload it. It looks like the 30th shard was missing on the Hub in your case. It also means that the other files up to the 77th that were successfully uploaded won't be uploaded again. cc @mariosasko who might know better
Pushing a large dataset on the hub consistently hangs
### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
52
Pushing a large dataset on the hub consistently hangs ### Describe the bug Once I have locally built a large dataset that I want to push to hub, I use the recommended approach of .push_to_hub to get the dataset on the hub, and after pushing a few shards, it consistently hangs. This has happened over 40 times over the past week, and despite my best efforts to try and catch this happening and kill a process and restart, it seems to be extremely time wasting -- so I came to you to report this and to seek help. I already tried installing hf_transfer, but it doesn't support Byte file uploads so I uninstalled it. ### Reproduction ```python import multiprocessing as mp import pathlib from math import ceil import datasets import numpy as np from tqdm.auto import tqdm from tali.data.data import select_subtitles_between_timestamps from tali.utils import load_json tali_dataset_dir = "/data/" if __name__ == "__main__": full_dataset = datasets.load_dataset( "Antreas/TALI", num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir ) def data_generator(set_name, percentage: float = 1.0): dataset = full_dataset[set_name] for item in tqdm(dataset): video_list = item["youtube_content_video"] video_list = np.random.choice( video_list, int(ceil(len(video_list) * percentage)) ) if len(video_list) == 0: continue captions = item["youtube_subtitle_text"] captions = select_subtitles_between_timestamps( subtitle_dict=load_json( captions.replace( "/data/", tali_dataset_dir, ) ), starting_timestamp=0, ending_timestamp=100000000, ) for video_path in video_list: temp_path = video_path.replace("/data/", tali_dataset_dir) video_path_actual: pathlib.Path = pathlib.Path(temp_path) if video_path_actual.exists(): item["youtube_content_video"] = open(video_path_actual, "rb").read() item["youtube_subtitle_text"] = captions yield item train_generator = lambda: data_generator("train", percentage=0.1) val_generator = lambda: data_generator("val") test_generator = lambda: data_generator("test") train_data = datasets.Dataset.from_generator( train_generator, num_proc=mp.cpu_count(), writer_batch_size=5000, cache_dir=tali_dataset_dir, ) val_data = datasets.Dataset.from_generator( val_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) test_data = datasets.Dataset.from_generator( test_generator, writer_batch_size=5000, num_proc=mp.cpu_count(), cache_dir=tali_dataset_dir, ) dataset = datasets.DatasetDict( { "train": train_data, "val": val_data, "test": test_data, } ) succesful_competion = False while not succesful_competion: try: dataset.push_to_hub(repo_id="Antreas/TALI-small", max_shard_size="5GB") succesful_competion = True except Exception as e: print(e) ``` ### Logs ```shell Pushing dataset shards to the dataset hub: 33%|██████████████████████████████████████▎ | 7/21 [24:33<49:06, 210.45s/it] Error while uploading 'data/val-00007-of-00021-6b216a984af1a4c8.parquet' to the Hub. Pushing split train to the Hub. Resuming upload of the dataset shards. Pushing dataset shards to the dataset hub: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 46/46 [42:10<00:00, 55.01s/it] Pushing split val to the Hub. Resuming upload of the dataset shards. Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:01<00:00, 1.55ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.51s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.39ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:30<00:00, 30.19s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.28ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:24<00:00, 24.08s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.42ba/s] Upload 1 LFS files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:23<00:00, 23.97s/it] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.49ba/s] Creating parquet from Arrow format: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:02<00:00, 1.54ba/s^ Upload 1 LFS files: 0%| | 0/1 [04:42<?, ?it/s] Pushing dataset shards to the dataset hub: 52%|████████████████████████████████████████████████████████████▏ | 11/21 [17:23<15:48, 94.82s/it] That's where it got stuck ``` ### System info ```shell - huggingface_hub version: 0.15.1 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.35 - Python version: 3.10.11 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /root/.cache/huggingface/token - Has saved token ?: True - Who am I ?: Antreas - Configured git credential helpers: store - FastAI: N/A - Tensorflow: N/A - Torch: 2.1.0.dev20230606+cu121 - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.5.0 - hf_transfer: N/A - gradio: N/A - numpy: 1.24.3 - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /root/.cache/huggingface/assets - HF_TOKEN_PATH: /root/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` If the any shard is missing on the Hub, it will re-upload it. It looks like the 30th shard was missing on the Hub in your case. It also means that the other files up to the 77th that were successfully uploaded won't be uploaded again. cc @mariosasko who might know better
[ -0.3251087963581085, -0.42933112382888794, -0.06096188724040985, 0.08869528025388718, 0.21317243576049805, -0.06696006655693054, 0.1970674693584442, 0.5384528636932373, 0.05225852131843567, 0.3061686158180237, 0.08448541909456253, 0.10903309285640717, 0.03724048659205437, 0.22024406492710114, 0.14667896926403046, 0.2332618236541748, 0.25349166989326477, -0.10799236595630646, 0.27970409393310547, -0.06858120858669281, -0.06573061645030975, -0.15738080441951752, 0.10763393342494965, -0.10093242675065994, -0.7575782537460327, 0.04432877153158188, 0.22587668895721436, 0.2064542919397354, 0.1921502649784088, -0.16747573018074036, 0.20722517371177673, 0.25278791785240173, -0.16246680915355682, 0.6471035480499268, -0.00012341895489953458, -0.05790407583117485, 0.25191041827201843, 0.02304328978061676, -0.3664642572402954, 0.09019968658685684, -0.10475093126296997, -0.13000282645225525, -0.2037355899810791, 0.1003957986831665, 0.03635609894990921, 0.45928943157196045, -0.19047336280345917, -0.16487863659858704, 0.21318119764328003, -0.0651368647813797, 0.02760709449648857, 0.17410922050476074, 0.014200866222381592, -0.24395343661308289, 0.20720058679580688, 0.13026978075504303, -0.30730724334716797, -0.07190019637346268, 0.49071699380874634, 0.13820913434028625, -0.1179051548242569, -0.07936432957649231, -0.11190301179885864, -0.11168365180492401, 0.016268212348222733, -0.3535960912704468, -0.089785136282444, -0.3143678307533264, 0.34380003809928894, 0.24355612695217133, 0.14077115058898926, -0.08090770244598389, -0.2698417603969574, -0.07041946053504944, -0.11939385533332825, -0.1470957100391388, 0.28435736894607544, 0.16139265894889832, -0.2762324810028076, 0.0654551237821579, -0.13129226863384247, -0.4053599536418915, -0.12707537412643433, -0.03554612770676613, -0.14915555715560913, -0.03168031945824623, 0.1751161366701126, 0.08743235468864441, 0.2067568451166153, -0.05901416763663292, 0.3941405117511749, -0.2691796123981476, 0.0901857241988182, -0.2755673825740814, -0.41740137338638306, 0.13888457417488098, 0.08934485912322998, 0.07516989856958389, -0.042328789830207825, -0.12489776313304901, -0.22944197058677673, 0.44265317916870117, -0.19254255294799805, 0.07224048674106598, 0.27406084537506104, -0.1266958862543106, 0.035612236708402634, -0.06530951708555222, 0.3070811629295349, 0.14404165744781494, -0.2572271227836609, 0.09562107175588608, 0.004041291773319244, -0.11014997959136963, -0.013009496033191681, -0.025750624015927315, 0.0792459174990654, -0.22842007875442505, -0.3421907424926758, 0.2250162661075592, -0.16784855723381042, 0.2685824930667877, 0.20871514081954956, 0.24827389419078827, 0.08709130436182022, 0.3373471796512604, -0.27540260553359985, 0.022007297724485397, -0.23613813519477844, -0.19603271782398224, -0.18941564857959747, -0.13765454292297363, 0.22148294746875763, 0.33565178513526917, 0.19451121985912323, -0.3410741686820984, -0.24856320023536682, 0.07881910353899002, 0.49135810136795044, -0.1306176483631134, -0.20826470851898193, -0.13527116179466248, 0.12670336663722992, 0.4150709807872772, 0.11111826449632645, 0.425483763217926, -0.1380186229944229, -0.1203937754034996, -0.21549536287784576, 0.057632461190223694, -0.18095824122428894, -0.29855096340179443, 0.236887589097023, 0.09342896938323975, -0.14131808280944824, 0.012494992464780807, -0.19530931115150452, -0.20652753114700317, -0.10413315892219543, 0.3453899025917053, -0.04829101264476776, 0.07182597368955612, -0.05895145982503891, -0.009029572829604149, 0.16733375191688538, 0.3914467692375183, -0.46486231684684753, 0.2811201512813568, 0.06217803806066513, 0.4197710156440735, -0.2656343877315521, 0.31870418787002563, -0.07181254029273987, 0.1722499132156372, -0.11614037305116653, 0.008509308099746704, -0.244670569896698, -0.6641231179237366, -0.4377872347831726, 0.4218234121799469, -0.1620047390460968, 0.16865754127502441, 0.030979372560977936, 0.14459466934204102, 0.42355436086654663, -0.36917978525161743, 0.3288465142250061, 0.2769600749015808, -0.1284511536359787, 0.1686631292104721, -0.2560868263244629, -0.23015055060386658, -0.34304046630859375, 0.3827191889286041, 0.2105250358581543, -0.2159123718738556, 0.012101415544748306, 0.46206918358802795, 0.23962244391441345, 0.1523667424917221, 0.3582223951816559, 0.26409244537353516, 0.5892544388771057, -0.15352578461170197, -0.14096936583518982, -0.15002700686454773, -0.5206427574157715, 0.43066176772117615, 0.3863000273704529, -0.12492451071739197, -0.14289477467536926, -0.07865099608898163, -0.22074106335639954, 0.15172049403190613, -0.3061752915382385, 0.3593229055404663, -0.03207937255501747, -0.28083735704421997, -0.034529704600572586, 0.23081551492214203, 0.01316806674003601, 0.37530258297920227, -0.0534038171172142, 0.0001145191490650177, -0.08453143388032913, 0.589294970035553, 0.12691321969032288, -0.23005501925945282, 0.06565289199352264, 0.19912466406822205, 0.14771544933319092, -0.3349977135658264, -0.15287035703659058, 0.11965660005807877, 0.025633741170167923, 0.1757788360118866, 0.26884737610816956, 0.05140337347984314, 0.3028479516506195, -0.034123025834560394, 0.2301027476787567, 0.12599213421344757, -0.11914559453725815, -0.24972756206989288, -0.11160072684288025, 0.16405045986175537, -0.018670421093702316, 0.24425914883613586, -0.1308334469795227, 0.018514275550842285, 0.13719388842582703, -0.09259036928415298, 0.0758800134062767, 0.10112706571817398, 0.31888532638549805, -0.04317906126379967, 0.07725636661052704, -0.03980230540037155, 0.09870178997516632, 0.46279701590538025, 0.6134483218193054, 0.012248978018760681, -0.41306638717651367, 0.1094224750995636, -0.009646803140640259, 0.06047262251377106, 0.05362584441900253, 0.025167375802993774, -0.07241889834403992, 0.010686881840229034, -0.0824461579322815, -0.30172306299209595, -0.14531058073043823, -0.3921554684638977, -0.07417018711566925, 0.2588631510734558, 0.0007041282951831818, 0.1754174530506134, 0.08643867075443268, -0.12469619512557983, -0.139383465051651, -0.22530192136764526, 0.23488369584083557, 0.267243355512619, -0.07326918840408325, 0.01306074857711792, -0.25176653265953064, 0.19057311117649078, 0.11472766101360321, -0.3452693521976471, -0.4584461748600006, -0.5935556888580322, 0.03924757242202759, 0.41381070017814636, -0.005098491907119751, 0.15742459893226624, 0.22899895906448364, 0.227858304977417, 0.19770047068595886, -0.22055822610855103, -0.420364111661911, -0.2874385714530945, -0.06433404982089996, -0.10546663403511047, 0.6536206007003784, 0.11534883826971054, 0.1595478355884552, 0.24570858478546143, -0.060959890484809875, -0.41670650243759155, 0.036050885915756226, 0.014210517518222332, -0.1369485855102539, 0.2540033757686615, -0.3656550347805023, 0.25909745693206787, 0.044579774141311646, -0.0024777650833129883, 0.17514558136463165, -0.22877919673919678, 0.0010563060641288757, 0.2825095057487488, -0.023783313110470772, -0.23724283277988434, 0.030204840004444122, 0.19706696271896362, -0.03649286925792694, -0.5179988741874695, 0.1423984169960022, -0.1319684237241745, 0.01018792949616909, -0.03397040814161301, 0.25232237577438354, -0.07725120335817337, 0.13748645782470703, -0.5111334919929504, 0.10514205694198608, -0.4406029284000397, 0.15532219409942627, -0.03851146996021271, -0.2520192861557007, 0.038356222212314606, 0.1205354630947113, -0.09105511009693146, 0.15005257725715637, -0.6417413353919983, 0.056516218930482864, -0.4287385940551758, 0.3723188042640686, -0.027623241767287254, -0.19984112679958344, -0.044800642877817154, -0.11843064427375793, 0.021422982215881348, 0.08745451271533966, -0.0635109394788742, 0.11660970002412796, 0.44347894191741943, -0.14121459424495697, -0.03429589420557022, 0.23535628616809845, 0.19166912138462067, 0.2653641700744629, 0.23575785756111145, -0.14393195509910583, 0.27466556429862976, 0.31208908557891846, 0.2016386240720749, -0.3055754005908966, -0.20440888404846191, 0.1741175502538681, -0.07299759984016418, -0.27569931745529175, 0.0135960653424263, 0.004383929073810577, 0.3032492399215698, -0.05015849694609642, -0.13071033358573914, 0.22629301249980927, -0.5607283115386963, 0.02306339330971241, -0.21239283680915833, 0.03483888506889343, 0.0065180957317352295, -0.03357160836458206, -0.11715450882911682, -0.40232446789741516, 0.2563615143299103, -0.07678636908531189, 0.16888119280338287, -0.04085487127304077, 0.04937058687210083, 0.20073705911636353, -0.5037559270858765, 0.05050276964902878, -0.07239267230033875, 0.3635871410369873, -0.1539391577243805, 0.01953607052564621, 0.23668713867664337, -0.2818394899368286, 0.6828809380531311, -0.30027705430984497, 0.3237898051738739, -0.10701091587543488, 0.018488794565200806, -0.3644412159919739, -0.1723620593547821, -0.08260313421487808, 0.230376735329628, 0.002069476991891861, 0.7693324685096741, -0.08069546520709991, -0.3536863327026367, -0.19044020771980286, 0.1617283672094345, -0.23571264743804932, -0.22333142161369324, -0.16530045866966248, -0.2613714337348938, -0.3035412132740021, 0.22521772980690002, 0.10040123015642166, 0.15587183833122253, -0.2812294065952301, -0.3021184206008911, 0.026003604754805565, -0.0011469647288322449, 0.08619536459445953, -0.16672855615615845, -0.026849646121263504, 0.0362161323428154, 0.6639813184738159, -0.3151652216911316, 0.003426592331379652, 0.25937315821647644, 0.363582581281662, 0.2772989571094513, 0.13558177649974823, 0.1684017777442932, -0.07802929729223251, 0.16677631437778473, 0.8263382911682129, 0.1594078093767166, 0.23823609948158264, -0.2188805639743805, 0.33667007088661194, -0.4187341332435608, 0.003567427396774292, 0.19658835232257843, -0.09242197871208191, -0.16093581914901733, 0.24352499842643738, 0.41675865650177, -0.09666501730680466, 0.10659737884998322, 0.1142304539680481, 0.3840652108192444, 0.1764860451221466, 0.20738890767097473, 0.13277371227741241, 0.9799233675003052, -0.3102877736091614, 0.16982372105121613, -0.04234737157821655, -0.0031089261174201965, -0.04354431852698326, -0.6333492994308472, -0.11661183834075928, -0.20017999410629272, -0.3024233281612396, 0.11174935102462769, 0.08568943291902542, -0.10316911339759827, 0.055813271552324295, -0.09285952150821686, 0.0855586901307106, -0.19770905375480652, 0.41906434297561646, -0.19767966866493225, 0.2439996302127838, -0.32617297768592834, -0.4959625005722046, -0.15647678077220917, 0.16487178206443787, 0.031437039375305176, -0.04853859543800354, -0.059421706944704056, 0.011713005602359772, -0.13057313859462738, 0.18725842237472534, -0.31405773758888245, 0.021645426750183105, 0.31231430172920227, -0.02313263900578022, -0.14394286274909973, -0.14292877912521362, 0.05420947074890137, -0.5641478300094604, 0.30512750148773193, 0.23124092817306519, -0.17710986733436584, 0.3257598876953125, -0.15534146130084991, 0.021448682993650436, 0.17042016983032227, -0.1134125217795372, 0.26708027720451355, 0.07743698358535767, -0.11875835806131363, 0.16013307869434357, 0.16236057877540588, -0.19428834319114685, -0.09682602435350418, -0.015537142753601074, -0.015437187626957893, -0.01255611702799797, -0.06439370661973953, 0.093236543238163, -0.10974498838186264, -0.16716268658638, 0.05558819696307182, 0.05979766696691513, -0.1893545538187027, 0.3783528208732605, -0.09678718447685242, -0.15456964075565338, -0.008890262804925442, 0.3713226616382599, -0.32756173610687256, -0.19321994483470917, 0.09207242727279663, 0.31886476278305054, -0.18478575348854065, -0.20151659846305847, 0.3515964150428772, -0.012421196326613426, -0.5109376907348633, 0.2792467772960663, -0.35034340620040894, -0.01118190586566925, 0.16701765358448029, 0.016943996772170067, -0.006683635991066694, -0.19413642585277557, -0.16645605862140656, -0.09571659564971924, -0.14830030500888824, -0.05033358186483383, 0.10745757818222046, 0.2067873179912567, -0.4769432544708252, 0.09458194673061371, -0.021793771535158157, 0.40373659133911133, -0.19476406276226044, 0.16495415568351746, -0.3420085608959198, 0.23262569308280945, -0.29311177134513855, -0.45957010984420776, 0.037413790822029114, -0.2678847014904022, -0.045747481286525726, 0.09241914004087448, -0.1529419869184494, -0.12227412313222885, -0.23628827929496765, 0.19033539295196533, 0.189319908618927, 0.17391738295555115, -0.16682016849517822, -0.34320151805877686, 0.17436756193637848, -0.17570532858371735, 0.18915046751499176, 0.1338556706905365, -0.0990087017416954, -0.2690891921520233, 0.7326576113700867, 0.19018957018852234, -0.024524956941604614, 0.44166213274002075, 0.46100103855133057, 0.5311329960823059, -0.028858959674835205, 0.03738952428102493, 0.05452367290854454, 0.04260316491127014, -0.28762519359588623, 0.3660692274570465, 0.28036263585090637, 0.04939091578125954, 0.39158010482788086, -0.2303597778081894, 0.1374913603067398, 0.08632475137710571, 0.37588220834732056, 0.49084779620170593, -0.035772256553173065, -0.49716076254844666, 0.24364681541919708, 0.09298495948314667, 0.10267966985702515, -0.24107787013053894, 0.2818644344806671, -0.05562826991081238, -0.03644116222858429, 0.20599883794784546, 0.18303625285625458, -0.29970067739486694, -0.010596934705972672, 0.3796977996826172, 0.5373080372810364, -0.1991109848022461, -0.3758561313152313, -0.0419774167239666, 0.12178318202495575, -0.009604385122656822, 0.024430690333247185, -0.11847929656505585, 0.21105073392391205, 0.8026148080825806, 0.06376732885837555, 0.1803985834121704, 0.1867927610874176, -0.07245159149169922, 0.18699227273464203, -0.12172377109527588, -0.3046778440475464, 0.10303465276956558, -0.15545590221881866, -0.04155028238892555, 0.07164712250232697, 0.21780909597873688, -0.18861845135688782, -0.1876366287469864, -0.4336097240447998, 0.06782592833042145, -0.14034484326839447, 0.23643556237220764, 0.07064389437437057, 0.011292919516563416, -0.40676021575927734, 0.23104017972946167, -0.06329773366451263, 0.22097136080265045, 0.4582326114177704, 0.5591541528701782, 0.21365556120872498, 0.24056142568588257, -0.21015866100788116, -0.06845530867576599, 0.22913074493408203, -0.18099212646484375, 0.09044861048460007, 0.4119534194469452, -0.2922443151473999, -0.23383483290672302, -0.24112413823604584, 0.22108159959316254, 0.19341081380844116, -0.45813703536987305, 0.43371787667274475, 0.3062591850757599, 0.06670287996530533, 0.0987987220287323, 0.18956217169761658, -0.18546995520591736, 0.20504236221313477, 0.1533985584974289, 0.031063273549079895, -0.0819806158542633, -0.3525286018848419, -0.030681375414133072, 0.3223510682582855, -0.05932959169149399, 0.42182379961013794, 0.11201243102550507, -0.17466874420642853, -0.21328380703926086, -0.058081768453121185, -0.22172901034355164, -0.09328427910804749, 0.26636549830436707, -0.5355953574180603, 0.07447651028633118, -0.1866752654314041, 0.02572821080684662, -0.4233056902885437, 0.6617635488510132, 0.24154812097549438, 0.07221417129039764, -0.35519134998321533, -0.29439595341682434, -0.23527970910072327, 0.2907281517982483, -0.4481869339942932, -0.014662988483905792, 0.06173192709684372, 0.4491553008556366, 0.06895572692155838, 0.025518983602523804, -0.2532501816749573, -0.25601741671562195, -0.12963348627090454, 0.28376272320747375, -0.13120701909065247, 0.06262820959091187, 0.12757046520709991, 0.015935787931084633, -0.14396265149116516, -0.4498974680900574, 0.3557792901992798, 0.10339139401912689, -0.036318931728601456, 0.08136772364377975, -0.23051905632019043, 0.4120981991291046, -0.2536555528640747, 0.02452188730239868, -0.18090640008449554, 0.012954097241163254, 0.0780438557267189, -0.27691221237182617, -0.3581109642982483, -0.106882244348526, 0.034435685724020004, -0.29862281680107117, -0.1686069518327713, 0.10910940170288086, 0.020840056240558624, 0.03685014694929123, -0.1390921026468277, 0.1992226094007492, -0.08289027959108353, 0.38733887672424316, 0.08963944017887115, -0.18663540482521057, -0.26398766040802, 0.3944457173347473, 0.28055137395858765, 0.23066475987434387, 0.1072213351726532, 0.3361835479736328, -0.43927863240242004, -0.1555042266845703, 0.3613762855529785, 0.2324036955833435, -0.4046543836593628, 0.006576307117938995, 0.25290530920028687, -0.18358075618743896, -0.02321651205420494, -0.13050611317157745, -0.12933382391929626, -0.013140063732862473, -0.005518182180821896, -0.12338262796401978, 0.33634501695632935, 0.07808706164360046, -0.08841875195503235, -0.07756863534450531, 0.000375114381313324, 0.07786931842565536, 0.020994901657104492, 0.12060888111591339, 0.1628909409046173 ]
https://github.com/huggingface/datasets/issues/5936
Related, `float16` is the only dtype not supported by `Array2D` (probably by every `ArrayND`): ```python from datasets import Array2D, Features, Dataset import numpy as np for dtype in [ "bool", # ok "int8", # ok "int16", # ok "int32", # ok "int64", # ok "uint8", # ok "uint16", # ok "uint32", # ok "uint64", # ok "float16", # failed "float32", # ok "float64", # ok ]: features = Features({"foo": Array2D(dtype=dtype, shape=(3, 4))}) array = np.zeros((3, 4), dtype=dtype) try: dataset = Dataset.from_dict({"foo": [array]}, features=features) except Exception as e: print(f"Failed for dtype={dtype}") ```
Sequence of array not supported for most dtype
### Describe the bug Create a dataset composed of sequence of array fails for most dtypes (see code below). ### Steps to reproduce the bug ```python from datasets import Sequence, Array2D, Features, Dataset import numpy as np for dtype in [ "bool", # ok "int8", # failed "int16", # failed "int32", # failed "int64", # ok "uint8", # failed "uint16", # failed "uint32", # failed "uint64", # failed "float16", # failed "float32", # failed "float64", # ok ]: features = Features({"foo": Sequence(Array2D(dtype=dtype, shape=(2, 2)))}) sequence = [ [[1.0, 2.0], [3.0, 4.0]], [[5.0, 6.0], [7.0, 8.0]], ] array = np.array(sequence, dtype=dtype) try: dataset = Dataset.from_dict({"foo": [array]}, features=features) except Exception as e: print(f"Failed for dtype={dtype}") ``` Traceback for `dtype="int8"`: ``` Traceback (most recent call last): File "/home/qgallouedec/datasets/a.py", line 29, in <module> raise e File "/home/qgallouedec/datasets/a.py", line 26, in <module> dataset = Dataset.from_dict({"foo": [array]}, features=features) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 899, in from_dict pa_table = InMemoryTable.from_pydict(mapping=mapping) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 799, in from_pydict return cls(pa.Table.from_pydict(*args, **kwargs)) File "pyarrow/table.pxi", line 3725, in pyarrow.lib.Table.from_pydict File "pyarrow/table.pxi", line 5254, in pyarrow.lib._from_pydict File "pyarrow/array.pxi", line 350, in pyarrow.lib.asarray File "pyarrow/array.pxi", line 236, in pyarrow.lib.array File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/arrow_writer.py", line 204, in __arrow_array__ out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 1833, in wrapper return func(array, *args, **kwargs) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 2091, in cast_array_to_feature casted_values = _c(array.values, feature.feature) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 1833, in wrapper return func(array, *args, **kwargs) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 2139, in cast_array_to_feature return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 1833, in wrapper return func(array, *args, **kwargs) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 1967, in array_cast return pa_type.wrap_array(array) File "pyarrow/types.pxi", line 879, in pyarrow.lib.BaseExtensionType.wrap_array TypeError: Incompatible storage type for extension<arrow.py_extension_type<Array2DExtensionType>>: expected list<item: list<item: int8>>, got list<item: list<item: int64>> ``` ### Expected behavior Not to fail. ### Environment info - Python 3.10.6 - datasets: master branch - Numpy: 1.23.4
91
Sequence of array not supported for most dtype ### Describe the bug Create a dataset composed of sequence of array fails for most dtypes (see code below). ### Steps to reproduce the bug ```python from datasets import Sequence, Array2D, Features, Dataset import numpy as np for dtype in [ "bool", # ok "int8", # failed "int16", # failed "int32", # failed "int64", # ok "uint8", # failed "uint16", # failed "uint32", # failed "uint64", # failed "float16", # failed "float32", # failed "float64", # ok ]: features = Features({"foo": Sequence(Array2D(dtype=dtype, shape=(2, 2)))}) sequence = [ [[1.0, 2.0], [3.0, 4.0]], [[5.0, 6.0], [7.0, 8.0]], ] array = np.array(sequence, dtype=dtype) try: dataset = Dataset.from_dict({"foo": [array]}, features=features) except Exception as e: print(f"Failed for dtype={dtype}") ``` Traceback for `dtype="int8"`: ``` Traceback (most recent call last): File "/home/qgallouedec/datasets/a.py", line 29, in <module> raise e File "/home/qgallouedec/datasets/a.py", line 26, in <module> dataset = Dataset.from_dict({"foo": [array]}, features=features) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 899, in from_dict pa_table = InMemoryTable.from_pydict(mapping=mapping) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 799, in from_pydict return cls(pa.Table.from_pydict(*args, **kwargs)) File "pyarrow/table.pxi", line 3725, in pyarrow.lib.Table.from_pydict File "pyarrow/table.pxi", line 5254, in pyarrow.lib._from_pydict File "pyarrow/array.pxi", line 350, in pyarrow.lib.asarray File "pyarrow/array.pxi", line 236, in pyarrow.lib.array File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/arrow_writer.py", line 204, in __arrow_array__ out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 1833, in wrapper return func(array, *args, **kwargs) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 2091, in cast_array_to_feature casted_values = _c(array.values, feature.feature) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 1833, in wrapper return func(array, *args, **kwargs) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 2139, in cast_array_to_feature return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 1833, in wrapper return func(array, *args, **kwargs) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 1967, in array_cast return pa_type.wrap_array(array) File "pyarrow/types.pxi", line 879, in pyarrow.lib.BaseExtensionType.wrap_array TypeError: Incompatible storage type for extension<arrow.py_extension_type<Array2DExtensionType>>: expected list<item: list<item: int8>>, got list<item: list<item: int64>> ``` ### Expected behavior Not to fail. ### Environment info - Python 3.10.6 - datasets: master branch - Numpy: 1.23.4 Related, `float16` is the only dtype not supported by `Array2D` (probably by every `ArrayND`): ```python from datasets import Array2D, Features, Dataset import numpy as np for dtype in [ "bool", # ok "int8", # ok "int16", # ok "int32", # ok "int64", # ok "uint8", # ok "uint16", # ok "uint32", # ok "uint64", # ok "float16", # failed "float32", # ok "float64", # ok ]: features = Features({"foo": Array2D(dtype=dtype, shape=(3, 4))}) array = np.zeros((3, 4), dtype=dtype) try: dataset = Dataset.from_dict({"foo": [array]}, features=features) except Exception as e: print(f"Failed for dtype={dtype}") ```
[ 0.04710427671670914, -0.41798651218414307, -0.2184605449438095, 0.2592160701751709, 0.27266204357147217, 0.06292104721069336, 0.35634270310401917, 0.26765280961990356, 0.2174539715051651, 0.05035853013396263, 0.19395580887794495, 0.30664554238319397, -0.23231127858161926, 0.203426793217659, -0.06211439520120621, -0.25938716530799866, 0.08841173350811005, 0.3514937162399292, -0.1338149756193161, 0.0620170533657074, -0.24053283035755157, -0.02785823494195938, -0.31974658370018005, 0.07457169890403748, -0.007608272135257721, 0.05707757920026779, 0.10046562552452087, -0.024947602301836014, 0.15988101065158844, -0.6049400568008423, 0.28790491819381714, -0.14913997054100037, 0.01985003799200058, 0.32377371191978455, -0.00010375829879194498, 0.019799895584583282, 0.3419138193130493, -0.1654481291770935, -0.08550602197647095, 0.14313554763793945, -0.12202921509742737, -0.2844848930835724, -0.03115854784846306, -0.3491472005844116, -0.19866302609443665, -0.2680034637451172, -0.20317809283733368, -0.5941835045814514, 0.33203744888305664, 0.2959826588630676, 0.34590038657188416, 0.2585684657096863, 0.26511716842651367, -0.2574946880340576, -0.015479765832424164, 0.18089278042316437, -0.12845715880393982, -0.006078271195292473, 0.34087759256362915, 0.11314631253480911, 0.16457635164260864, 0.13059276342391968, -0.13442447781562805, 0.11708442866802216, 0.31282153725624084, -0.05320759862661362, 0.3940724730491638, -0.24373245239257812, -0.10693207383155823, 0.16523055732250214, 0.3610404431819916, -0.053576502948999405, -0.1820312887430191, -0.2012115716934204, -0.2625150680541992, -0.2644886076450348, 0.15473903715610504, -0.26640012860298157, -0.20313647389411926, 0.20632675290107727, -0.07874912023544312, 0.39071404933929443, -0.22993169724941254, 0.1462830752134323, -0.043597690761089325, -0.02776714786887169, -0.01704658940434456, 0.04167282208800316, -0.11923178285360336, -0.5155988931655884, 0.18481962382793427, 0.014176685363054276, -0.009563004598021507, -0.09388504922389984, -0.289448082447052, -0.298148512840271, 0.10611238330602646, -0.5606129765510559, 0.2093031108379364, -0.05674261972308159, 0.15051782131195068, 0.17144015431404114, 0.04243534058332443, -0.07798131555318832, -0.03595598414540291, 0.14009419083595276, -0.08024805784225464, -0.2375504970550537, 0.11568149924278259, 0.22041809558868408, 0.05570713430643082, 0.17004472017288208, 0.13613282144069672, -0.2609717547893524, 0.25791478157043457, 0.19762368500232697, 0.29167452454566956, -0.0447588749229908, -0.3332902789115906, 0.10341773182153702, -0.18412306904792786, 0.17126846313476562, 0.03926946595311165, 0.28857824206352234, 0.19740623235702515, 0.15423785150051117, -0.03151578828692436, 0.1328628957271576, 0.10700381547212601, 0.042585380375385284, -0.2270512878894806, -0.162907674908638, -0.05347172170877457, -0.15784353017807007, 0.11485825479030609, 0.2753201127052307, 0.1781696081161499, -0.027798663824796677, 0.035585612058639526, -0.016814708709716797, -0.2574976086616516, -0.1977866142988205, 0.3033008873462677, 0.10882025957107544, -0.22721627354621887, -0.0034094005823135376, 0.07954429090023041, 0.11029297113418579, -0.05558684468269348, 0.07367099076509476, -0.06050693243741989, 0.0572105348110199, -0.32464686036109924, 0.3343196511268616, 0.10519959777593613, 0.08715339004993439, -0.10123559832572937, 0.03780539706349373, 0.2654387056827545, -0.1729629635810852, 0.05767378956079483, -0.17297175526618958, -0.16085264086723328, -0.36072003841400146, 0.10302501916885376, 0.2557803690433502, -0.10988304018974304, 0.3903699219226837, 0.1606641262769699, 0.0050577204674482346, 0.12115397304296494, 0.16192254424095154, -0.03304271772503853, -0.061131078749895096, -0.35631421208381653, 0.0959397405385971, 0.19857928156852722, -0.20495283603668213, -0.15619999170303345, 0.1513037234544754, 0.03493652492761612, -0.023001402616500854, 0.20302177965641022, 0.1185576319694519, 0.16656939685344696, -0.2997044622898102, 0.08167615532875061, 0.34159353375434875, 0.009000848978757858, 0.06412949413061142, -0.16273073852062225, -0.1389712393283844, 0.24546518921852112, 0.0966491848230362, -0.15009817481040955, 0.015737589448690414, 0.040528394281864166, -0.04862816631793976, 0.1819625347852707, -0.18562006950378418, -0.0787767618894577, 0.22755642235279083, 0.3480304479598999, -0.1559889018535614, 0.10871687531471252, -0.46545928716659546, -0.464600145816803, 0.2781713008880615, -0.03746386244893074, -0.3635752201080322, -0.16886557638645172, -0.0019099339842796326, -0.3652994632720947, -0.009517628699541092, -0.27883991599082947, 0.050304532051086426, 0.3128887414932251, 0.08334710448980331, 0.1668882966041565, 0.04144155979156494, -0.09056355804204941, -0.02122511714696884, 0.048134565353393555, -0.004060573875904083, -0.2282927930355072, 0.4557192921638489, -0.14375847578048706, -0.2111036330461502, 0.10002267360687256, 0.3359679579734802, 0.1838645190000534, -0.1440412551164627, -0.03580944612622261, 0.25094541907310486, 0.28260016441345215, -0.2906848192214966, -0.4518148899078369, -0.047706395387649536, 0.27324816584587097, -0.4507535398006439, -0.0972486212849617, 0.5742958188056946, 0.188856303691864, -0.14073270559310913, -0.059764228761196136, 0.28920453786849976, -0.03786371275782585, 0.1993306577205658, -0.0008972734212875366, 0.03364727646112442, 0.4046114683151245, 0.028611719608306885, 0.13861842453479767, -0.23224925994873047, 0.1207592561841011, -0.0011012554168701172, 0.07943955063819885, -0.037144940346479416, -0.2717806100845337, 0.35424643754959106, 0.32882657647132874, 0.03686124086380005, 0.22080133855342865, 0.03592432662844658, 0.048468828201293945, 0.018324144184589386, 0.0769658163189888, -0.1406036615371704, 0.24067014455795288, 0.10700800269842148, -0.12144017219543457, -0.10592228919267654, -0.16016070544719696, -0.3054324984550476, 0.12510907649993896, -0.15667380392551422, 0.22503669559955597, 0.23815107345581055, 0.3602884113788605, 0.004021361470222473, -0.14141543209552765, -0.39233577251434326, -0.081551693379879, 0.17361927032470703, -0.1429280936717987, 0.11765758693218231, -0.4973874092102051, -0.5018401741981506, -0.09924481064081192, -0.08633212000131607, 0.28256115317344666, -0.15539923310279846, -0.16299423575401306, 0.217492938041687, -0.2246687263250351, 0.2257782220840454, 0.1468234658241272, 0.027090296149253845, 0.5003238320350647, 0.008556434884667397, -0.2942654490470886, 0.15477296710014343, -0.08583123236894608, 0.1691485345363617, 0.1557154357433319, 0.08371520042419434, 0.25762131810188293, 0.1011630967259407, -0.21796825528144836, -0.3053639233112335, -0.3083547353744507, -0.055289458483457565, -0.11944007873535156, 0.040335513651371, 0.2694128751754761, 0.2341795712709427, 0.17320874333381653, -0.13777723908424377, 0.04558319225907326, 0.06424296647310257, -0.33573588728904724, 0.268332839012146, 0.09328593313694, -0.16538754105567932, -0.29233235120773315, -0.2621246874332428, -0.17808176577091217, -0.4526141583919525, 0.20079058408737183, 0.07354754209518433, 0.23395368456840515, 0.1796092987060547, 0.009876713156700134, 0.19677285850048065, 0.034787606447935104, 0.07653295993804932, -0.1447373628616333, 0.5057507753372192, 0.24779395759105682, -0.10054092854261398, -0.30027875304222107, -0.1994580775499344, -0.2739052176475525, -0.08660313487052917, 0.09610313177108765, -0.2166610062122345, -0.3716024160385132, -0.3397773206233978, 0.05209624767303467, -0.13596689701080322, -0.2179347574710846, 0.21754573285579681, 0.12522688508033752, -0.2232798933982849, -0.17034924030303955, -0.04091263562440872, 0.2042907476425171, 0.0603698268532753, -0.14952214062213898, 0.21299725770950317, 0.5319018363952637, 0.07515937089920044, 0.03784720227122307, 0.3697431683540344, -0.29821979999542236, 0.48552796244621277, 0.0016982201486825943, 0.19503045082092285, -0.3597157895565033, -0.1810183823108673, -0.05190387740731239, 0.14004969596862793, -0.05965074896812439, 0.025356475263834, -0.4153689742088318, -0.2356918603181839, 0.033297620713710785, 0.2624474763870239, -0.020303919911384583, -0.05474352091550827, -0.10533291846513748, -0.12212613224983215, 0.16880981624126434, -0.08518464118242264, 0.2590228319168091, 0.011509742587804794, -0.09580817073583603, -0.128830686211586, -0.02515300363302231, 0.22461538016796112, -0.045432381331920624, -0.4586372375488281, -0.2168119102716446, -0.16607853770256042, 0.24556508660316467, 0.19789814949035645, 0.7688114643096924, -0.2240338921546936, -0.013212800025939941, -0.17097757756710052, 0.07603738456964493, 0.3257191479206085, -0.18024227023124695, 0.18379922211170197, 0.21192461252212524, -0.0772370770573616, -0.31308966875076294, -0.09174535423517227, -0.14255663752555847, 0.10913366824388504, -0.07304134964942932, 0.5789585113525391, -0.22845083475112915, 0.011298388242721558, 0.15475638210773468, 0.2960861921310425, 0.04468017816543579, -0.08312615752220154, -0.08521795272827148, -0.3290397822856903, -0.20372028648853302, 0.014617636799812317, 0.365485280752182, 0.31403428316116333, -0.03383829444646835, -0.4097106456756592, -0.3987470269203186, -0.44826751947402954, -0.06247645244002342, 0.0694672018289566, 0.35562992095947266, -0.0015889368951320648, 0.2623184025287628, -0.28405967354774475, 0.16388610005378723, 0.25414884090423584, 0.050341684371232986, 0.10778949409723282, -0.17674000561237335, 0.09507396072149277, -0.29303714632987976, 0.010163791477680206, 0.366301953792572, -0.20652064681053162, 0.18023309111595154, -0.3409329354763031, 0.04447852447628975, -0.09500308334827423, -0.18549475073814392, 0.2284492552280426, -0.09928856790065765, -0.29584354162216187, -0.14041298627853394, 0.24489448964595795, -0.08738987147808075, 0.03569374978542328, 0.06649395823478699, -0.11186521500349045, -0.4245508313179016, 0.5086957812309265, 0.2095409333705902, 0.6204473972320557, 0.2869952321052551, 0.0985465794801712, 0.5469993948936462, 0.11500053852796555, 0.27039262652397156, 0.3894447982311249, 0.05704374611377716, -0.381236732006073, -0.4136083424091339, -0.15051798522472382, -0.3260973393917084, -0.0201936773955822, 0.08195540308952332, -0.3083687722682953, 0.4172401428222656, -0.20332053303718567, 0.26250582933425903, 0.12664680182933807, -0.21755892038345337, 0.10480561852455139, -0.1023629680275917, -0.3038029372692108, 0.2093794047832489, -0.003427928313612938, -0.21259605884552002, -0.05935891717672348, -0.4488982856273651, -0.005653165280818939, -0.05738507956266403, -0.3051314353942871, -0.033844996243715286, -0.33612632751464844, 0.25724294781684875, 0.054225098341703415, -0.24795350432395935, 0.01624133437871933, 0.12021012604236603, 0.37531211972236633, 0.05814165249466896, -0.147359699010849, -0.20985205471515656, 0.16917365789413452, 0.05446768179535866, -0.1907888650894165, -0.11951997876167297, 0.3211011588573456, -0.03728719800710678, 0.16980400681495667, 0.13366496562957764, -0.045653823763132095, -0.22519341111183167, -0.15071186423301697, 0.18058064579963684, -0.2443748414516449, -0.0727166011929512, -0.39549046754837036, -0.1498870700597763, -0.32004088163375854, -0.3091915249824524, 0.2311902642250061, -0.032522860914468765, -0.03150252625346184, 0.27918002009391785, -0.07089842855930328, -0.10316235572099686, -0.09029059112071991, 0.09799664467573166, 0.21432487666606903, 0.020349405705928802, 0.2554803192615509, 0.11535441875457764, -0.278110146522522, -0.3388011157512665, 0.20081013441085815, 0.06216404214501381, -0.23235437273979187, 0.29618769884109497, -0.29510363936424255, -0.074785016477108, -0.016375591978430748, 0.22146332263946533, 0.06665585190057755, 0.0991586446762085, -0.05986175686120987, -0.3167397677898407, -0.18271395564079285, 0.21827024221420288, -0.07887209951877594, 0.21400709450244904, -0.2791229486465454, 0.2020365595817566, -0.3283761739730835, -0.16108807921409607, -0.4142492413520813, 0.05775664001703262, -0.2673041820526123, -0.005165895447134972, -0.11860692501068115, -0.1350436806678772, -0.07492052018642426, 0.002568155527114868, 0.26873481273651123, 0.3639909029006958, -0.2958710491657257, -0.3228549659252167, 0.09384441375732422, 0.09074857085943222, 0.028117869049310684, -0.2041592001914978, -0.15772287547588348, -0.31680989265441895, -0.3111025094985962, -0.029938001185655594, -0.09084043651819229, -0.016918711364269257, 0.09050218015909195, 0.017320245504379272, 0.3415352404117584, 0.18863248825073242, 0.11462096869945526, 0.16494914889335632, -0.20540887117385864, 0.013604819774627686, -0.11632940173149109, -0.02346792444586754, -0.14315013587474823, -0.07015462219715118, -0.2507389187812805, 0.126840740442276, -0.17350232601165771, -0.13996021449565887, 0.4517121911048889, -0.2247321754693985, -0.3162948787212372, 0.27631938457489014, 0.3224531412124634, 0.25341883301734924, -0.33612626791000366, -0.14395347237586975, 0.04570407047867775, 0.35777801275253296, -0.26223018765449524, -0.03206968680024147, 0.032218072563409805, 0.25675687193870544, 0.24565066397190094, 0.3134855031967163, 0.24924182891845703, -0.2100391387939453, 0.19965580105781555, 0.21192142367362976, 0.22850127518177032, -0.2187928855419159, -0.049037866294384, 0.38189733028411865, 0.13143059611320496, -0.0773104876279831, 0.10097882896661758, 0.08210790157318115, 0.5738421678543091, 0.661223828792572, 0.06158089637756348, 0.3648393452167511, 0.2957206964492798, -0.18129116296768188, 0.09370166063308716, -0.0012826696038246155, -0.1307034194469452, 0.2839376926422119, -0.03740757331252098, 0.1265764832496643, 0.2662622332572937, 0.15311376750469208, -0.38176506757736206, -0.27688756585121155, -0.2246411144733429, -0.0958121120929718, -0.20689457654953003, 0.11691709607839584, 0.19301125407218933, -0.004852548241615295, -0.24499934911727905, -0.37791183590888977, -0.21604463458061218, 0.10311165452003479, 0.18366417288780212, 0.058341048657894135, 0.055482037365436554, -0.3151479661464691, 0.23301579058170319, 0.24657291173934937, 0.15188734233379364, -0.05076794698834419, 0.35070863366127014, 0.4531874358654022, -0.030349235981702805, 0.05250595510005951, 0.29838666319847107, 0.2718059718608856, 0.25199607014656067, -0.21164962649345398, -0.07964523136615753, -0.2551901936531067, -0.2305421531200409, -0.10674770921468735, 0.28151699900627136, 0.009318837895989418, 0.002818675711750984, 0.36950111389160156, 0.21507731080055237, -0.17255552113056183, 0.1506788432598114, 0.2342243790626526, -0.1370527744293213, -0.29929471015930176, 0.4590909481048584, -0.3323836028575897, 0.05405630171298981, 0.2212623655796051, -0.018206730484962463, -0.4808654189109802, -0.06835315376520157, 0.1906050443649292, 0.07689499855041504, 0.28995952010154724, 0.3105180859565735, 0.13970163464546204, -0.26347288489341736, 0.3097778558731079, -0.004798496142029762, 0.22330136597156525, -0.055902428925037384, -0.09542520344257355, -0.4618712067604065, 0.20735111832618713, 0.14966779947280884, -0.030584018677473068, 0.30138877034187317, 0.1292780041694641, 0.09016606211662292, 0.0345672145485878, 0.0030015483498573303, 0.013099931180477142, 0.08230169117450714, 0.30687958002090454, -0.49578243494033813, -0.16133229434490204, 0.05870259553194046, -0.09419640898704529, -0.08207183331251144, -0.40551602840423584, 0.38083416223526, -0.16678142547607422, 0.2722536027431488, -0.20074953138828278, 0.08001789450645447, -0.05929005146026611, 0.3546414375305176, 0.2655177116394043, 0.24441023170948029, 0.15772542357444763, -0.0272560715675354, -0.09036313742399216, -0.09626127779483795, -0.31052321195602417, -0.022569838911294937, 0.32206428050994873, 0.2720547914505005, 0.36253809928894043, -0.13911093771457672, 0.026517728343605995, 0.02864980697631836, 0.3302376866340637, 0.04790861904621124, 0.05501407012343407, -0.39969402551651, 0.4148034155368805, -0.26342540979385376, 0.18720227479934692, 0.07682102918624878, 0.05342434346675873, 0.02976517379283905, 0.2536046504974365, -0.10441872477531433, -0.6678894758224487, 0.49736288189888, 0.13971106708049774, -0.3629642128944397, 0.011703170835971832, 0.12347820401191711, 0.2633361220359802, 0.19111400842666626, -0.22962766885757446, -0.1261516809463501, 0.36815202236175537, -0.06593610346317291, -0.1757286936044693, 0.2900436520576477, -0.0523756742477417, 0.005468092858791351, -0.1569465696811676, 0.4868296682834625, 0.07038362324237823, -0.18574441969394684, 0.05399540811777115, -0.21753078699111938 ]
https://github.com/huggingface/datasets/issues/5936
Here's something I can't explain: When an array is encoded in the `from_dict` method, the numpy array is converted to a list (thus losing the original dtype, which is transfromed to the nearest builtin Python type) https://github.com/huggingface/datasets/blob/6ee61e6e695b1df9f232d47faf3a5e2b30b33737/src/datasets/features/features.py#L524-L525 However, later on, this same data is written to memory, and it seems authorized that the data is an array (or in this case, a list of arrays). https://github.com/huggingface/datasets/blob/6ee61e6e695b1df9f232d47faf3a5e2b30b33737/src/datasets/arrow_writer.py#L185-L186 So the question is: why convert it to a Python list? This seems to be quite expensive both in terms of write time (all data is copied) and memory (e.g., an int8 is converted to an int64). Finally, if I try to remove this step, it solves all the previous problems, and it seems to me that it doesn't break anything (the CI passes without problem).
Sequence of array not supported for most dtype
### Describe the bug Create a dataset composed of sequence of array fails for most dtypes (see code below). ### Steps to reproduce the bug ```python from datasets import Sequence, Array2D, Features, Dataset import numpy as np for dtype in [ "bool", # ok "int8", # failed "int16", # failed "int32", # failed "int64", # ok "uint8", # failed "uint16", # failed "uint32", # failed "uint64", # failed "float16", # failed "float32", # failed "float64", # ok ]: features = Features({"foo": Sequence(Array2D(dtype=dtype, shape=(2, 2)))}) sequence = [ [[1.0, 2.0], [3.0, 4.0]], [[5.0, 6.0], [7.0, 8.0]], ] array = np.array(sequence, dtype=dtype) try: dataset = Dataset.from_dict({"foo": [array]}, features=features) except Exception as e: print(f"Failed for dtype={dtype}") ``` Traceback for `dtype="int8"`: ``` Traceback (most recent call last): File "/home/qgallouedec/datasets/a.py", line 29, in <module> raise e File "/home/qgallouedec/datasets/a.py", line 26, in <module> dataset = Dataset.from_dict({"foo": [array]}, features=features) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 899, in from_dict pa_table = InMemoryTable.from_pydict(mapping=mapping) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 799, in from_pydict return cls(pa.Table.from_pydict(*args, **kwargs)) File "pyarrow/table.pxi", line 3725, in pyarrow.lib.Table.from_pydict File "pyarrow/table.pxi", line 5254, in pyarrow.lib._from_pydict File "pyarrow/array.pxi", line 350, in pyarrow.lib.asarray File "pyarrow/array.pxi", line 236, in pyarrow.lib.array File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/arrow_writer.py", line 204, in __arrow_array__ out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 1833, in wrapper return func(array, *args, **kwargs) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 2091, in cast_array_to_feature casted_values = _c(array.values, feature.feature) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 1833, in wrapper return func(array, *args, **kwargs) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 2139, in cast_array_to_feature return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 1833, in wrapper return func(array, *args, **kwargs) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 1967, in array_cast return pa_type.wrap_array(array) File "pyarrow/types.pxi", line 879, in pyarrow.lib.BaseExtensionType.wrap_array TypeError: Incompatible storage type for extension<arrow.py_extension_type<Array2DExtensionType>>: expected list<item: list<item: int8>>, got list<item: list<item: int64>> ``` ### Expected behavior Not to fail. ### Environment info - Python 3.10.6 - datasets: master branch - Numpy: 1.23.4
132
Sequence of array not supported for most dtype ### Describe the bug Create a dataset composed of sequence of array fails for most dtypes (see code below). ### Steps to reproduce the bug ```python from datasets import Sequence, Array2D, Features, Dataset import numpy as np for dtype in [ "bool", # ok "int8", # failed "int16", # failed "int32", # failed "int64", # ok "uint8", # failed "uint16", # failed "uint32", # failed "uint64", # failed "float16", # failed "float32", # failed "float64", # ok ]: features = Features({"foo": Sequence(Array2D(dtype=dtype, shape=(2, 2)))}) sequence = [ [[1.0, 2.0], [3.0, 4.0]], [[5.0, 6.0], [7.0, 8.0]], ] array = np.array(sequence, dtype=dtype) try: dataset = Dataset.from_dict({"foo": [array]}, features=features) except Exception as e: print(f"Failed for dtype={dtype}") ``` Traceback for `dtype="int8"`: ``` Traceback (most recent call last): File "/home/qgallouedec/datasets/a.py", line 29, in <module> raise e File "/home/qgallouedec/datasets/a.py", line 26, in <module> dataset = Dataset.from_dict({"foo": [array]}, features=features) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 899, in from_dict pa_table = InMemoryTable.from_pydict(mapping=mapping) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 799, in from_pydict return cls(pa.Table.from_pydict(*args, **kwargs)) File "pyarrow/table.pxi", line 3725, in pyarrow.lib.Table.from_pydict File "pyarrow/table.pxi", line 5254, in pyarrow.lib._from_pydict File "pyarrow/array.pxi", line 350, in pyarrow.lib.asarray File "pyarrow/array.pxi", line 236, in pyarrow.lib.array File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/arrow_writer.py", line 204, in __arrow_array__ out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 1833, in wrapper return func(array, *args, **kwargs) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 2091, in cast_array_to_feature casted_values = _c(array.values, feature.feature) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 1833, in wrapper return func(array, *args, **kwargs) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 2139, in cast_array_to_feature return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 1833, in wrapper return func(array, *args, **kwargs) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 1967, in array_cast return pa_type.wrap_array(array) File "pyarrow/types.pxi", line 879, in pyarrow.lib.BaseExtensionType.wrap_array TypeError: Incompatible storage type for extension<arrow.py_extension_type<Array2DExtensionType>>: expected list<item: list<item: int8>>, got list<item: list<item: int64>> ``` ### Expected behavior Not to fail. ### Environment info - Python 3.10.6 - datasets: master branch - Numpy: 1.23.4 Here's something I can't explain: When an array is encoded in the `from_dict` method, the numpy array is converted to a list (thus losing the original dtype, which is transfromed to the nearest builtin Python type) https://github.com/huggingface/datasets/blob/6ee61e6e695b1df9f232d47faf3a5e2b30b33737/src/datasets/features/features.py#L524-L525 However, later on, this same data is written to memory, and it seems authorized that the data is an array (or in this case, a list of arrays). https://github.com/huggingface/datasets/blob/6ee61e6e695b1df9f232d47faf3a5e2b30b33737/src/datasets/arrow_writer.py#L185-L186 So the question is: why convert it to a Python list? This seems to be quite expensive both in terms of write time (all data is copied) and memory (e.g., an int8 is converted to an int64). Finally, if I try to remove this step, it solves all the previous problems, and it seems to me that it doesn't break anything (the CI passes without problem).
[ 0.04710427671670914, -0.41798651218414307, -0.2184605449438095, 0.2592160701751709, 0.27266204357147217, 0.06292104721069336, 0.35634270310401917, 0.26765280961990356, 0.2174539715051651, 0.05035853013396263, 0.19395580887794495, 0.30664554238319397, -0.23231127858161926, 0.203426793217659, -0.06211439520120621, -0.25938716530799866, 0.08841173350811005, 0.3514937162399292, -0.1338149756193161, 0.0620170533657074, -0.24053283035755157, -0.02785823494195938, -0.31974658370018005, 0.07457169890403748, -0.007608272135257721, 0.05707757920026779, 0.10046562552452087, -0.024947602301836014, 0.15988101065158844, -0.6049400568008423, 0.28790491819381714, -0.14913997054100037, 0.01985003799200058, 0.32377371191978455, -0.00010375829879194498, 0.019799895584583282, 0.3419138193130493, -0.1654481291770935, -0.08550602197647095, 0.14313554763793945, -0.12202921509742737, -0.2844848930835724, -0.03115854784846306, -0.3491472005844116, -0.19866302609443665, -0.2680034637451172, -0.20317809283733368, -0.5941835045814514, 0.33203744888305664, 0.2959826588630676, 0.34590038657188416, 0.2585684657096863, 0.26511716842651367, -0.2574946880340576, -0.015479765832424164, 0.18089278042316437, -0.12845715880393982, -0.006078271195292473, 0.34087759256362915, 0.11314631253480911, 0.16457635164260864, 0.13059276342391968, -0.13442447781562805, 0.11708442866802216, 0.31282153725624084, -0.05320759862661362, 0.3940724730491638, -0.24373245239257812, -0.10693207383155823, 0.16523055732250214, 0.3610404431819916, -0.053576502948999405, -0.1820312887430191, -0.2012115716934204, -0.2625150680541992, -0.2644886076450348, 0.15473903715610504, -0.26640012860298157, -0.20313647389411926, 0.20632675290107727, -0.07874912023544312, 0.39071404933929443, -0.22993169724941254, 0.1462830752134323, -0.043597690761089325, -0.02776714786887169, -0.01704658940434456, 0.04167282208800316, -0.11923178285360336, -0.5155988931655884, 0.18481962382793427, 0.014176685363054276, -0.009563004598021507, -0.09388504922389984, -0.289448082447052, -0.298148512840271, 0.10611238330602646, -0.5606129765510559, 0.2093031108379364, -0.05674261972308159, 0.15051782131195068, 0.17144015431404114, 0.04243534058332443, -0.07798131555318832, -0.03595598414540291, 0.14009419083595276, -0.08024805784225464, -0.2375504970550537, 0.11568149924278259, 0.22041809558868408, 0.05570713430643082, 0.17004472017288208, 0.13613282144069672, -0.2609717547893524, 0.25791478157043457, 0.19762368500232697, 0.29167452454566956, -0.0447588749229908, -0.3332902789115906, 0.10341773182153702, -0.18412306904792786, 0.17126846313476562, 0.03926946595311165, 0.28857824206352234, 0.19740623235702515, 0.15423785150051117, -0.03151578828692436, 0.1328628957271576, 0.10700381547212601, 0.042585380375385284, -0.2270512878894806, -0.162907674908638, -0.05347172170877457, -0.15784353017807007, 0.11485825479030609, 0.2753201127052307, 0.1781696081161499, -0.027798663824796677, 0.035585612058639526, -0.016814708709716797, -0.2574976086616516, -0.1977866142988205, 0.3033008873462677, 0.10882025957107544, -0.22721627354621887, -0.0034094005823135376, 0.07954429090023041, 0.11029297113418579, -0.05558684468269348, 0.07367099076509476, -0.06050693243741989, 0.0572105348110199, -0.32464686036109924, 0.3343196511268616, 0.10519959777593613, 0.08715339004993439, -0.10123559832572937, 0.03780539706349373, 0.2654387056827545, -0.1729629635810852, 0.05767378956079483, -0.17297175526618958, -0.16085264086723328, -0.36072003841400146, 0.10302501916885376, 0.2557803690433502, -0.10988304018974304, 0.3903699219226837, 0.1606641262769699, 0.0050577204674482346, 0.12115397304296494, 0.16192254424095154, -0.03304271772503853, -0.061131078749895096, -0.35631421208381653, 0.0959397405385971, 0.19857928156852722, -0.20495283603668213, -0.15619999170303345, 0.1513037234544754, 0.03493652492761612, -0.023001402616500854, 0.20302177965641022, 0.1185576319694519, 0.16656939685344696, -0.2997044622898102, 0.08167615532875061, 0.34159353375434875, 0.009000848978757858, 0.06412949413061142, -0.16273073852062225, -0.1389712393283844, 0.24546518921852112, 0.0966491848230362, -0.15009817481040955, 0.015737589448690414, 0.040528394281864166, -0.04862816631793976, 0.1819625347852707, -0.18562006950378418, -0.0787767618894577, 0.22755642235279083, 0.3480304479598999, -0.1559889018535614, 0.10871687531471252, -0.46545928716659546, -0.464600145816803, 0.2781713008880615, -0.03746386244893074, -0.3635752201080322, -0.16886557638645172, -0.0019099339842796326, -0.3652994632720947, -0.009517628699541092, -0.27883991599082947, 0.050304532051086426, 0.3128887414932251, 0.08334710448980331, 0.1668882966041565, 0.04144155979156494, -0.09056355804204941, -0.02122511714696884, 0.048134565353393555, -0.004060573875904083, -0.2282927930355072, 0.4557192921638489, -0.14375847578048706, -0.2111036330461502, 0.10002267360687256, 0.3359679579734802, 0.1838645190000534, -0.1440412551164627, -0.03580944612622261, 0.25094541907310486, 0.28260016441345215, -0.2906848192214966, -0.4518148899078369, -0.047706395387649536, 0.27324816584587097, -0.4507535398006439, -0.0972486212849617, 0.5742958188056946, 0.188856303691864, -0.14073270559310913, -0.059764228761196136, 0.28920453786849976, -0.03786371275782585, 0.1993306577205658, -0.0008972734212875366, 0.03364727646112442, 0.4046114683151245, 0.028611719608306885, 0.13861842453479767, -0.23224925994873047, 0.1207592561841011, -0.0011012554168701172, 0.07943955063819885, -0.037144940346479416, -0.2717806100845337, 0.35424643754959106, 0.32882657647132874, 0.03686124086380005, 0.22080133855342865, 0.03592432662844658, 0.048468828201293945, 0.018324144184589386, 0.0769658163189888, -0.1406036615371704, 0.24067014455795288, 0.10700800269842148, -0.12144017219543457, -0.10592228919267654, -0.16016070544719696, -0.3054324984550476, 0.12510907649993896, -0.15667380392551422, 0.22503669559955597, 0.23815107345581055, 0.3602884113788605, 0.004021361470222473, -0.14141543209552765, -0.39233577251434326, -0.081551693379879, 0.17361927032470703, -0.1429280936717987, 0.11765758693218231, -0.4973874092102051, -0.5018401741981506, -0.09924481064081192, -0.08633212000131607, 0.28256115317344666, -0.15539923310279846, -0.16299423575401306, 0.217492938041687, -0.2246687263250351, 0.2257782220840454, 0.1468234658241272, 0.027090296149253845, 0.5003238320350647, 0.008556434884667397, -0.2942654490470886, 0.15477296710014343, -0.08583123236894608, 0.1691485345363617, 0.1557154357433319, 0.08371520042419434, 0.25762131810188293, 0.1011630967259407, -0.21796825528144836, -0.3053639233112335, -0.3083547353744507, -0.055289458483457565, -0.11944007873535156, 0.040335513651371, 0.2694128751754761, 0.2341795712709427, 0.17320874333381653, -0.13777723908424377, 0.04558319225907326, 0.06424296647310257, -0.33573588728904724, 0.268332839012146, 0.09328593313694, -0.16538754105567932, -0.29233235120773315, -0.2621246874332428, -0.17808176577091217, -0.4526141583919525, 0.20079058408737183, 0.07354754209518433, 0.23395368456840515, 0.1796092987060547, 0.009876713156700134, 0.19677285850048065, 0.034787606447935104, 0.07653295993804932, -0.1447373628616333, 0.5057507753372192, 0.24779395759105682, -0.10054092854261398, -0.30027875304222107, -0.1994580775499344, -0.2739052176475525, -0.08660313487052917, 0.09610313177108765, -0.2166610062122345, -0.3716024160385132, -0.3397773206233978, 0.05209624767303467, -0.13596689701080322, -0.2179347574710846, 0.21754573285579681, 0.12522688508033752, -0.2232798933982849, -0.17034924030303955, -0.04091263562440872, 0.2042907476425171, 0.0603698268532753, -0.14952214062213898, 0.21299725770950317, 0.5319018363952637, 0.07515937089920044, 0.03784720227122307, 0.3697431683540344, -0.29821979999542236, 0.48552796244621277, 0.0016982201486825943, 0.19503045082092285, -0.3597157895565033, -0.1810183823108673, -0.05190387740731239, 0.14004969596862793, -0.05965074896812439, 0.025356475263834, -0.4153689742088318, -0.2356918603181839, 0.033297620713710785, 0.2624474763870239, -0.020303919911384583, -0.05474352091550827, -0.10533291846513748, -0.12212613224983215, 0.16880981624126434, -0.08518464118242264, 0.2590228319168091, 0.011509742587804794, -0.09580817073583603, -0.128830686211586, -0.02515300363302231, 0.22461538016796112, -0.045432381331920624, -0.4586372375488281, -0.2168119102716446, -0.16607853770256042, 0.24556508660316467, 0.19789814949035645, 0.7688114643096924, -0.2240338921546936, -0.013212800025939941, -0.17097757756710052, 0.07603738456964493, 0.3257191479206085, -0.18024227023124695, 0.18379922211170197, 0.21192461252212524, -0.0772370770573616, -0.31308966875076294, -0.09174535423517227, -0.14255663752555847, 0.10913366824388504, -0.07304134964942932, 0.5789585113525391, -0.22845083475112915, 0.011298388242721558, 0.15475638210773468, 0.2960861921310425, 0.04468017816543579, -0.08312615752220154, -0.08521795272827148, -0.3290397822856903, -0.20372028648853302, 0.014617636799812317, 0.365485280752182, 0.31403428316116333, -0.03383829444646835, -0.4097106456756592, -0.3987470269203186, -0.44826751947402954, -0.06247645244002342, 0.0694672018289566, 0.35562992095947266, -0.0015889368951320648, 0.2623184025287628, -0.28405967354774475, 0.16388610005378723, 0.25414884090423584, 0.050341684371232986, 0.10778949409723282, -0.17674000561237335, 0.09507396072149277, -0.29303714632987976, 0.010163791477680206, 0.366301953792572, -0.20652064681053162, 0.18023309111595154, -0.3409329354763031, 0.04447852447628975, -0.09500308334827423, -0.18549475073814392, 0.2284492552280426, -0.09928856790065765, -0.29584354162216187, -0.14041298627853394, 0.24489448964595795, -0.08738987147808075, 0.03569374978542328, 0.06649395823478699, -0.11186521500349045, -0.4245508313179016, 0.5086957812309265, 0.2095409333705902, 0.6204473972320557, 0.2869952321052551, 0.0985465794801712, 0.5469993948936462, 0.11500053852796555, 0.27039262652397156, 0.3894447982311249, 0.05704374611377716, -0.381236732006073, -0.4136083424091339, -0.15051798522472382, -0.3260973393917084, -0.0201936773955822, 0.08195540308952332, -0.3083687722682953, 0.4172401428222656, -0.20332053303718567, 0.26250582933425903, 0.12664680182933807, -0.21755892038345337, 0.10480561852455139, -0.1023629680275917, -0.3038029372692108, 0.2093794047832489, -0.003427928313612938, -0.21259605884552002, -0.05935891717672348, -0.4488982856273651, -0.005653165280818939, -0.05738507956266403, -0.3051314353942871, -0.033844996243715286, -0.33612632751464844, 0.25724294781684875, 0.054225098341703415, -0.24795350432395935, 0.01624133437871933, 0.12021012604236603, 0.37531211972236633, 0.05814165249466896, -0.147359699010849, -0.20985205471515656, 0.16917365789413452, 0.05446768179535866, -0.1907888650894165, -0.11951997876167297, 0.3211011588573456, -0.03728719800710678, 0.16980400681495667, 0.13366496562957764, -0.045653823763132095, -0.22519341111183167, -0.15071186423301697, 0.18058064579963684, -0.2443748414516449, -0.0727166011929512, -0.39549046754837036, -0.1498870700597763, -0.32004088163375854, -0.3091915249824524, 0.2311902642250061, -0.032522860914468765, -0.03150252625346184, 0.27918002009391785, -0.07089842855930328, -0.10316235572099686, -0.09029059112071991, 0.09799664467573166, 0.21432487666606903, 0.020349405705928802, 0.2554803192615509, 0.11535441875457764, -0.278110146522522, -0.3388011157512665, 0.20081013441085815, 0.06216404214501381, -0.23235437273979187, 0.29618769884109497, -0.29510363936424255, -0.074785016477108, -0.016375591978430748, 0.22146332263946533, 0.06665585190057755, 0.0991586446762085, -0.05986175686120987, -0.3167397677898407, -0.18271395564079285, 0.21827024221420288, -0.07887209951877594, 0.21400709450244904, -0.2791229486465454, 0.2020365595817566, -0.3283761739730835, -0.16108807921409607, -0.4142492413520813, 0.05775664001703262, -0.2673041820526123, -0.005165895447134972, -0.11860692501068115, -0.1350436806678772, -0.07492052018642426, 0.002568155527114868, 0.26873481273651123, 0.3639909029006958, -0.2958710491657257, -0.3228549659252167, 0.09384441375732422, 0.09074857085943222, 0.028117869049310684, -0.2041592001914978, -0.15772287547588348, -0.31680989265441895, -0.3111025094985962, -0.029938001185655594, -0.09084043651819229, -0.016918711364269257, 0.09050218015909195, 0.017320245504379272, 0.3415352404117584, 0.18863248825073242, 0.11462096869945526, 0.16494914889335632, -0.20540887117385864, 0.013604819774627686, -0.11632940173149109, -0.02346792444586754, -0.14315013587474823, -0.07015462219715118, -0.2507389187812805, 0.126840740442276, -0.17350232601165771, -0.13996021449565887, 0.4517121911048889, -0.2247321754693985, -0.3162948787212372, 0.27631938457489014, 0.3224531412124634, 0.25341883301734924, -0.33612626791000366, -0.14395347237586975, 0.04570407047867775, 0.35777801275253296, -0.26223018765449524, -0.03206968680024147, 0.032218072563409805, 0.25675687193870544, 0.24565066397190094, 0.3134855031967163, 0.24924182891845703, -0.2100391387939453, 0.19965580105781555, 0.21192142367362976, 0.22850127518177032, -0.2187928855419159, -0.049037866294384, 0.38189733028411865, 0.13143059611320496, -0.0773104876279831, 0.10097882896661758, 0.08210790157318115, 0.5738421678543091, 0.661223828792572, 0.06158089637756348, 0.3648393452167511, 0.2957206964492798, -0.18129116296768188, 0.09370166063308716, -0.0012826696038246155, -0.1307034194469452, 0.2839376926422119, -0.03740757331252098, 0.1265764832496643, 0.2662622332572937, 0.15311376750469208, -0.38176506757736206, -0.27688756585121155, -0.2246411144733429, -0.0958121120929718, -0.20689457654953003, 0.11691709607839584, 0.19301125407218933, -0.004852548241615295, -0.24499934911727905, -0.37791183590888977, -0.21604463458061218, 0.10311165452003479, 0.18366417288780212, 0.058341048657894135, 0.055482037365436554, -0.3151479661464691, 0.23301579058170319, 0.24657291173934937, 0.15188734233379364, -0.05076794698834419, 0.35070863366127014, 0.4531874358654022, -0.030349235981702805, 0.05250595510005951, 0.29838666319847107, 0.2718059718608856, 0.25199607014656067, -0.21164962649345398, -0.07964523136615753, -0.2551901936531067, -0.2305421531200409, -0.10674770921468735, 0.28151699900627136, 0.009318837895989418, 0.002818675711750984, 0.36950111389160156, 0.21507731080055237, -0.17255552113056183, 0.1506788432598114, 0.2342243790626526, -0.1370527744293213, -0.29929471015930176, 0.4590909481048584, -0.3323836028575897, 0.05405630171298981, 0.2212623655796051, -0.018206730484962463, -0.4808654189109802, -0.06835315376520157, 0.1906050443649292, 0.07689499855041504, 0.28995952010154724, 0.3105180859565735, 0.13970163464546204, -0.26347288489341736, 0.3097778558731079, -0.004798496142029762, 0.22330136597156525, -0.055902428925037384, -0.09542520344257355, -0.4618712067604065, 0.20735111832618713, 0.14966779947280884, -0.030584018677473068, 0.30138877034187317, 0.1292780041694641, 0.09016606211662292, 0.0345672145485878, 0.0030015483498573303, 0.013099931180477142, 0.08230169117450714, 0.30687958002090454, -0.49578243494033813, -0.16133229434490204, 0.05870259553194046, -0.09419640898704529, -0.08207183331251144, -0.40551602840423584, 0.38083416223526, -0.16678142547607422, 0.2722536027431488, -0.20074953138828278, 0.08001789450645447, -0.05929005146026611, 0.3546414375305176, 0.2655177116394043, 0.24441023170948029, 0.15772542357444763, -0.0272560715675354, -0.09036313742399216, -0.09626127779483795, -0.31052321195602417, -0.022569838911294937, 0.32206428050994873, 0.2720547914505005, 0.36253809928894043, -0.13911093771457672, 0.026517728343605995, 0.02864980697631836, 0.3302376866340637, 0.04790861904621124, 0.05501407012343407, -0.39969402551651, 0.4148034155368805, -0.26342540979385376, 0.18720227479934692, 0.07682102918624878, 0.05342434346675873, 0.02976517379283905, 0.2536046504974365, -0.10441872477531433, -0.6678894758224487, 0.49736288189888, 0.13971106708049774, -0.3629642128944397, 0.011703170835971832, 0.12347820401191711, 0.2633361220359802, 0.19111400842666626, -0.22962766885757446, -0.1261516809463501, 0.36815202236175537, -0.06593610346317291, -0.1757286936044693, 0.2900436520576477, -0.0523756742477417, 0.005468092858791351, -0.1569465696811676, 0.4868296682834625, 0.07038362324237823, -0.18574441969394684, 0.05399540811777115, -0.21753078699111938 ]
https://github.com/huggingface/datasets/issues/5936
Arrow only support 1d numpy arrays, so we convert multidim arrays to lists of 1s arrays (and keep the dtype). Though you noticed that it's concerting to lists and lose the dtype. If it's the case then it's a bug.
Sequence of array not supported for most dtype
### Describe the bug Create a dataset composed of sequence of array fails for most dtypes (see code below). ### Steps to reproduce the bug ```python from datasets import Sequence, Array2D, Features, Dataset import numpy as np for dtype in [ "bool", # ok "int8", # failed "int16", # failed "int32", # failed "int64", # ok "uint8", # failed "uint16", # failed "uint32", # failed "uint64", # failed "float16", # failed "float32", # failed "float64", # ok ]: features = Features({"foo": Sequence(Array2D(dtype=dtype, shape=(2, 2)))}) sequence = [ [[1.0, 2.0], [3.0, 4.0]], [[5.0, 6.0], [7.0, 8.0]], ] array = np.array(sequence, dtype=dtype) try: dataset = Dataset.from_dict({"foo": [array]}, features=features) except Exception as e: print(f"Failed for dtype={dtype}") ``` Traceback for `dtype="int8"`: ``` Traceback (most recent call last): File "/home/qgallouedec/datasets/a.py", line 29, in <module> raise e File "/home/qgallouedec/datasets/a.py", line 26, in <module> dataset = Dataset.from_dict({"foo": [array]}, features=features) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 899, in from_dict pa_table = InMemoryTable.from_pydict(mapping=mapping) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 799, in from_pydict return cls(pa.Table.from_pydict(*args, **kwargs)) File "pyarrow/table.pxi", line 3725, in pyarrow.lib.Table.from_pydict File "pyarrow/table.pxi", line 5254, in pyarrow.lib._from_pydict File "pyarrow/array.pxi", line 350, in pyarrow.lib.asarray File "pyarrow/array.pxi", line 236, in pyarrow.lib.array File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/arrow_writer.py", line 204, in __arrow_array__ out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 1833, in wrapper return func(array, *args, **kwargs) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 2091, in cast_array_to_feature casted_values = _c(array.values, feature.feature) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 1833, in wrapper return func(array, *args, **kwargs) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 2139, in cast_array_to_feature return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 1833, in wrapper return func(array, *args, **kwargs) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 1967, in array_cast return pa_type.wrap_array(array) File "pyarrow/types.pxi", line 879, in pyarrow.lib.BaseExtensionType.wrap_array TypeError: Incompatible storage type for extension<arrow.py_extension_type<Array2DExtensionType>>: expected list<item: list<item: int8>>, got list<item: list<item: int64>> ``` ### Expected behavior Not to fail. ### Environment info - Python 3.10.6 - datasets: master branch - Numpy: 1.23.4
40
Sequence of array not supported for most dtype ### Describe the bug Create a dataset composed of sequence of array fails for most dtypes (see code below). ### Steps to reproduce the bug ```python from datasets import Sequence, Array2D, Features, Dataset import numpy as np for dtype in [ "bool", # ok "int8", # failed "int16", # failed "int32", # failed "int64", # ok "uint8", # failed "uint16", # failed "uint32", # failed "uint64", # failed "float16", # failed "float32", # failed "float64", # ok ]: features = Features({"foo": Sequence(Array2D(dtype=dtype, shape=(2, 2)))}) sequence = [ [[1.0, 2.0], [3.0, 4.0]], [[5.0, 6.0], [7.0, 8.0]], ] array = np.array(sequence, dtype=dtype) try: dataset = Dataset.from_dict({"foo": [array]}, features=features) except Exception as e: print(f"Failed for dtype={dtype}") ``` Traceback for `dtype="int8"`: ``` Traceback (most recent call last): File "/home/qgallouedec/datasets/a.py", line 29, in <module> raise e File "/home/qgallouedec/datasets/a.py", line 26, in <module> dataset = Dataset.from_dict({"foo": [array]}, features=features) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 899, in from_dict pa_table = InMemoryTable.from_pydict(mapping=mapping) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 799, in from_pydict return cls(pa.Table.from_pydict(*args, **kwargs)) File "pyarrow/table.pxi", line 3725, in pyarrow.lib.Table.from_pydict File "pyarrow/table.pxi", line 5254, in pyarrow.lib._from_pydict File "pyarrow/array.pxi", line 350, in pyarrow.lib.asarray File "pyarrow/array.pxi", line 236, in pyarrow.lib.array File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/arrow_writer.py", line 204, in __arrow_array__ out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 1833, in wrapper return func(array, *args, **kwargs) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 2091, in cast_array_to_feature casted_values = _c(array.values, feature.feature) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 1833, in wrapper return func(array, *args, **kwargs) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 2139, in cast_array_to_feature return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 1833, in wrapper return func(array, *args, **kwargs) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 1967, in array_cast return pa_type.wrap_array(array) File "pyarrow/types.pxi", line 879, in pyarrow.lib.BaseExtensionType.wrap_array TypeError: Incompatible storage type for extension<arrow.py_extension_type<Array2DExtensionType>>: expected list<item: list<item: int8>>, got list<item: list<item: int64>> ``` ### Expected behavior Not to fail. ### Environment info - Python 3.10.6 - datasets: master branch - Numpy: 1.23.4 Arrow only support 1d numpy arrays, so we convert multidim arrays to lists of 1s arrays (and keep the dtype). Though you noticed that it's concerting to lists and lose the dtype. If it's the case then it's a bug.
[ 0.04710427671670914, -0.41798651218414307, -0.2184605449438095, 0.2592160701751709, 0.27266204357147217, 0.06292104721069336, 0.35634270310401917, 0.26765280961990356, 0.2174539715051651, 0.05035853013396263, 0.19395580887794495, 0.30664554238319397, -0.23231127858161926, 0.203426793217659, -0.06211439520120621, -0.25938716530799866, 0.08841173350811005, 0.3514937162399292, -0.1338149756193161, 0.0620170533657074, -0.24053283035755157, -0.02785823494195938, -0.31974658370018005, 0.07457169890403748, -0.007608272135257721, 0.05707757920026779, 0.10046562552452087, -0.024947602301836014, 0.15988101065158844, -0.6049400568008423, 0.28790491819381714, -0.14913997054100037, 0.01985003799200058, 0.32377371191978455, -0.00010375829879194498, 0.019799895584583282, 0.3419138193130493, -0.1654481291770935, -0.08550602197647095, 0.14313554763793945, -0.12202921509742737, -0.2844848930835724, -0.03115854784846306, -0.3491472005844116, -0.19866302609443665, -0.2680034637451172, -0.20317809283733368, -0.5941835045814514, 0.33203744888305664, 0.2959826588630676, 0.34590038657188416, 0.2585684657096863, 0.26511716842651367, -0.2574946880340576, -0.015479765832424164, 0.18089278042316437, -0.12845715880393982, -0.006078271195292473, 0.34087759256362915, 0.11314631253480911, 0.16457635164260864, 0.13059276342391968, -0.13442447781562805, 0.11708442866802216, 0.31282153725624084, -0.05320759862661362, 0.3940724730491638, -0.24373245239257812, -0.10693207383155823, 0.16523055732250214, 0.3610404431819916, -0.053576502948999405, -0.1820312887430191, -0.2012115716934204, -0.2625150680541992, -0.2644886076450348, 0.15473903715610504, -0.26640012860298157, -0.20313647389411926, 0.20632675290107727, -0.07874912023544312, 0.39071404933929443, -0.22993169724941254, 0.1462830752134323, -0.043597690761089325, -0.02776714786887169, -0.01704658940434456, 0.04167282208800316, -0.11923178285360336, -0.5155988931655884, 0.18481962382793427, 0.014176685363054276, -0.009563004598021507, -0.09388504922389984, -0.289448082447052, -0.298148512840271, 0.10611238330602646, -0.5606129765510559, 0.2093031108379364, -0.05674261972308159, 0.15051782131195068, 0.17144015431404114, 0.04243534058332443, -0.07798131555318832, -0.03595598414540291, 0.14009419083595276, -0.08024805784225464, -0.2375504970550537, 0.11568149924278259, 0.22041809558868408, 0.05570713430643082, 0.17004472017288208, 0.13613282144069672, -0.2609717547893524, 0.25791478157043457, 0.19762368500232697, 0.29167452454566956, -0.0447588749229908, -0.3332902789115906, 0.10341773182153702, -0.18412306904792786, 0.17126846313476562, 0.03926946595311165, 0.28857824206352234, 0.19740623235702515, 0.15423785150051117, -0.03151578828692436, 0.1328628957271576, 0.10700381547212601, 0.042585380375385284, -0.2270512878894806, -0.162907674908638, -0.05347172170877457, -0.15784353017807007, 0.11485825479030609, 0.2753201127052307, 0.1781696081161499, -0.027798663824796677, 0.035585612058639526, -0.016814708709716797, -0.2574976086616516, -0.1977866142988205, 0.3033008873462677, 0.10882025957107544, -0.22721627354621887, -0.0034094005823135376, 0.07954429090023041, 0.11029297113418579, -0.05558684468269348, 0.07367099076509476, -0.06050693243741989, 0.0572105348110199, -0.32464686036109924, 0.3343196511268616, 0.10519959777593613, 0.08715339004993439, -0.10123559832572937, 0.03780539706349373, 0.2654387056827545, -0.1729629635810852, 0.05767378956079483, -0.17297175526618958, -0.16085264086723328, -0.36072003841400146, 0.10302501916885376, 0.2557803690433502, -0.10988304018974304, 0.3903699219226837, 0.1606641262769699, 0.0050577204674482346, 0.12115397304296494, 0.16192254424095154, -0.03304271772503853, -0.061131078749895096, -0.35631421208381653, 0.0959397405385971, 0.19857928156852722, -0.20495283603668213, -0.15619999170303345, 0.1513037234544754, 0.03493652492761612, -0.023001402616500854, 0.20302177965641022, 0.1185576319694519, 0.16656939685344696, -0.2997044622898102, 0.08167615532875061, 0.34159353375434875, 0.009000848978757858, 0.06412949413061142, -0.16273073852062225, -0.1389712393283844, 0.24546518921852112, 0.0966491848230362, -0.15009817481040955, 0.015737589448690414, 0.040528394281864166, -0.04862816631793976, 0.1819625347852707, -0.18562006950378418, -0.0787767618894577, 0.22755642235279083, 0.3480304479598999, -0.1559889018535614, 0.10871687531471252, -0.46545928716659546, -0.464600145816803, 0.2781713008880615, -0.03746386244893074, -0.3635752201080322, -0.16886557638645172, -0.0019099339842796326, -0.3652994632720947, -0.009517628699541092, -0.27883991599082947, 0.050304532051086426, 0.3128887414932251, 0.08334710448980331, 0.1668882966041565, 0.04144155979156494, -0.09056355804204941, -0.02122511714696884, 0.048134565353393555, -0.004060573875904083, -0.2282927930355072, 0.4557192921638489, -0.14375847578048706, -0.2111036330461502, 0.10002267360687256, 0.3359679579734802, 0.1838645190000534, -0.1440412551164627, -0.03580944612622261, 0.25094541907310486, 0.28260016441345215, -0.2906848192214966, -0.4518148899078369, -0.047706395387649536, 0.27324816584587097, -0.4507535398006439, -0.0972486212849617, 0.5742958188056946, 0.188856303691864, -0.14073270559310913, -0.059764228761196136, 0.28920453786849976, -0.03786371275782585, 0.1993306577205658, -0.0008972734212875366, 0.03364727646112442, 0.4046114683151245, 0.028611719608306885, 0.13861842453479767, -0.23224925994873047, 0.1207592561841011, -0.0011012554168701172, 0.07943955063819885, -0.037144940346479416, -0.2717806100845337, 0.35424643754959106, 0.32882657647132874, 0.03686124086380005, 0.22080133855342865, 0.03592432662844658, 0.048468828201293945, 0.018324144184589386, 0.0769658163189888, -0.1406036615371704, 0.24067014455795288, 0.10700800269842148, -0.12144017219543457, -0.10592228919267654, -0.16016070544719696, -0.3054324984550476, 0.12510907649993896, -0.15667380392551422, 0.22503669559955597, 0.23815107345581055, 0.3602884113788605, 0.004021361470222473, -0.14141543209552765, -0.39233577251434326, -0.081551693379879, 0.17361927032470703, -0.1429280936717987, 0.11765758693218231, -0.4973874092102051, -0.5018401741981506, -0.09924481064081192, -0.08633212000131607, 0.28256115317344666, -0.15539923310279846, -0.16299423575401306, 0.217492938041687, -0.2246687263250351, 0.2257782220840454, 0.1468234658241272, 0.027090296149253845, 0.5003238320350647, 0.008556434884667397, -0.2942654490470886, 0.15477296710014343, -0.08583123236894608, 0.1691485345363617, 0.1557154357433319, 0.08371520042419434, 0.25762131810188293, 0.1011630967259407, -0.21796825528144836, -0.3053639233112335, -0.3083547353744507, -0.055289458483457565, -0.11944007873535156, 0.040335513651371, 0.2694128751754761, 0.2341795712709427, 0.17320874333381653, -0.13777723908424377, 0.04558319225907326, 0.06424296647310257, -0.33573588728904724, 0.268332839012146, 0.09328593313694, -0.16538754105567932, -0.29233235120773315, -0.2621246874332428, -0.17808176577091217, -0.4526141583919525, 0.20079058408737183, 0.07354754209518433, 0.23395368456840515, 0.1796092987060547, 0.009876713156700134, 0.19677285850048065, 0.034787606447935104, 0.07653295993804932, -0.1447373628616333, 0.5057507753372192, 0.24779395759105682, -0.10054092854261398, -0.30027875304222107, -0.1994580775499344, -0.2739052176475525, -0.08660313487052917, 0.09610313177108765, -0.2166610062122345, -0.3716024160385132, -0.3397773206233978, 0.05209624767303467, -0.13596689701080322, -0.2179347574710846, 0.21754573285579681, 0.12522688508033752, -0.2232798933982849, -0.17034924030303955, -0.04091263562440872, 0.2042907476425171, 0.0603698268532753, -0.14952214062213898, 0.21299725770950317, 0.5319018363952637, 0.07515937089920044, 0.03784720227122307, 0.3697431683540344, -0.29821979999542236, 0.48552796244621277, 0.0016982201486825943, 0.19503045082092285, -0.3597157895565033, -0.1810183823108673, -0.05190387740731239, 0.14004969596862793, -0.05965074896812439, 0.025356475263834, -0.4153689742088318, -0.2356918603181839, 0.033297620713710785, 0.2624474763870239, -0.020303919911384583, -0.05474352091550827, -0.10533291846513748, -0.12212613224983215, 0.16880981624126434, -0.08518464118242264, 0.2590228319168091, 0.011509742587804794, -0.09580817073583603, -0.128830686211586, -0.02515300363302231, 0.22461538016796112, -0.045432381331920624, -0.4586372375488281, -0.2168119102716446, -0.16607853770256042, 0.24556508660316467, 0.19789814949035645, 0.7688114643096924, -0.2240338921546936, -0.013212800025939941, -0.17097757756710052, 0.07603738456964493, 0.3257191479206085, -0.18024227023124695, 0.18379922211170197, 0.21192461252212524, -0.0772370770573616, -0.31308966875076294, -0.09174535423517227, -0.14255663752555847, 0.10913366824388504, -0.07304134964942932, 0.5789585113525391, -0.22845083475112915, 0.011298388242721558, 0.15475638210773468, 0.2960861921310425, 0.04468017816543579, -0.08312615752220154, -0.08521795272827148, -0.3290397822856903, -0.20372028648853302, 0.014617636799812317, 0.365485280752182, 0.31403428316116333, -0.03383829444646835, -0.4097106456756592, -0.3987470269203186, -0.44826751947402954, -0.06247645244002342, 0.0694672018289566, 0.35562992095947266, -0.0015889368951320648, 0.2623184025287628, -0.28405967354774475, 0.16388610005378723, 0.25414884090423584, 0.050341684371232986, 0.10778949409723282, -0.17674000561237335, 0.09507396072149277, -0.29303714632987976, 0.010163791477680206, 0.366301953792572, -0.20652064681053162, 0.18023309111595154, -0.3409329354763031, 0.04447852447628975, -0.09500308334827423, -0.18549475073814392, 0.2284492552280426, -0.09928856790065765, -0.29584354162216187, -0.14041298627853394, 0.24489448964595795, -0.08738987147808075, 0.03569374978542328, 0.06649395823478699, -0.11186521500349045, -0.4245508313179016, 0.5086957812309265, 0.2095409333705902, 0.6204473972320557, 0.2869952321052551, 0.0985465794801712, 0.5469993948936462, 0.11500053852796555, 0.27039262652397156, 0.3894447982311249, 0.05704374611377716, -0.381236732006073, -0.4136083424091339, -0.15051798522472382, -0.3260973393917084, -0.0201936773955822, 0.08195540308952332, -0.3083687722682953, 0.4172401428222656, -0.20332053303718567, 0.26250582933425903, 0.12664680182933807, -0.21755892038345337, 0.10480561852455139, -0.1023629680275917, -0.3038029372692108, 0.2093794047832489, -0.003427928313612938, -0.21259605884552002, -0.05935891717672348, -0.4488982856273651, -0.005653165280818939, -0.05738507956266403, -0.3051314353942871, -0.033844996243715286, -0.33612632751464844, 0.25724294781684875, 0.054225098341703415, -0.24795350432395935, 0.01624133437871933, 0.12021012604236603, 0.37531211972236633, 0.05814165249466896, -0.147359699010849, -0.20985205471515656, 0.16917365789413452, 0.05446768179535866, -0.1907888650894165, -0.11951997876167297, 0.3211011588573456, -0.03728719800710678, 0.16980400681495667, 0.13366496562957764, -0.045653823763132095, -0.22519341111183167, -0.15071186423301697, 0.18058064579963684, -0.2443748414516449, -0.0727166011929512, -0.39549046754837036, -0.1498870700597763, -0.32004088163375854, -0.3091915249824524, 0.2311902642250061, -0.032522860914468765, -0.03150252625346184, 0.27918002009391785, -0.07089842855930328, -0.10316235572099686, -0.09029059112071991, 0.09799664467573166, 0.21432487666606903, 0.020349405705928802, 0.2554803192615509, 0.11535441875457764, -0.278110146522522, -0.3388011157512665, 0.20081013441085815, 0.06216404214501381, -0.23235437273979187, 0.29618769884109497, -0.29510363936424255, -0.074785016477108, -0.016375591978430748, 0.22146332263946533, 0.06665585190057755, 0.0991586446762085, -0.05986175686120987, -0.3167397677898407, -0.18271395564079285, 0.21827024221420288, -0.07887209951877594, 0.21400709450244904, -0.2791229486465454, 0.2020365595817566, -0.3283761739730835, -0.16108807921409607, -0.4142492413520813, 0.05775664001703262, -0.2673041820526123, -0.005165895447134972, -0.11860692501068115, -0.1350436806678772, -0.07492052018642426, 0.002568155527114868, 0.26873481273651123, 0.3639909029006958, -0.2958710491657257, -0.3228549659252167, 0.09384441375732422, 0.09074857085943222, 0.028117869049310684, -0.2041592001914978, -0.15772287547588348, -0.31680989265441895, -0.3111025094985962, -0.029938001185655594, -0.09084043651819229, -0.016918711364269257, 0.09050218015909195, 0.017320245504379272, 0.3415352404117584, 0.18863248825073242, 0.11462096869945526, 0.16494914889335632, -0.20540887117385864, 0.013604819774627686, -0.11632940173149109, -0.02346792444586754, -0.14315013587474823, -0.07015462219715118, -0.2507389187812805, 0.126840740442276, -0.17350232601165771, -0.13996021449565887, 0.4517121911048889, -0.2247321754693985, -0.3162948787212372, 0.27631938457489014, 0.3224531412124634, 0.25341883301734924, -0.33612626791000366, -0.14395347237586975, 0.04570407047867775, 0.35777801275253296, -0.26223018765449524, -0.03206968680024147, 0.032218072563409805, 0.25675687193870544, 0.24565066397190094, 0.3134855031967163, 0.24924182891845703, -0.2100391387939453, 0.19965580105781555, 0.21192142367362976, 0.22850127518177032, -0.2187928855419159, -0.049037866294384, 0.38189733028411865, 0.13143059611320496, -0.0773104876279831, 0.10097882896661758, 0.08210790157318115, 0.5738421678543091, 0.661223828792572, 0.06158089637756348, 0.3648393452167511, 0.2957206964492798, -0.18129116296768188, 0.09370166063308716, -0.0012826696038246155, -0.1307034194469452, 0.2839376926422119, -0.03740757331252098, 0.1265764832496643, 0.2662622332572937, 0.15311376750469208, -0.38176506757736206, -0.27688756585121155, -0.2246411144733429, -0.0958121120929718, -0.20689457654953003, 0.11691709607839584, 0.19301125407218933, -0.004852548241615295, -0.24499934911727905, -0.37791183590888977, -0.21604463458061218, 0.10311165452003479, 0.18366417288780212, 0.058341048657894135, 0.055482037365436554, -0.3151479661464691, 0.23301579058170319, 0.24657291173934937, 0.15188734233379364, -0.05076794698834419, 0.35070863366127014, 0.4531874358654022, -0.030349235981702805, 0.05250595510005951, 0.29838666319847107, 0.2718059718608856, 0.25199607014656067, -0.21164962649345398, -0.07964523136615753, -0.2551901936531067, -0.2305421531200409, -0.10674770921468735, 0.28151699900627136, 0.009318837895989418, 0.002818675711750984, 0.36950111389160156, 0.21507731080055237, -0.17255552113056183, 0.1506788432598114, 0.2342243790626526, -0.1370527744293213, -0.29929471015930176, 0.4590909481048584, -0.3323836028575897, 0.05405630171298981, 0.2212623655796051, -0.018206730484962463, -0.4808654189109802, -0.06835315376520157, 0.1906050443649292, 0.07689499855041504, 0.28995952010154724, 0.3105180859565735, 0.13970163464546204, -0.26347288489341736, 0.3097778558731079, -0.004798496142029762, 0.22330136597156525, -0.055902428925037384, -0.09542520344257355, -0.4618712067604065, 0.20735111832618713, 0.14966779947280884, -0.030584018677473068, 0.30138877034187317, 0.1292780041694641, 0.09016606211662292, 0.0345672145485878, 0.0030015483498573303, 0.013099931180477142, 0.08230169117450714, 0.30687958002090454, -0.49578243494033813, -0.16133229434490204, 0.05870259553194046, -0.09419640898704529, -0.08207183331251144, -0.40551602840423584, 0.38083416223526, -0.16678142547607422, 0.2722536027431488, -0.20074953138828278, 0.08001789450645447, -0.05929005146026611, 0.3546414375305176, 0.2655177116394043, 0.24441023170948029, 0.15772542357444763, -0.0272560715675354, -0.09036313742399216, -0.09626127779483795, -0.31052321195602417, -0.022569838911294937, 0.32206428050994873, 0.2720547914505005, 0.36253809928894043, -0.13911093771457672, 0.026517728343605995, 0.02864980697631836, 0.3302376866340637, 0.04790861904621124, 0.05501407012343407, -0.39969402551651, 0.4148034155368805, -0.26342540979385376, 0.18720227479934692, 0.07682102918624878, 0.05342434346675873, 0.02976517379283905, 0.2536046504974365, -0.10441872477531433, -0.6678894758224487, 0.49736288189888, 0.13971106708049774, -0.3629642128944397, 0.011703170835971832, 0.12347820401191711, 0.2633361220359802, 0.19111400842666626, -0.22962766885757446, -0.1261516809463501, 0.36815202236175537, -0.06593610346317291, -0.1757286936044693, 0.2900436520576477, -0.0523756742477417, 0.005468092858791351, -0.1569465696811676, 0.4868296682834625, 0.07038362324237823, -0.18574441969394684, 0.05399540811777115, -0.21753078699111938 ]
https://github.com/huggingface/datasets/issues/5936
Ok the conversion to list shouldn't be there indeed ! Could you open a PR to remove it ?
Sequence of array not supported for most dtype
### Describe the bug Create a dataset composed of sequence of array fails for most dtypes (see code below). ### Steps to reproduce the bug ```python from datasets import Sequence, Array2D, Features, Dataset import numpy as np for dtype in [ "bool", # ok "int8", # failed "int16", # failed "int32", # failed "int64", # ok "uint8", # failed "uint16", # failed "uint32", # failed "uint64", # failed "float16", # failed "float32", # failed "float64", # ok ]: features = Features({"foo": Sequence(Array2D(dtype=dtype, shape=(2, 2)))}) sequence = [ [[1.0, 2.0], [3.0, 4.0]], [[5.0, 6.0], [7.0, 8.0]], ] array = np.array(sequence, dtype=dtype) try: dataset = Dataset.from_dict({"foo": [array]}, features=features) except Exception as e: print(f"Failed for dtype={dtype}") ``` Traceback for `dtype="int8"`: ``` Traceback (most recent call last): File "/home/qgallouedec/datasets/a.py", line 29, in <module> raise e File "/home/qgallouedec/datasets/a.py", line 26, in <module> dataset = Dataset.from_dict({"foo": [array]}, features=features) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 899, in from_dict pa_table = InMemoryTable.from_pydict(mapping=mapping) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 799, in from_pydict return cls(pa.Table.from_pydict(*args, **kwargs)) File "pyarrow/table.pxi", line 3725, in pyarrow.lib.Table.from_pydict File "pyarrow/table.pxi", line 5254, in pyarrow.lib._from_pydict File "pyarrow/array.pxi", line 350, in pyarrow.lib.asarray File "pyarrow/array.pxi", line 236, in pyarrow.lib.array File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/arrow_writer.py", line 204, in __arrow_array__ out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 1833, in wrapper return func(array, *args, **kwargs) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 2091, in cast_array_to_feature casted_values = _c(array.values, feature.feature) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 1833, in wrapper return func(array, *args, **kwargs) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 2139, in cast_array_to_feature return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 1833, in wrapper return func(array, *args, **kwargs) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 1967, in array_cast return pa_type.wrap_array(array) File "pyarrow/types.pxi", line 879, in pyarrow.lib.BaseExtensionType.wrap_array TypeError: Incompatible storage type for extension<arrow.py_extension_type<Array2DExtensionType>>: expected list<item: list<item: int8>>, got list<item: list<item: int64>> ``` ### Expected behavior Not to fail. ### Environment info - Python 3.10.6 - datasets: master branch - Numpy: 1.23.4
19
Sequence of array not supported for most dtype ### Describe the bug Create a dataset composed of sequence of array fails for most dtypes (see code below). ### Steps to reproduce the bug ```python from datasets import Sequence, Array2D, Features, Dataset import numpy as np for dtype in [ "bool", # ok "int8", # failed "int16", # failed "int32", # failed "int64", # ok "uint8", # failed "uint16", # failed "uint32", # failed "uint64", # failed "float16", # failed "float32", # failed "float64", # ok ]: features = Features({"foo": Sequence(Array2D(dtype=dtype, shape=(2, 2)))}) sequence = [ [[1.0, 2.0], [3.0, 4.0]], [[5.0, 6.0], [7.0, 8.0]], ] array = np.array(sequence, dtype=dtype) try: dataset = Dataset.from_dict({"foo": [array]}, features=features) except Exception as e: print(f"Failed for dtype={dtype}") ``` Traceback for `dtype="int8"`: ``` Traceback (most recent call last): File "/home/qgallouedec/datasets/a.py", line 29, in <module> raise e File "/home/qgallouedec/datasets/a.py", line 26, in <module> dataset = Dataset.from_dict({"foo": [array]}, features=features) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 899, in from_dict pa_table = InMemoryTable.from_pydict(mapping=mapping) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 799, in from_pydict return cls(pa.Table.from_pydict(*args, **kwargs)) File "pyarrow/table.pxi", line 3725, in pyarrow.lib.Table.from_pydict File "pyarrow/table.pxi", line 5254, in pyarrow.lib._from_pydict File "pyarrow/array.pxi", line 350, in pyarrow.lib.asarray File "pyarrow/array.pxi", line 236, in pyarrow.lib.array File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/arrow_writer.py", line 204, in __arrow_array__ out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 1833, in wrapper return func(array, *args, **kwargs) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 2091, in cast_array_to_feature casted_values = _c(array.values, feature.feature) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 1833, in wrapper return func(array, *args, **kwargs) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 2139, in cast_array_to_feature return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 1833, in wrapper return func(array, *args, **kwargs) File "/home/qgallouedec/env/lib/python3.10/site-packages/datasets/table.py", line 1967, in array_cast return pa_type.wrap_array(array) File "pyarrow/types.pxi", line 879, in pyarrow.lib.BaseExtensionType.wrap_array TypeError: Incompatible storage type for extension<arrow.py_extension_type<Array2DExtensionType>>: expected list<item: list<item: int8>>, got list<item: list<item: int64>> ``` ### Expected behavior Not to fail. ### Environment info - Python 3.10.6 - datasets: master branch - Numpy: 1.23.4 Ok the conversion to list shouldn't be there indeed ! Could you open a PR to remove it ?
[ 0.04710427671670914, -0.41798651218414307, -0.2184605449438095, 0.2592160701751709, 0.27266204357147217, 0.06292104721069336, 0.35634270310401917, 0.26765280961990356, 0.2174539715051651, 0.05035853013396263, 0.19395580887794495, 0.30664554238319397, -0.23231127858161926, 0.203426793217659, -0.06211439520120621, -0.25938716530799866, 0.08841173350811005, 0.3514937162399292, -0.1338149756193161, 0.0620170533657074, -0.24053283035755157, -0.02785823494195938, -0.31974658370018005, 0.07457169890403748, -0.007608272135257721, 0.05707757920026779, 0.10046562552452087, -0.024947602301836014, 0.15988101065158844, -0.6049400568008423, 0.28790491819381714, -0.14913997054100037, 0.01985003799200058, 0.32377371191978455, -0.00010375829879194498, 0.019799895584583282, 0.3419138193130493, -0.1654481291770935, -0.08550602197647095, 0.14313554763793945, -0.12202921509742737, -0.2844848930835724, -0.03115854784846306, -0.3491472005844116, -0.19866302609443665, -0.2680034637451172, -0.20317809283733368, -0.5941835045814514, 0.33203744888305664, 0.2959826588630676, 0.34590038657188416, 0.2585684657096863, 0.26511716842651367, -0.2574946880340576, -0.015479765832424164, 0.18089278042316437, -0.12845715880393982, -0.006078271195292473, 0.34087759256362915, 0.11314631253480911, 0.16457635164260864, 0.13059276342391968, -0.13442447781562805, 0.11708442866802216, 0.31282153725624084, -0.05320759862661362, 0.3940724730491638, -0.24373245239257812, -0.10693207383155823, 0.16523055732250214, 0.3610404431819916, -0.053576502948999405, -0.1820312887430191, -0.2012115716934204, -0.2625150680541992, -0.2644886076450348, 0.15473903715610504, -0.26640012860298157, -0.20313647389411926, 0.20632675290107727, -0.07874912023544312, 0.39071404933929443, -0.22993169724941254, 0.1462830752134323, -0.043597690761089325, -0.02776714786887169, -0.01704658940434456, 0.04167282208800316, -0.11923178285360336, -0.5155988931655884, 0.18481962382793427, 0.014176685363054276, -0.009563004598021507, -0.09388504922389984, -0.289448082447052, -0.298148512840271, 0.10611238330602646, -0.5606129765510559, 0.2093031108379364, -0.05674261972308159, 0.15051782131195068, 0.17144015431404114, 0.04243534058332443, -0.07798131555318832, -0.03595598414540291, 0.14009419083595276, -0.08024805784225464, -0.2375504970550537, 0.11568149924278259, 0.22041809558868408, 0.05570713430643082, 0.17004472017288208, 0.13613282144069672, -0.2609717547893524, 0.25791478157043457, 0.19762368500232697, 0.29167452454566956, -0.0447588749229908, -0.3332902789115906, 0.10341773182153702, -0.18412306904792786, 0.17126846313476562, 0.03926946595311165, 0.28857824206352234, 0.19740623235702515, 0.15423785150051117, -0.03151578828692436, 0.1328628957271576, 0.10700381547212601, 0.042585380375385284, -0.2270512878894806, -0.162907674908638, -0.05347172170877457, -0.15784353017807007, 0.11485825479030609, 0.2753201127052307, 0.1781696081161499, -0.027798663824796677, 0.035585612058639526, -0.016814708709716797, -0.2574976086616516, -0.1977866142988205, 0.3033008873462677, 0.10882025957107544, -0.22721627354621887, -0.0034094005823135376, 0.07954429090023041, 0.11029297113418579, -0.05558684468269348, 0.07367099076509476, -0.06050693243741989, 0.0572105348110199, -0.32464686036109924, 0.3343196511268616, 0.10519959777593613, 0.08715339004993439, -0.10123559832572937, 0.03780539706349373, 0.2654387056827545, -0.1729629635810852, 0.05767378956079483, -0.17297175526618958, -0.16085264086723328, -0.36072003841400146, 0.10302501916885376, 0.2557803690433502, -0.10988304018974304, 0.3903699219226837, 0.1606641262769699, 0.0050577204674482346, 0.12115397304296494, 0.16192254424095154, -0.03304271772503853, -0.061131078749895096, -0.35631421208381653, 0.0959397405385971, 0.19857928156852722, -0.20495283603668213, -0.15619999170303345, 0.1513037234544754, 0.03493652492761612, -0.023001402616500854, 0.20302177965641022, 0.1185576319694519, 0.16656939685344696, -0.2997044622898102, 0.08167615532875061, 0.34159353375434875, 0.009000848978757858, 0.06412949413061142, -0.16273073852062225, -0.1389712393283844, 0.24546518921852112, 0.0966491848230362, -0.15009817481040955, 0.015737589448690414, 0.040528394281864166, -0.04862816631793976, 0.1819625347852707, -0.18562006950378418, -0.0787767618894577, 0.22755642235279083, 0.3480304479598999, -0.1559889018535614, 0.10871687531471252, -0.46545928716659546, -0.464600145816803, 0.2781713008880615, -0.03746386244893074, -0.3635752201080322, -0.16886557638645172, -0.0019099339842796326, -0.3652994632720947, -0.009517628699541092, -0.27883991599082947, 0.050304532051086426, 0.3128887414932251, 0.08334710448980331, 0.1668882966041565, 0.04144155979156494, -0.09056355804204941, -0.02122511714696884, 0.048134565353393555, -0.004060573875904083, -0.2282927930355072, 0.4557192921638489, -0.14375847578048706, -0.2111036330461502, 0.10002267360687256, 0.3359679579734802, 0.1838645190000534, -0.1440412551164627, -0.03580944612622261, 0.25094541907310486, 0.28260016441345215, -0.2906848192214966, -0.4518148899078369, -0.047706395387649536, 0.27324816584587097, -0.4507535398006439, -0.0972486212849617, 0.5742958188056946, 0.188856303691864, -0.14073270559310913, -0.059764228761196136, 0.28920453786849976, -0.03786371275782585, 0.1993306577205658, -0.0008972734212875366, 0.03364727646112442, 0.4046114683151245, 0.028611719608306885, 0.13861842453479767, -0.23224925994873047, 0.1207592561841011, -0.0011012554168701172, 0.07943955063819885, -0.037144940346479416, -0.2717806100845337, 0.35424643754959106, 0.32882657647132874, 0.03686124086380005, 0.22080133855342865, 0.03592432662844658, 0.048468828201293945, 0.018324144184589386, 0.0769658163189888, -0.1406036615371704, 0.24067014455795288, 0.10700800269842148, -0.12144017219543457, -0.10592228919267654, -0.16016070544719696, -0.3054324984550476, 0.12510907649993896, -0.15667380392551422, 0.22503669559955597, 0.23815107345581055, 0.3602884113788605, 0.004021361470222473, -0.14141543209552765, -0.39233577251434326, -0.081551693379879, 0.17361927032470703, -0.1429280936717987, 0.11765758693218231, -0.4973874092102051, -0.5018401741981506, -0.09924481064081192, -0.08633212000131607, 0.28256115317344666, -0.15539923310279846, -0.16299423575401306, 0.217492938041687, -0.2246687263250351, 0.2257782220840454, 0.1468234658241272, 0.027090296149253845, 0.5003238320350647, 0.008556434884667397, -0.2942654490470886, 0.15477296710014343, -0.08583123236894608, 0.1691485345363617, 0.1557154357433319, 0.08371520042419434, 0.25762131810188293, 0.1011630967259407, -0.21796825528144836, -0.3053639233112335, -0.3083547353744507, -0.055289458483457565, -0.11944007873535156, 0.040335513651371, 0.2694128751754761, 0.2341795712709427, 0.17320874333381653, -0.13777723908424377, 0.04558319225907326, 0.06424296647310257, -0.33573588728904724, 0.268332839012146, 0.09328593313694, -0.16538754105567932, -0.29233235120773315, -0.2621246874332428, -0.17808176577091217, -0.4526141583919525, 0.20079058408737183, 0.07354754209518433, 0.23395368456840515, 0.1796092987060547, 0.009876713156700134, 0.19677285850048065, 0.034787606447935104, 0.07653295993804932, -0.1447373628616333, 0.5057507753372192, 0.24779395759105682, -0.10054092854261398, -0.30027875304222107, -0.1994580775499344, -0.2739052176475525, -0.08660313487052917, 0.09610313177108765, -0.2166610062122345, -0.3716024160385132, -0.3397773206233978, 0.05209624767303467, -0.13596689701080322, -0.2179347574710846, 0.21754573285579681, 0.12522688508033752, -0.2232798933982849, -0.17034924030303955, -0.04091263562440872, 0.2042907476425171, 0.0603698268532753, -0.14952214062213898, 0.21299725770950317, 0.5319018363952637, 0.07515937089920044, 0.03784720227122307, 0.3697431683540344, -0.29821979999542236, 0.48552796244621277, 0.0016982201486825943, 0.19503045082092285, -0.3597157895565033, -0.1810183823108673, -0.05190387740731239, 0.14004969596862793, -0.05965074896812439, 0.025356475263834, -0.4153689742088318, -0.2356918603181839, 0.033297620713710785, 0.2624474763870239, -0.020303919911384583, -0.05474352091550827, -0.10533291846513748, -0.12212613224983215, 0.16880981624126434, -0.08518464118242264, 0.2590228319168091, 0.011509742587804794, -0.09580817073583603, -0.128830686211586, -0.02515300363302231, 0.22461538016796112, -0.045432381331920624, -0.4586372375488281, -0.2168119102716446, -0.16607853770256042, 0.24556508660316467, 0.19789814949035645, 0.7688114643096924, -0.2240338921546936, -0.013212800025939941, -0.17097757756710052, 0.07603738456964493, 0.3257191479206085, -0.18024227023124695, 0.18379922211170197, 0.21192461252212524, -0.0772370770573616, -0.31308966875076294, -0.09174535423517227, -0.14255663752555847, 0.10913366824388504, -0.07304134964942932, 0.5789585113525391, -0.22845083475112915, 0.011298388242721558, 0.15475638210773468, 0.2960861921310425, 0.04468017816543579, -0.08312615752220154, -0.08521795272827148, -0.3290397822856903, -0.20372028648853302, 0.014617636799812317, 0.365485280752182, 0.31403428316116333, -0.03383829444646835, -0.4097106456756592, -0.3987470269203186, -0.44826751947402954, -0.06247645244002342, 0.0694672018289566, 0.35562992095947266, -0.0015889368951320648, 0.2623184025287628, -0.28405967354774475, 0.16388610005378723, 0.25414884090423584, 0.050341684371232986, 0.10778949409723282, -0.17674000561237335, 0.09507396072149277, -0.29303714632987976, 0.010163791477680206, 0.366301953792572, -0.20652064681053162, 0.18023309111595154, -0.3409329354763031, 0.04447852447628975, -0.09500308334827423, -0.18549475073814392, 0.2284492552280426, -0.09928856790065765, -0.29584354162216187, -0.14041298627853394, 0.24489448964595795, -0.08738987147808075, 0.03569374978542328, 0.06649395823478699, -0.11186521500349045, -0.4245508313179016, 0.5086957812309265, 0.2095409333705902, 0.6204473972320557, 0.2869952321052551, 0.0985465794801712, 0.5469993948936462, 0.11500053852796555, 0.27039262652397156, 0.3894447982311249, 0.05704374611377716, -0.381236732006073, -0.4136083424091339, -0.15051798522472382, -0.3260973393917084, -0.0201936773955822, 0.08195540308952332, -0.3083687722682953, 0.4172401428222656, -0.20332053303718567, 0.26250582933425903, 0.12664680182933807, -0.21755892038345337, 0.10480561852455139, -0.1023629680275917, -0.3038029372692108, 0.2093794047832489, -0.003427928313612938, -0.21259605884552002, -0.05935891717672348, -0.4488982856273651, -0.005653165280818939, -0.05738507956266403, -0.3051314353942871, -0.033844996243715286, -0.33612632751464844, 0.25724294781684875, 0.054225098341703415, -0.24795350432395935, 0.01624133437871933, 0.12021012604236603, 0.37531211972236633, 0.05814165249466896, -0.147359699010849, -0.20985205471515656, 0.16917365789413452, 0.05446768179535866, -0.1907888650894165, -0.11951997876167297, 0.3211011588573456, -0.03728719800710678, 0.16980400681495667, 0.13366496562957764, -0.045653823763132095, -0.22519341111183167, -0.15071186423301697, 0.18058064579963684, -0.2443748414516449, -0.0727166011929512, -0.39549046754837036, -0.1498870700597763, -0.32004088163375854, -0.3091915249824524, 0.2311902642250061, -0.032522860914468765, -0.03150252625346184, 0.27918002009391785, -0.07089842855930328, -0.10316235572099686, -0.09029059112071991, 0.09799664467573166, 0.21432487666606903, 0.020349405705928802, 0.2554803192615509, 0.11535441875457764, -0.278110146522522, -0.3388011157512665, 0.20081013441085815, 0.06216404214501381, -0.23235437273979187, 0.29618769884109497, -0.29510363936424255, -0.074785016477108, -0.016375591978430748, 0.22146332263946533, 0.06665585190057755, 0.0991586446762085, -0.05986175686120987, -0.3167397677898407, -0.18271395564079285, 0.21827024221420288, -0.07887209951877594, 0.21400709450244904, -0.2791229486465454, 0.2020365595817566, -0.3283761739730835, -0.16108807921409607, -0.4142492413520813, 0.05775664001703262, -0.2673041820526123, -0.005165895447134972, -0.11860692501068115, -0.1350436806678772, -0.07492052018642426, 0.002568155527114868, 0.26873481273651123, 0.3639909029006958, -0.2958710491657257, -0.3228549659252167, 0.09384441375732422, 0.09074857085943222, 0.028117869049310684, -0.2041592001914978, -0.15772287547588348, -0.31680989265441895, -0.3111025094985962, -0.029938001185655594, -0.09084043651819229, -0.016918711364269257, 0.09050218015909195, 0.017320245504379272, 0.3415352404117584, 0.18863248825073242, 0.11462096869945526, 0.16494914889335632, -0.20540887117385864, 0.013604819774627686, -0.11632940173149109, -0.02346792444586754, -0.14315013587474823, -0.07015462219715118, -0.2507389187812805, 0.126840740442276, -0.17350232601165771, -0.13996021449565887, 0.4517121911048889, -0.2247321754693985, -0.3162948787212372, 0.27631938457489014, 0.3224531412124634, 0.25341883301734924, -0.33612626791000366, -0.14395347237586975, 0.04570407047867775, 0.35777801275253296, -0.26223018765449524, -0.03206968680024147, 0.032218072563409805, 0.25675687193870544, 0.24565066397190094, 0.3134855031967163, 0.24924182891845703, -0.2100391387939453, 0.19965580105781555, 0.21192142367362976, 0.22850127518177032, -0.2187928855419159, -0.049037866294384, 0.38189733028411865, 0.13143059611320496, -0.0773104876279831, 0.10097882896661758, 0.08210790157318115, 0.5738421678543091, 0.661223828792572, 0.06158089637756348, 0.3648393452167511, 0.2957206964492798, -0.18129116296768188, 0.09370166063308716, -0.0012826696038246155, -0.1307034194469452, 0.2839376926422119, -0.03740757331252098, 0.1265764832496643, 0.2662622332572937, 0.15311376750469208, -0.38176506757736206, -0.27688756585121155, -0.2246411144733429, -0.0958121120929718, -0.20689457654953003, 0.11691709607839584, 0.19301125407218933, -0.004852548241615295, -0.24499934911727905, -0.37791183590888977, -0.21604463458061218, 0.10311165452003479, 0.18366417288780212, 0.058341048657894135, 0.055482037365436554, -0.3151479661464691, 0.23301579058170319, 0.24657291173934937, 0.15188734233379364, -0.05076794698834419, 0.35070863366127014, 0.4531874358654022, -0.030349235981702805, 0.05250595510005951, 0.29838666319847107, 0.2718059718608856, 0.25199607014656067, -0.21164962649345398, -0.07964523136615753, -0.2551901936531067, -0.2305421531200409, -0.10674770921468735, 0.28151699900627136, 0.009318837895989418, 0.002818675711750984, 0.36950111389160156, 0.21507731080055237, -0.17255552113056183, 0.1506788432598114, 0.2342243790626526, -0.1370527744293213, -0.29929471015930176, 0.4590909481048584, -0.3323836028575897, 0.05405630171298981, 0.2212623655796051, -0.018206730484962463, -0.4808654189109802, -0.06835315376520157, 0.1906050443649292, 0.07689499855041504, 0.28995952010154724, 0.3105180859565735, 0.13970163464546204, -0.26347288489341736, 0.3097778558731079, -0.004798496142029762, 0.22330136597156525, -0.055902428925037384, -0.09542520344257355, -0.4618712067604065, 0.20735111832618713, 0.14966779947280884, -0.030584018677473068, 0.30138877034187317, 0.1292780041694641, 0.09016606211662292, 0.0345672145485878, 0.0030015483498573303, 0.013099931180477142, 0.08230169117450714, 0.30687958002090454, -0.49578243494033813, -0.16133229434490204, 0.05870259553194046, -0.09419640898704529, -0.08207183331251144, -0.40551602840423584, 0.38083416223526, -0.16678142547607422, 0.2722536027431488, -0.20074953138828278, 0.08001789450645447, -0.05929005146026611, 0.3546414375305176, 0.2655177116394043, 0.24441023170948029, 0.15772542357444763, -0.0272560715675354, -0.09036313742399216, -0.09626127779483795, -0.31052321195602417, -0.022569838911294937, 0.32206428050994873, 0.2720547914505005, 0.36253809928894043, -0.13911093771457672, 0.026517728343605995, 0.02864980697631836, 0.3302376866340637, 0.04790861904621124, 0.05501407012343407, -0.39969402551651, 0.4148034155368805, -0.26342540979385376, 0.18720227479934692, 0.07682102918624878, 0.05342434346675873, 0.02976517379283905, 0.2536046504974365, -0.10441872477531433, -0.6678894758224487, 0.49736288189888, 0.13971106708049774, -0.3629642128944397, 0.011703170835971832, 0.12347820401191711, 0.2633361220359802, 0.19111400842666626, -0.22962766885757446, -0.1261516809463501, 0.36815202236175537, -0.06593610346317291, -0.1757286936044693, 0.2900436520576477, -0.0523756742477417, 0.005468092858791351, -0.1569465696811676, 0.4868296682834625, 0.07038362324237823, -0.18574441969394684, 0.05399540811777115, -0.21753078699111938 ]
https://github.com/huggingface/datasets/issues/5931
This can happen when a map transform cannot be hashed deterministically (e.g., an object referenced by the transform changes its state after the first call - an issue with fast tokenizers). The solution is to provide `cache_file_name` in the `map` call to check this file for the cached result instead of relying on the default caching mechanism.
`datasets.map` not reusing cached copy by default
### Describe the bug When I load the dataset from local directory, it's cached copy is picked up after first time. However, for `map` operation, the operation is applied again and cached copy is not picked up. Is there any way to pick cached copy instead of processing it again? The only solution I could think of was to use `save_to_disk` after my last transform and then use that in my DataLoader pipeline. Are there any other solutions for the same? One more thing, my dataset is occupying 6GB storage memory after I use `map`, is there any way I can reduce that memory usage? ### Steps to reproduce the bug ``` # make sure that dataset decodes audio with correct sampling rate dataset_sampling_rate = next(iter(self.raw_datasets.values())).features["audio"].sampling_rate if dataset_sampling_rate != self.feature_extractor.sampling_rate: self.raw_datasets = self.raw_datasets.cast_column( "audio", datasets.features.Audio(sampling_rate=self.feature_extractor.sampling_rate) ) vectorized_datasets = self.raw_datasets.map( self.prepare_dataset, remove_columns=next(iter(self.raw_datasets.values())).column_names, num_proc=self.num_workers, desc="preprocess datasets", ) # filter data that is longer than max_input_length self.vectorized_datasets = vectorized_datasets.filter( self.is_audio_in_length_range, num_proc=self.num_workers, input_columns=["input_length"], ) def prepare_dataset(self, batch): # load audio sample = batch["audio"] inputs = self.feature_extractor(sample["array"], sampling_rate=sample["sampling_rate"]) batch["input_values"] = inputs.input_values[0] batch["input_length"] = len(batch["input_values"]) batch["labels"] = self.tokenizer(batch["target_text"]).input_ids return batch ``` ### Expected behavior `map` to use cached copy and if possible an alternative technique to reduce memory usage after using `map` ### Environment info - `datasets` version: 2.12.0 - Platform: Linux-3.10.0-1160.71.1.el7.x86_64-x86_64-with-glibc2.17 - Python version: 3.8.16 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.2
57
`datasets.map` not reusing cached copy by default ### Describe the bug When I load the dataset from local directory, it's cached copy is picked up after first time. However, for `map` operation, the operation is applied again and cached copy is not picked up. Is there any way to pick cached copy instead of processing it again? The only solution I could think of was to use `save_to_disk` after my last transform and then use that in my DataLoader pipeline. Are there any other solutions for the same? One more thing, my dataset is occupying 6GB storage memory after I use `map`, is there any way I can reduce that memory usage? ### Steps to reproduce the bug ``` # make sure that dataset decodes audio with correct sampling rate dataset_sampling_rate = next(iter(self.raw_datasets.values())).features["audio"].sampling_rate if dataset_sampling_rate != self.feature_extractor.sampling_rate: self.raw_datasets = self.raw_datasets.cast_column( "audio", datasets.features.Audio(sampling_rate=self.feature_extractor.sampling_rate) ) vectorized_datasets = self.raw_datasets.map( self.prepare_dataset, remove_columns=next(iter(self.raw_datasets.values())).column_names, num_proc=self.num_workers, desc="preprocess datasets", ) # filter data that is longer than max_input_length self.vectorized_datasets = vectorized_datasets.filter( self.is_audio_in_length_range, num_proc=self.num_workers, input_columns=["input_length"], ) def prepare_dataset(self, batch): # load audio sample = batch["audio"] inputs = self.feature_extractor(sample["array"], sampling_rate=sample["sampling_rate"]) batch["input_values"] = inputs.input_values[0] batch["input_length"] = len(batch["input_values"]) batch["labels"] = self.tokenizer(batch["target_text"]).input_ids return batch ``` ### Expected behavior `map` to use cached copy and if possible an alternative technique to reduce memory usage after using `map` ### Environment info - `datasets` version: 2.12.0 - Platform: Linux-3.10.0-1160.71.1.el7.x86_64-x86_64-with-glibc2.17 - Python version: 3.8.16 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.2 This can happen when a map transform cannot be hashed deterministically (e.g., an object referenced by the transform changes its state after the first call - an issue with fast tokenizers). The solution is to provide `cache_file_name` in the `map` call to check this file for the cached result instead of relying on the default caching mechanism.
[ -0.3097192645072937, -0.046798959374427795, 0.03724795579910278, 0.1807716339826584, 0.309833824634552, -0.07924336194992065, 0.21164464950561523, 0.05735986307263374, 0.06278633326292038, 0.18938514590263367, 0.05401896685361862, 0.464792937040329, 0.017879262566566467, -0.1996036171913147, 0.04937329143285751, 0.16352897882461548, 0.10217159986495972, 0.2024029791355133, -0.27708926796913147, -0.15001234412193298, -0.25893643498420715, 0.18279162049293518, -0.4387824833393097, -0.25951087474823, -0.07707232236862183, 0.0875442698597908, -0.0036639422178268433, 0.0006153164431452751, -0.014743182808160782, -0.3020871579647064, 0.36941006779670715, 0.1945105642080307, 0.21050691604614258, 0.5431990027427673, -0.00012104683992220089, -0.059864774346351624, 0.2622944712638855, -0.15408006310462952, -0.05047900229692459, -0.0509212464094162, -0.2910847067832947, -0.0417201966047287, -0.10030537843704224, -0.19318687915802002, -0.061047449707984924, -0.01895103231072426, 0.03722734749317169, -0.6494283676147461, 0.3700261414051056, 0.10948619246482849, 0.091936394572258, 0.005308665335178375, -0.3678009510040283, 0.2045818716287613, -0.007108617573976517, 0.2412339150905609, -0.04182615503668785, 0.18783500790596008, 0.41188937425613403, -0.0198361836373806, -0.16174905002117157, 0.3705582916736603, -0.14178329706192017, 0.22353214025497437, 0.2821276783943176, 0.0560128316283226, -0.09213751554489136, -0.2547524571418762, 0.17024260759353638, 0.04142339527606964, 0.5247780680656433, -0.18328000605106354, -0.2675173878669739, -0.24416357278823853, -0.1837550699710846, -0.2319328486919403, 0.17048636078834534, -0.11803527176380157, -0.0039176344871521, 0.12711280584335327, -0.6741876006126404, -0.16710031032562256, 0.11888419091701508, 0.09874571114778519, 0.147285595536232, 0.033791135996580124, -0.11380428075790405, 0.11328084766864777, 0.4056187570095062, -0.09755490720272064, 0.3688276410102844, -0.22901667654514313, -0.10732080042362213, 0.38280099630355835, -0.22160406410694122, -0.014655299484729767, 0.11575854569673538, -0.12031034380197525, 0.013241678476333618, -0.06556084007024765, 0.18505176901817322, 0.18095943331718445, -0.003821905702352524, 0.07050885260105133, 0.3140118718147278, 0.39734286069869995, 0.02317495457828045, 0.4860427975654602, 0.33314645290374756, 0.027376588433980942, -0.4085884392261505, -0.13782788813114166, 0.13593566417694092, 0.0067436955869197845, 0.6103048920631409, 0.05290621891617775, 0.10994476079940796, -0.259893000125885, 0.1998719871044159, -0.0848378911614418, -0.0768798366189003, -0.22664746642112732, 0.2966422736644745, 0.22643864154815674, 0.23618145287036896, 0.344472736120224, -0.056969255208969116, -0.05336177721619606, -0.21356788277626038, -0.10543611645698547, -0.19255144894123077, -0.24412621557712555, -0.21818947792053223, 0.19902507960796356, 0.21068379282951355, 0.03667030856013298, 0.30188652873039246, -0.006638925522565842, 0.028734929859638214, -0.2263415902853012, 0.23326945304870605, 0.03563173860311508, 0.4336908757686615, 0.2775336503982544, -0.16755422949790955, 0.5079835653305054, 0.02632714807987213, 0.17664840817451477, -0.2481681853532791, 0.4693433940410614, -0.44715654850006104, -0.33123698830604553, 0.5129114389419556, 0.09217388927936554, -0.15927547216415405, 0.0031698960810899734, -0.4826178252696991, -0.06343501806259155, 0.46348583698272705, -0.32284045219421387, 0.0720948874950409, -0.18239760398864746, -0.40184086561203003, -0.26729103922843933, 0.16302832961082458, 0.5137261748313904, -0.24143631756305695, -0.24331602454185486, -0.29447588324546814, 0.057395100593566895, 0.4249899089336395, 0.2322234809398651, -0.2834711968898773, 0.25998011231422424, -0.37490758299827576, 0.22135303914546967, 0.45903873443603516, -0.5062571167945862, -0.753368616104126, 0.2594412565231323, -0.030096694827079773, 0.14269596338272095, -0.012279614806175232, 0.234272763133049, 0.19800716638565063, -0.114378422498703, -0.04581340029835701, 0.3829372823238373, -0.06435921788215637, 0.4106045365333557, -0.2495540976524353, -0.1342879682779312, 0.10570665448904037, -0.013144992291927338, -0.00213201018050313, 0.31286025047302246, -0.0763169378042221, 0.05802227184176445, 0.1701509654521942, -0.18115387856960297, 0.18344491720199585, 0.19331574440002441, 0.30811116099357605, -0.3167250156402588, 0.1170036792755127, -0.007132597267627716, -0.31653153896331787, 0.3316781520843506, -0.22987553477287292, -0.5340675115585327, 0.10855020582675934, -0.11211438477039337, 0.0011906810104846954, -0.09306582808494568, -0.5186878442764282, -0.09392718970775604, 0.019523538649082184, 0.2787216603755951, 0.07214538007974625, -0.1586730182170868, -0.040243931114673615, 0.056238383054733276, 0.0609116330742836, -0.08693225681781769, -0.41859859228134155, 0.05971260368824005, 0.16069230437278748, -0.05802086740732193, -0.2762744128704071, -0.07191023230552673, 0.3847249150276184, -0.2241685688495636, -0.3478180170059204, 0.5109984278678894, 0.18258653581142426, 0.6007528305053711, -0.2746031582355499, 0.11671587824821472, 0.22198690474033356, -0.002296842634677887, 0.04741797596216202, 0.19152125716209412, 0.07804800570011139, -0.16169755160808563, -0.11401194334030151, 0.1711570918560028, 0.038355544209480286, 0.19070935249328613, -0.05235324054956436, -0.03261525556445122, 0.16335229575634003, -0.023699775338172913, -0.08576865494251251, -0.16368646919727325, -0.0696742981672287, -0.0871056467294693, 0.4186973571777344, 0.28473415970802307, 0.09846694767475128, 0.23382969200611115, 0.6156541109085083, 0.15649501979351044, -0.030529387295246124, 0.10392867028713226, -0.29679977893829346, -0.19189384579658508, 0.1981959491968155, 0.5366181135177612, 0.4649312198162079, 0.03357918560504913, 0.43732815980911255, -0.15320096909999847, 0.20612666010856628, -0.043282292783260345, 0.1635587364435196, -0.09489484876394272, 0.16800299286842346, 0.15798507630825043, 0.11759620159864426, -0.010508783161640167, -0.30922722816467285, 0.27165281772613525, 0.28798338770866394, 0.13062137365341187, -0.16016075015068054, -0.1368238925933838, -0.5084555745124817, 0.14650921523571014, -0.18204917013645172, -0.1322859525680542, 0.06522311270236969, -0.1927230954170227, -0.15227410197257996, 0.4957914352416992, -0.0638984739780426, 0.2425079047679901, 0.10872354358434677, 0.0534723699092865, -0.09131753444671631, -0.43998175859451294, -0.15277253091335297, 0.037688806653022766, -0.18593107163906097, -0.14399069547653198, 0.17461861670017242, -0.30778029561042786, 0.08114415407180786, 0.1553286910057068, 0.029280826449394226, -0.19451308250427246, 0.008963897824287415, 0.01421157643198967, 0.3604288399219513, 0.18183280527591705, -0.2098882496356964, 0.0145959984511137, -0.10291212797164917, 0.003417596220970154, 0.11150653660297394, -0.28586068749427795, -0.16723176836967468, 0.08184057474136353, 0.016051623970270157, -0.004390142858028412, -0.20582231879234314, -0.28837430477142334, -0.1973593533039093, -0.3824303150177002, 0.092730313539505, -0.2292216271162033, 0.07453553378582001, 0.21314120292663574, -0.05954473838210106, -0.006171397864818573, 0.05270855873823166, -0.08596320450305939, -0.3736092150211334, -0.5717735886573792, 0.4167872965335846, -0.1375272125005722, -0.12901201844215393, -0.17344604432582855, -0.030224014073610306, 0.13678306341171265, 0.4979827404022217, -0.43725645542144775, -0.11282740533351898, -0.23679260909557343, 0.13280588388442993, 0.08902160078287125, 0.16092419624328613, 0.5689064264297485, 0.05074302852153778, 0.12172278761863708, -0.1913285255432129, -0.1359792798757553, 0.1093829870223999, 0.368409126996994, 0.2482527196407318, 0.2588399052619934, 0.2893071174621582, 0.01150510460138321, 0.8879991769790649, 0.34942615032196045, 0.04259509593248367, 0.36351579427719116, 0.07159069180488586, 0.12622877955436707, -0.13292695581912994, -0.2418321967124939, -0.19382448494434357, -0.15098363161087036, -0.1761305332183838, 0.17251120507717133, 0.132340669631958, -0.40417274832725525, 0.04454129934310913, -0.0643809586763382, -0.2746688723564148, -0.34449124336242676, 0.03462626785039902, -0.22052058577537537, 0.390389621257782, 0.18288445472717285, 0.0836750864982605, -0.3031073212623596, -0.03691714257001877, -0.001421075314283371, -0.2658623158931732, 0.44286805391311646, -0.00800817459821701, -0.49904659390449524, -0.24318385124206543, -0.4293108284473419, 0.14159253239631653, 0.044328488409519196, 0.5464727282524109, -0.09047559648752213, -0.1335269808769226, -0.060934584587812424, -0.015258975327014923, 0.5717036724090576, -0.3475782573223114, 0.14766883850097656, -0.004068508744239807, -0.1424591839313507, 0.15494805574417114, -0.1073429137468338, 0.11354653537273407, 0.37533313035964966, 0.06278596818447113, 0.23323190212249756, 0.11420661211013794, 0.014837905764579773, -0.15002229809761047, 0.3166889250278473, -0.31874537467956543, -0.10433031618595123, 0.04358236491680145, -0.13276787102222443, -0.0774478018283844, -0.07950767874717712, -0.033947549760341644, -0.10668373852968216, 0.08013312518596649, -0.19401507079601288, 0.06205836683511734, 0.0015060603618621826, 0.030142642557621002, 0.046695269644260406, 0.5344529747962952, 0.1867033839225769, 0.38556188344955444, 0.3748660087585449, -0.3815211355686188, 0.015431607142090797, 0.6136342287063599, -0.15631672739982605, 0.04783906415104866, -0.07284518331289291, -0.08598373830318451, 0.1695530116558075, 0.21943999826908112, -0.22120344638824463, -0.21039126813411713, 0.046567514538764954, -0.03234567865729332, -0.5109877586364746, -0.07665632665157318, 0.2060939520597458, 0.05379944294691086, -0.0005387179553508759, -0.45456263422966003, 0.4904540181159973, 0.18080592155456543, -0.28408676385879517, 0.6171923279762268, -0.42323213815689087, -0.32730138301849365, 0.3264784514904022, -0.0748031735420227, 0.6774613261222839, -0.1326802372932434, -0.014581788331270218, -0.1371680647134781, 0.14796540141105652, -0.04940943047404289, -0.20085470378398895, 0.20608419179916382, -0.13830547034740448, -0.2837792932987213, -0.005315821617841721, -0.14114096760749817, -0.004602542147040367, 0.4321211874485016, -0.2801400423049927, 0.3008381724357605, 0.10694964230060577, 0.2534267008304596, -0.08111266791820526, 0.038108959794044495, 0.14505399763584137, -0.4135318398475647, 0.19886091351509094, 0.07902546972036362, 0.0364539697766304, 0.18856552243232727, 0.1245129406452179, 0.03793216869235039, 0.14578351378440857, -0.24202632904052734, -0.12195158004760742, 0.02251148223876953, -0.36489999294281006, 0.2928708791732788, -0.09743721783161163, -0.019695773720741272, -0.11227765679359436, 0.3322599232196808, -0.04394014552235603, 0.11103732883930206, -0.14362797141075134, 0.09761437773704529, 0.3736281394958496, 0.4638083577156067, -0.08603668957948685, -0.017152927815914154, 0.11233260482549667, 0.1201796680688858, -0.10710369795560837, -0.2877867817878723, -0.06514547765254974, -0.26064974069595337, -0.236660897731781, 0.09810382127761841, 0.19362246990203857, -0.11340375244617462, -0.38064587116241455, 0.20856592059135437, -0.12996499240398407, 0.042956069111824036, 0.045230112969875336, 0.14362207055091858, -0.3073459565639496, 0.5926141738891602, -0.21232840418815613, -0.11237937957048416, 0.06011607125401497, 0.40072089433670044, 0.32492795586586, -0.09777072072029114, 0.3648267984390259, -0.2991604804992676, 0.016368292272090912, -0.10953965783119202, 0.16416673362255096, -0.09009906649589539, -0.08702896535396576, 0.1410016119480133, -0.2577797770500183, -0.04057253897190094, 0.08318397402763367, -0.13714304566383362, -0.17255739867687225, -0.08443771302700043, -0.4863394498825073, -0.20003773272037506, -0.4414212107658386, 0.0007989611476659775, 0.15027707815170288, 0.3062079846858978, -0.023642532527446747, -0.19871169328689575, 0.06801857799291611, 0.32251977920532227, -0.19681096076965332, 0.14714184403419495, 0.1949339658021927, 0.265481173992157, 0.08726022392511368, 0.13476251065731049, 0.14920362830162048, -0.20655496418476105, -0.08702678978443146, 0.1602935940027237, -0.30582794547080994, -0.1162242665886879, -0.031229138374328613, 0.1970469355583191, 0.036638692021369934, -0.1254192590713501, 0.005707006901502609, -0.25836181640625, 0.0573529452085495, -0.3805387020111084, -0.051197804510593414, 0.11626023054122925, 0.03746020048856735, 0.28171461820602417, 0.13694317638874054, -0.07194773107767105, 0.0557144433259964, 0.2756911516189575, -0.1896258145570755, -0.06994937360286713, 0.025324180722236633, 0.33236098289489746, 0.07714096456766129, -0.10073147714138031, -0.4251951575279236, -0.27430811524391174, 0.10670776665210724, -0.02434970811009407, 0.3490642011165619, -0.15677759051322937, 0.03871417045593262, 0.203192800283432, 0.3210761845111847, 0.2127210646867752, -0.3131808936595917, -0.04935026168823242, 0.06774719059467316, 0.14754973351955414, -0.18126815557479858, -0.3503319025039673, 0.3434165120124817, -0.02031271904706955, 0.05501566082239151, 0.23394043743610382, 0.27599042654037476, -0.06781545281410217, 0.3793640434741974, -0.02385570853948593, 0.5209119319915771, -0.4262561798095703, 0.4557700753211975, 0.18795931339263916, -0.08248651772737503, -0.012405861169099808, 0.1985279768705368, 0.21247351169586182, 0.07991675287485123, 0.35936239361763, -0.030566446483135223, 0.2840089499950409, 0.19132573902606964, 0.036000654101371765, -0.049344755709171295, -0.7505443096160889, 0.0682266503572464, 0.2700452208518982, -0.3014509081840515, 0.5969979763031006, 0.15239709615707397, 0.22139906883239746, -0.2711870074272156, -0.25492221117019653, -0.11768686771392822, 0.16815340518951416, -0.213567852973938, -0.3090776801109314, 0.2524817883968353, -0.07400505244731903, -0.1441807746887207, 0.019021980464458466, 0.0887390673160553, 0.05794991925358772, 0.490245521068573, 0.028075894340872765, -0.13365782797336578, -0.09989482164382935, -0.0613858662545681, -0.05772503837943077, 0.2601059079170227, -0.3803887963294983, 0.24548731744289398, -0.13965174555778503, -0.025041773915290833, -0.03249058127403259, 0.28177905082702637, 0.14309315383434296, 0.48431411385536194, -0.1598806083202362, 0.40413159132003784, 0.0774482786655426, -0.07680018991231918, -0.2696763277053833, 0.24219834804534912, -0.24553093314170837, -0.0766926258802414, 0.05175259709358215, 0.07096070051193237, -0.01990227773785591, 0.17275841534137726, 0.06253499537706375, 0.18953865766525269, -0.13810762763023376, 0.2718726396560669, 0.08858806639909744, -0.08493262529373169, 0.08292877674102783, -0.09859010577201843, -0.15921582281589508, -0.18024641275405884, 0.5014742612838745, -0.38777387142181396, 0.3016029894351959, -0.24658842384815216, 0.026204843074083328, -0.0017400849610567093, 0.24717378616333008, 0.10841133445501328, -0.16502276062965393, -0.303219199180603, -0.20638149976730347, -0.8849409818649292, -0.13880963623523712, -0.1354084014892578, 0.2566917836666107, 0.07133196294307709, 0.31926554441452026, -0.11484308540821075, -0.003243533428758383, 0.062287721782922745, -0.314180850982666, -0.10017319023609161, 0.23562176525592804, -0.1590803861618042, -0.3510594367980957, -0.12852708995342255, 0.0687534436583519, 0.10851815342903137, -0.7065408229827881, 0.3222554326057434, -0.07544086873531342, -0.026890214532613754, -0.012994050979614258, -0.05752570927143097, 0.0781109556555748, 0.2916634678840637, 0.495682030916214, 0.3014305830001831, 0.04721718281507492, -0.06496501713991165, 0.1853456199169159, -0.21155424416065216, -0.005408160388469696, -0.12568312883377075, -0.28825512528419495, -0.003630981780588627, 0.48109132051467896, -0.4190877676010132, -0.07116000354290009, -0.5542680621147156, -0.2653389275074005, 0.029882021248340607, -0.24723276495933533, -0.20583394169807434, -0.021216262131929398, -0.23725570738315582, 0.179615318775177, 0.04132326692342758, 0.3576950132846832, -0.1647423952817917, 0.25906553864479065, -0.36122626066207886, -0.21005716919898987, 0.38603711128234863, -0.4599204957485199, -0.19220876693725586, -0.09617640823125839, 0.15047720074653625, -0.1632319539785385, -0.017019692808389664, -0.5163983702659607, -0.07108944654464722, 0.4380512535572052, -0.20747095346450806, -0.04785586893558502, 0.28107836842536926, -0.102876216173172, 0.11522762477397919, -0.14453718066215515, 0.560615599155426, 0.14961759746074677, -0.24196240305900574, 0.22024430334568024, -0.2551497519016266 ]
https://github.com/huggingface/datasets/issues/5929
Hi! The times match when I run this code locally or on Colab. Also, we use `multiprocess`, not `multiprocessing`, for parallelization, and torch's `__init__.py` (executed on `import torch` ) slightly modifies the latter.
Importing PyTorch reduces multiprocessing performance for map
### Describe the bug I noticed that the performance of my dataset preprocessing with `map(...,num_proc=32)` decreases when PyTorch is imported. ### Steps to reproduce the bug I created two example scripts to reproduce this behavior: ``` import datasets datasets.disable_caching() from datasets import Dataset import time PROC=32 if __name__ == "__main__": dataset = [True] * 10000000 dataset = Dataset.from_dict({'train': dataset}) start = time.time() dataset.map(lambda x: x, num_proc=PROC) end = time.time() print(end - start) ``` Takes around 4 seconds on my machine. While the same code, but with an `import torch`: ``` import datasets datasets.disable_caching() from datasets import Dataset import time import torch PROC=32 if __name__ == "__main__": dataset = [True] * 10000000 dataset = Dataset.from_dict({'train': dataset}) start = time.time() dataset.map(lambda x: x, num_proc=PROC) end = time.time() print(end - start) ``` takes around 22 seconds. ### Expected behavior I would expect that the import of torch to not have such a significant effect on the performance of map using multiprocessing. ### Environment info - `datasets` version: 2.12.0 - Platform: Linux-5.15.0-56-generic-x86_64-with-glibc2.35 - Python version: 3.11.3 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.2 - torch: 2.0.1
33
Importing PyTorch reduces multiprocessing performance for map ### Describe the bug I noticed that the performance of my dataset preprocessing with `map(...,num_proc=32)` decreases when PyTorch is imported. ### Steps to reproduce the bug I created two example scripts to reproduce this behavior: ``` import datasets datasets.disable_caching() from datasets import Dataset import time PROC=32 if __name__ == "__main__": dataset = [True] * 10000000 dataset = Dataset.from_dict({'train': dataset}) start = time.time() dataset.map(lambda x: x, num_proc=PROC) end = time.time() print(end - start) ``` Takes around 4 seconds on my machine. While the same code, but with an `import torch`: ``` import datasets datasets.disable_caching() from datasets import Dataset import time import torch PROC=32 if __name__ == "__main__": dataset = [True] * 10000000 dataset = Dataset.from_dict({'train': dataset}) start = time.time() dataset.map(lambda x: x, num_proc=PROC) end = time.time() print(end - start) ``` takes around 22 seconds. ### Expected behavior I would expect that the import of torch to not have such a significant effect on the performance of map using multiprocessing. ### Environment info - `datasets` version: 2.12.0 - Platform: Linux-5.15.0-56-generic-x86_64-with-glibc2.35 - Python version: 3.11.3 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.2 - torch: 2.0.1 Hi! The times match when I run this code locally or on Colab. Also, we use `multiprocess`, not `multiprocessing`, for parallelization, and torch's `__init__.py` (executed on `import torch` ) slightly modifies the latter.
[ -0.38912785053253174, -0.4363754987716675, -0.05353597179055214, 0.27668696641921997, -0.03466309979557991, -0.05755573511123657, 0.3374318778514862, 0.05322837084531784, 0.24303850531578064, -0.0009959638118743896, 0.022196978330612183, 0.7091225385665894, -0.10803563892841339, -0.2934114933013916, -0.12480409443378448, -0.08390828222036362, 0.32947424054145813, -0.1870657056570053, -0.26129013299942017, 0.10814709961414337, -0.08739803731441498, 0.05367666482925415, -0.340568870306015, -0.1074933260679245, -0.41198012232780457, 0.18438097834587097, 0.025684811174869537, 0.18169309198856354, 0.19734740257263184, -0.2932824194431305, 0.11411356180906296, -0.010592224076390266, -0.005634821951389313, 0.608684778213501, -0.0001227214524988085, 0.04809414595365524, 0.10048502683639526, 0.1900549829006195, 0.27073630690574646, -0.004886828362941742, 0.35608747601509094, -0.4230835437774658, 0.25206202268600464, -0.13891950249671936, 0.04207981377840042, -0.015432696789503098, -0.18776364624500275, -0.6033356189727783, -0.18328063189983368, 0.23086629807949066, 0.09908595681190491, 0.6096090078353882, -0.18321317434310913, 0.2599983811378479, -0.04411795362830162, 0.05267482250928879, -0.16673794388771057, 0.12680864334106445, 0.4481992721557617, -0.06243239715695381, -0.27974700927734375, 0.31261712312698364, -0.36732929944992065, 0.283110111951828, 0.20223397016525269, -0.038497135043144226, -0.26131749153137207, -0.3654114007949829, 0.02561226114630699, -0.003053133375942707, -0.07644383609294891, -0.2443445920944214, -0.2118602693080902, -0.22463634610176086, -0.08432259410619736, -0.08620434254407883, 0.0885874480009079, 0.054971396923065186, -0.017837930470705032, -0.10604077577590942, -0.22359322011470795, 0.09534575045108795, 0.1011381670832634, -0.05522402003407478, -0.01847686618566513, 0.4153865873813629, 0.25547608733177185, 0.18912799656391144, 0.13442087173461914, 0.17896661162376404, 0.21786275506019592, -0.3906303644180298, 0.2162143886089325, 0.10209978371858597, -0.21517615020275116, 0.2259555459022522, 0.30632883310317993, -0.02512868121266365, -0.23940826952457428, -0.29045817255973816, 0.04173534736037254, 0.33020031452178955, 0.18977470695972443, 0.040600694715976715, 0.16160514950752258, 0.03627079352736473, -0.1426635980606079, 0.19193345308303833, 0.2303328514099121, -0.33671537041664124, -0.13948526978492737, 0.12824270129203796, 0.21741721034049988, -0.38287457823753357, 0.40026214718818665, 0.10666919499635696, 0.17209723591804504, -0.07595974206924438, -0.0989319384098053, -0.09702406823635101, -0.19159561395645142, -0.3395456075668335, 0.09482244402170181, 0.2277814745903015, -0.41874754428863525, 0.5660373568534851, -0.129489004611969, 0.07974011451005936, -0.3644865155220032, 0.051606204360723495, -0.1298883706331253, -0.005048919469118118, -0.31371021270751953, -0.0411313958466053, 0.1244722381234169, -0.14020776748657227, 0.14806707203388214, 0.3247305452823639, 0.3109215795993805, -0.1996605396270752, 0.23358654975891113, -0.24393168091773987, 0.2968263626098633, 0.1460740715265274, -0.05612145736813545, 0.16549324989318848, -0.021640537306666374, 0.608920693397522, -0.34881794452667236, 0.3290952742099762, -0.43532446026802063, -0.3218011260032654, -0.2317192256450653, 0.013971059583127499, -0.08371882140636444, 0.20730642974376678, -0.12068202346563339, -0.1317407786846161, 0.20323744416236877, -0.1314353346824646, 0.049375057220458984, -0.4791095554828644, -0.41975122690200806, -0.12949874997138977, 0.14941349625587463, 0.054477982223033905, 0.18838196992874146, -0.18015319108963013, 0.35606151819229126, 0.032416634261608124, 0.3566761016845703, 0.3094424605369568, -0.35400909185409546, 0.10597306489944458, 0.05029948800802231, -0.14869290590286255, 0.06957320868968964, -0.3987327814102173, -0.3640812039375305, 0.12413781136274338, -0.3217020630836487, 0.33407217264175415, 0.09179076552391052, 0.3400942087173462, 0.0014842040836811066, -0.040765490382909775, 0.3337664008140564, 0.27412909269332886, 0.08636875450611115, 0.45081984996795654, -0.24054887890815735, -0.09891201555728912, 0.232211634516716, 0.19832918047904968, 0.021678578108549118, -0.19328194856643677, -0.21141654253005981, -0.3063657283782959, 0.18628719449043274, -0.03331628441810608, -0.22000178694725037, 0.42635151743888855, -0.29606422781944275, -0.007181549444794655, -0.06610406190156937, -0.2646600604057312, -0.27953895926475525, 0.4082312285900116, -0.00044596195220947266, -0.0009515881538391113, -0.04596469923853874, -0.019971076399087906, 0.3152693510055542, 0.16460976004600525, -0.11086015403270721, -0.18457315862178802, -0.0918518453836441, 0.04502985626459122, 0.02830367535352707, -0.1792532503604889, 0.08372645080089569, 0.5602824091911316, 0.20079964399337769, -0.07547616958618164, -0.09113708883523941, -0.09089970588684082, -0.14544206857681274, -0.08239482343196869, -0.24143855273723602, 0.08109782636165619, 0.04272504150867462, -0.13543279469013214, -0.20094038546085358, 0.10778111219406128, 0.05166047066450119, 0.11393406987190247, -0.25528860092163086, -0.0518001914024353, 0.2857816219329834, -0.02530325949192047, 0.20543386042118073, 0.2341092973947525, 0.004451557993888855, -0.2466813623905182, 0.0425696074962616, 0.35455888509750366, 0.24248793721199036, 0.3512880802154541, -0.1709536612033844, -0.2038649022579193, 0.07275325059890747, 0.19307249784469604, 0.1259065568447113, 0.15458442270755768, 0.3146837651729584, 0.023821286857128143, 0.35868513584136963, 0.3224751055240631, -0.2462213635444641, 0.11889266967773438, 0.3276160955429077, 0.18320953845977783, -0.19137771427631378, 0.06272844225168228, -0.3597661256790161, -0.14288271963596344, 0.22190584242343903, -0.2336820662021637, 0.6195424795150757, 0.03741588070988655, 0.14168992638587952, -0.05544228106737137, -0.17647631466388702, -0.11074919998645782, 0.16020607948303223, 0.2324548363685608, 0.18353426456451416, 0.027947697788476944, 0.3175157308578491, 0.2143508791923523, 0.0724879801273346, -0.19971895217895508, -0.056941401213407516, -0.17069779336452484, -0.12711305916309357, 0.44943171739578247, -0.19579514861106873, 0.2436852902173996, -0.0006807111203670502, 0.05386894941329956, -0.15985286235809326, -0.08532341569662094, -0.16257677972316742, 0.37793174386024475, -0.009342581033706665, 0.1995888352394104, 0.07264958322048187, -0.3496267795562744, -0.1175294816493988, -0.8712022304534912, 0.12088136374950409, -0.2566685378551483, -0.06825118511915207, -0.11295665055513382, 0.14157003164291382, -0.004919040948152542, 0.3002592921257019, -0.07866908609867096, -0.013793669641017914, -0.23275716602802277, 0.032241687178611755, -0.00877409428358078, -0.051038242876529694, -0.1389331817626953, -0.1738572120666504, -0.33383262157440186, 0.09693486988544464, -0.10315315425395966, 0.0842837542295456, -0.3887671232223511, -0.09202384948730469, 0.036212123930454254, -0.10587084293365479, -0.11404228210449219, -0.03909227252006531, -0.17018480598926544, -0.222950741648674, -0.15307919681072235, 0.0520697720348835, -0.1341416835784912, 0.20774756371974945, -0.1808195561170578, 0.20493276417255402, 0.04496410861611366, 0.04390985518693924, 0.22567510604858398, 0.009201519191265106, -0.22898222506046295, 0.31461673974990845, -0.09647074341773987, -0.2982986867427826, -0.18919022381305695, 0.02401423454284668, -0.019543897360563278, 0.4252626299858093, -0.18191082775592804, -0.05112085118889809, -0.3198928236961365, 0.5936731696128845, -0.09722670167684555, 0.005220737308263779, 0.6836519241333008, 0.2076927125453949, -0.016427956521511078, 0.047092750668525696, -0.3492538034915924, -0.29181715846061707, 0.11597106605768204, -0.20252908766269684, -0.02247237041592598, 0.08794273436069489, -0.028696656227111816, 0.9550058841705322, -0.05287465453147888, -0.3152177631855011, 0.16387681663036346, -0.057340867817401886, 0.12212388217449188, -0.19025979936122894, -0.39813682436943054, -0.18577969074249268, -0.5699076056480408, 0.15251484513282776, 0.03730425983667374, -0.04659798741340637, -0.5522903800010681, -0.03816277161240578, -0.08077118545770645, 0.03025033324956894, -0.23866483569145203, 0.2725798785686493, -0.16653130948543549, 0.3100811243057251, 0.08548808842897415, 0.07761221379041672, -0.47500622272491455, -0.08814007043838501, 0.14306241273880005, -0.2917139530181885, 0.06391899287700653, -0.2871168553829193, -0.17799198627471924, -0.06016421690583229, -0.6152369976043701, 0.22749380767345428, 0.3758630156517029, 0.16881752014160156, 0.14718273282051086, -0.29151028394699097, 0.2192925214767456, -0.08618754148483276, 0.18557366728782654, 0.26433756947517395, -0.1383061408996582, 0.28903597593307495, -0.45295384526252747, -0.5288507342338562, -0.1171443983912468, -0.10053251683712006, 0.7688620090484619, 0.5404508113861084, 0.24743732810020447, -0.004064500331878662, -0.3526412844657898, 0.11238742619752884, 0.4306263327598572, 0.1749618947505951, -0.1209447979927063, -0.38068655133247375, -0.07051920890808105, -0.056631918996572495, 0.13629865646362305, 0.18096046149730682, 0.2427271157503128, -0.009571075439453125, 0.11602632701396942, -0.152380108833313, 0.020442165434360504, 0.19222374260425568, 0.05780099332332611, 0.09627774357795715, -0.13938631117343903, 0.33051252365112305, 0.00944296270608902, 0.10544010996818542, 0.07895535975694656, 0.3971298635005951, -0.06899775564670563, -0.20892322063446045, 0.017952434718608856, 0.027310874313116074, 0.14983394742012024, 0.16318941116333008, -0.019639017060399055, -0.04975632205605507, -0.3138815462589264, 0.16898079216480255, -0.3259629011154175, 0.014206532388925552, 0.4140297770500183, 0.23903632164001465, -0.21583548188209534, -0.10368680953979492, 0.2273121327161789, 0.4016018807888031, -0.2639307975769043, 0.6023703813552856, -0.5995965003967285, -0.040703315287828445, -0.07592737674713135, 0.3610742688179016, 0.6710864901542664, -0.18930402398109436, 0.3429027497768402, -0.11618246138095856, -0.26484614610671997, 0.07129374891519547, -0.08009908348321915, 0.1752510666847229, -0.1369055211544037, -0.24780374765396118, 0.1383233368396759, -0.2733312249183655, 0.23856544494628906, -0.019716281443834305, 0.19183321297168732, 0.24295343458652496, 0.021167993545532227, 0.07101716846227646, 0.03317567706108093, 0.2515498995780945, 0.22365133464336395, -0.4433920085430145, 0.3741393983364105, -0.0019094720482826233, 0.06636616587638855, 0.2732838988304138, 0.012639399617910385, 0.12859226763248444, -0.07548104226589203, -0.1973481923341751, -0.19425033032894135, -0.015976686030626297, -0.33329451084136963, 0.2603178322315216, -0.052637774497270584, -0.31574028730392456, 0.18634861707687378, 0.5951985716819763, -0.10075554251670837, -0.2725051939487457, 0.04932790994644165, 0.05161260440945625, 0.23019854724407196, 0.32266318798065186, 0.26643672585487366, -0.3438735008239746, -0.08523562550544739, -0.06815322488546371, -0.09615641087293625, -0.03398832678794861, -0.2544577717781067, -0.37768036127090454, 0.02095945179462433, 0.691598653793335, 0.14092880487442017, 0.15027493238449097, -0.22780542075634003, 0.23537729680538177, 0.16438065469264984, -0.1504073441028595, 0.03895457088947296, 0.1999032199382782, 0.09917844831943512, 0.581055223941803, -0.4239140450954437, -0.4726051688194275, -0.15252116322517395, 0.4262128472328186, 0.23350517451763153, -0.2060452252626419, 0.11558407545089722, -0.027393251657485962, -0.28645408153533936, -0.024281688034534454, 0.10189561545848846, -0.155015230178833, -0.3624698221683502, -0.0009537115693092346, -0.035795167088508606, -0.3460649251937866, -0.07165785133838654, -0.23394723236560822, -0.11678430438041687, 0.10909777879714966, -0.12610355019569397, 0.03354804217815399, -0.3739398717880249, -0.12436364591121674, 0.08417298644781113, -0.08721080422401428, 0.2436448484659195, -0.0655166357755661, -0.000507064163684845, 0.24006643891334534, -0.16981610655784607, 0.09933513402938843, 0.13023898005485535, 0.19745367765426636, 0.1322043240070343, 0.11630662530660629, 0.12007316946983337, -0.17232738435268402, 0.021114014089107513, 0.04533231630921364, 0.02651955559849739, -0.13385002315044403, -0.14498409628868103, 0.12972711026668549, -0.2890619933605194, -0.14560022950172424, 0.15746329724788666, -0.12073695659637451, 0.11801756918430328, -0.393399715423584, 0.18888986110687256, 0.4345405399799347, -0.09098516404628754, -0.034819912165403366, 0.22864270210266113, 0.0005156733095645905, -0.12032608687877655, 0.3349773585796356, -0.23640164732933044, 0.30706870555877686, -0.04756274074316025, 0.21265865862369537, 0.31949812173843384, 0.06062011420726776, 0.029823102056980133, -0.19077400863170624, 0.023545971140265465, 0.15796419978141785, 0.14481279253959656, -0.06496281921863556, -0.018786408007144928, 0.0597798153758049, 0.081660196185112, 0.1278628408908844, -0.19502776861190796, -0.11609679460525513, 0.0897398293018341, 0.07325995713472366, -0.1317022293806076, -0.6434579491615295, 0.24817538261413574, -0.08130461722612381, 0.25302231311798096, 0.23014727234840393, 0.23628805577754974, 0.48092496395111084, 0.4516223967075348, 0.09145009517669678, 0.08624813705682755, 0.024766549468040466, 0.17802640795707703, -0.008207578212022781, 0.1745299994945526, 0.17317797243595123, 0.3700415790081024, 0.13924339413642883, 0.1064079999923706, 0.25327956676483154, 0.2916213274002075, 0.621054470539093, 0.30939581990242004, 0.14549288153648376, -0.12828096747398376, -0.2555965781211853, 0.02200637385249138, -0.15192151069641113, -0.32697007060050964, 0.08644433319568634, 0.013081887736916542, 0.1702539026737213, -0.560791552066803, -0.43261831998825073, 0.02770421653985977, 0.2718156576156616, -0.12725920975208282, -0.09725571423768997, 0.42344796657562256, 0.23430049419403076, 0.20655548572540283, 0.1911323219537735, -0.05659932643175125, 0.16314926743507385, 0.6074237823486328, 0.287896990776062, -0.13411076366901398, -0.02764853462576866, -0.10182807594537735, -0.09200727939605713, 0.23663340508937836, 0.02013050764799118, -0.018459424376487732, -0.08327871561050415, -0.1033431738615036, -0.2800862789154053, 0.17324979603290558, 0.3859288990497589, 0.17383849620819092, -0.3577460050582886, 0.030169863253831863, -0.07900498062372208, 0.08431839197874069, -0.044174887239933014, 0.09864035248756409, -0.25205284357070923, 0.13321241736412048, 0.05232619121670723, -0.02118554338812828, -0.1774037629365921, -0.18759144842624664, 0.04566327482461929, 0.27761784195899963, -0.14148056507110596, 0.5679137706756592, -0.15453451871871948, -0.35931891202926636, 0.11982829868793488, 0.17175784707069397, -0.07667052745819092, -0.03717959672212601, 0.47107166051864624, -0.12305603921413422, -0.07485039532184601, -0.18613798916339874, 0.025860507041215897, 0.13081565499305725, 0.5397499799728394, 0.017980486154556274, 0.5144371390342712, -0.2692378759384155, -0.017444908618927002, -0.587524950504303, 0.08583114296197891, -0.3666922450065613, 0.15197962522506714, 0.1174468845129013, 0.021305397152900696, 0.0075356848537921906, 0.4226699769496918, 0.31994444131851196, -0.3767935037612915, 0.27869969606399536, 0.0315399095416069, -0.4186056852340698, 0.044892553240060806, -0.22471316158771515, 0.011200958862900734, 0.1862282156944275, -0.47609224915504456, 0.14142337441444397, -0.05959434434771538, 0.047415509819984436, -0.34559813141822815, -0.16386133432388306, 0.11993762850761414, 0.1475476324558258, 0.469310998916626, -0.014908055774867535, 0.2413703054189682, 0.06187323480844498, -0.052162036299705505, -0.004128986969590187, 0.2296510636806488, -0.02775821089744568, 0.05332264304161072, 0.05742330104112625, 0.09462222456932068, -0.3193131685256958, -0.3291367292404175, -0.17499510943889618, 0.510044276714325, 0.07076983153820038, -0.12448106706142426, -0.04249681532382965, 0.05383213609457016, 0.04444223642349243, 0.3027932941913605, -0.06911828368902206, 0.41861340403556824, 0.03330213204026222, 0.004070736467838287, -0.3906055688858032, -0.21173809468746185, 0.27587366104125977, -0.27736717462539673, -0.3113864064216614, -0.37504133582115173, 0.39570868015289307, -0.2046205997467041, 0.07848870009183884, -0.23850062489509583, -0.16890040040016174, 0.16553187370300293, 0.037503741681575775, -0.33454233407974243, 0.20963232219219208, -0.18031401932239532, -0.10495749861001968, -0.17082425951957703, 0.340423583984375, -0.2274688333272934, -0.11112463474273682, 0.005258820950984955, -0.16248589754104614 ]
https://github.com/huggingface/datasets/issues/5929
Hey Mariosasko, Thanks for looking into it. We further did some investigations after your comment and figured out it's only affecting some hardware/software configurations with the `pytorch` installation of `conda-forge`. Based on this we found the following issue in PyTorch: https://github.com/pytorch/pytorch/issues/102269 with a quick fix for now. Since it seems to be a deeper issue with forking processes, the difference between`multiprocess` and `multiprocessing` didn't make a difference. Closing this, since the issue comes from `pytorch` not `dataset`.
Importing PyTorch reduces multiprocessing performance for map
### Describe the bug I noticed that the performance of my dataset preprocessing with `map(...,num_proc=32)` decreases when PyTorch is imported. ### Steps to reproduce the bug I created two example scripts to reproduce this behavior: ``` import datasets datasets.disable_caching() from datasets import Dataset import time PROC=32 if __name__ == "__main__": dataset = [True] * 10000000 dataset = Dataset.from_dict({'train': dataset}) start = time.time() dataset.map(lambda x: x, num_proc=PROC) end = time.time() print(end - start) ``` Takes around 4 seconds on my machine. While the same code, but with an `import torch`: ``` import datasets datasets.disable_caching() from datasets import Dataset import time import torch PROC=32 if __name__ == "__main__": dataset = [True] * 10000000 dataset = Dataset.from_dict({'train': dataset}) start = time.time() dataset.map(lambda x: x, num_proc=PROC) end = time.time() print(end - start) ``` takes around 22 seconds. ### Expected behavior I would expect that the import of torch to not have such a significant effect on the performance of map using multiprocessing. ### Environment info - `datasets` version: 2.12.0 - Platform: Linux-5.15.0-56-generic-x86_64-with-glibc2.35 - Python version: 3.11.3 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.2 - torch: 2.0.1
77
Importing PyTorch reduces multiprocessing performance for map ### Describe the bug I noticed that the performance of my dataset preprocessing with `map(...,num_proc=32)` decreases when PyTorch is imported. ### Steps to reproduce the bug I created two example scripts to reproduce this behavior: ``` import datasets datasets.disable_caching() from datasets import Dataset import time PROC=32 if __name__ == "__main__": dataset = [True] * 10000000 dataset = Dataset.from_dict({'train': dataset}) start = time.time() dataset.map(lambda x: x, num_proc=PROC) end = time.time() print(end - start) ``` Takes around 4 seconds on my machine. While the same code, but with an `import torch`: ``` import datasets datasets.disable_caching() from datasets import Dataset import time import torch PROC=32 if __name__ == "__main__": dataset = [True] * 10000000 dataset = Dataset.from_dict({'train': dataset}) start = time.time() dataset.map(lambda x: x, num_proc=PROC) end = time.time() print(end - start) ``` takes around 22 seconds. ### Expected behavior I would expect that the import of torch to not have such a significant effect on the performance of map using multiprocessing. ### Environment info - `datasets` version: 2.12.0 - Platform: Linux-5.15.0-56-generic-x86_64-with-glibc2.35 - Python version: 3.11.3 - Huggingface_hub version: 0.15.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.2 - torch: 2.0.1 Hey Mariosasko, Thanks for looking into it. We further did some investigations after your comment and figured out it's only affecting some hardware/software configurations with the `pytorch` installation of `conda-forge`. Based on this we found the following issue in PyTorch: https://github.com/pytorch/pytorch/issues/102269 with a quick fix for now. Since it seems to be a deeper issue with forking processes, the difference between`multiprocess` and `multiprocessing` didn't make a difference. Closing this, since the issue comes from `pytorch` not `dataset`.
[ -0.3842312693595886, -0.4190558195114136, -0.06506878137588501, 0.25460851192474365, 0.016989463940262794, -0.07231605798006058, 0.3079421818256378, 0.10683570802211761, 0.26538482308387756, -0.005690142512321472, 0.0011331140995025635, 0.7020175457000732, -0.11789332330226898, -0.23182722926139832, -0.11075431108474731, -0.11543478071689606, 0.30880120396614075, -0.1942729949951172, -0.29628536105155945, 0.14023330807685852, -0.13489288091659546, 0.013506541028618813, -0.32646462321281433, -0.10779507458209991, -0.41077274084091187, 0.18333935737609863, 0.03313179314136505, 0.161432147026062, 0.19009630382061005, -0.33870235085487366, 0.09374289959669113, 0.02811509743332863, -0.05277061462402344, 0.5912824869155884, -0.00011763830843847245, 0.061630524694919586, 0.08837051689624786, 0.23621322214603424, 0.22760844230651855, -0.005453884601593018, 0.3682423233985901, -0.4247487485408783, 0.21783897280693054, -0.09698901325464249, 0.08297158777713776, -0.06063169986009598, -0.18652468919754028, -0.5784481763839722, -0.15543153882026672, 0.211416557431221, 0.14556168019771576, 0.6263747215270996, -0.10950648039579391, 0.22307828068733215, -0.061465006321668625, 0.01954306662082672, -0.16087497770786285, 0.08302070200443268, 0.4634438157081604, -0.07872740179300308, -0.3123416602611542, 0.349304735660553, -0.3202213644981384, 0.2793450951576233, 0.20320260524749756, -0.11067521572113037, -0.24498021602630615, -0.40053027868270874, 0.009620141237974167, 0.06268903613090515, -0.05458064749836922, -0.23078984022140503, -0.21350109577178955, -0.19815218448638916, -0.04057461395859718, -0.09563572704792023, 0.08115413784980774, 0.05012821406126022, -0.03122881054878235, -0.11574947088956833, -0.2233881950378418, 0.029768772423267365, 0.07156849652528763, -0.06140512973070145, -0.052987098693847656, 0.40162017941474915, 0.22786520421504974, 0.16348537802696228, 0.1891457438468933, 0.1393911987543106, 0.17859219014644623, -0.3143773078918457, 0.18424972891807556, 0.05086642503738403, -0.29581356048583984, 0.21280443668365479, 0.3195476233959198, -0.10535234212875366, -0.2400551438331604, -0.28037598729133606, 0.048840466886758804, 0.4120669364929199, 0.18812772631645203, 0.06443898379802704, 0.18351195752620697, -0.014030441641807556, -0.13698464632034302, 0.14561620354652405, 0.2613723874092102, -0.3594793379306793, -0.10426558554172516, 0.102068692445755, 0.25702643394470215, -0.4197608232498169, 0.40959930419921875, 0.0857997015118599, 0.15328353643417358, -0.07283318042755127, -0.04904450103640556, -0.12502719461917877, -0.1992325335741043, -0.3001445531845093, 0.09540529549121857, 0.23659881949424744, -0.3212170898914337, 0.5983326435089111, -0.09754931926727295, 0.0678957998752594, -0.3375469148159027, 0.06781899929046631, -0.1435786783695221, -0.05667361244559288, -0.28513920307159424, -0.03267154097557068, 0.15579402446746826, -0.15909266471862793, 0.13381826877593994, 0.35524967312812805, 0.3542741537094116, -0.217127725481987, 0.2579393982887268, -0.20172059535980225, 0.25598886609077454, 0.20111194252967834, -0.057423852384090424, 0.10856542736291885, -0.0399961844086647, 0.6268259286880493, -0.3279625177383423, 0.2841881513595581, -0.40569764375686646, -0.31204715371131897, -0.26418378949165344, 0.057049985975027084, -0.04258525371551514, 0.18486249446868896, -0.10345995426177979, -0.11611316353082657, 0.14405934512615204, -0.07034789770841599, 0.0312778502702713, -0.5163915157318115, -0.38156959414482117, -0.09087830781936646, 0.13897156715393066, 0.004238933324813843, 0.23395198583602905, -0.17687144875526428, 0.32834893465042114, 0.017245493829250336, 0.2678922414779663, 0.2840510904788971, -0.3666760325431824, 0.061994798481464386, 0.07548032701015472, -0.12736400961875916, 0.0688982829451561, -0.3331823945045471, -0.34106016159057617, 0.12388700246810913, -0.28598225116729736, 0.313975989818573, 0.06479594856500626, 0.3454040288925171, -0.001948714256286621, -0.05728995054960251, 0.26468586921691895, 0.2842348515987396, 0.10219917446374893, 0.4420147240161896, -0.22148486971855164, -0.08699274063110352, 0.19986490905284882, 0.2525620460510254, 0.015622749924659729, -0.22246673703193665, -0.26247695088386536, -0.3222641944885254, 0.1761440485715866, -0.09144799411296844, -0.20005609095096588, 0.4408126771450043, -0.28636372089385986, -0.01663224771618843, -0.060010846704244614, -0.3309994637966156, -0.32071244716644287, 0.4241194427013397, -0.039602942764759064, -0.018807513639330864, -0.04682265222072601, 0.012538589537143707, 0.3899214267730713, 0.1548265814781189, -0.10900196433067322, -0.17432811856269836, -0.04237052798271179, 0.011982928961515427, 0.012418560683727264, -0.1782504916191101, 0.028199434280395508, 0.5093284845352173, 0.1669495701789856, -0.06185365095734596, -0.09471198916435242, -0.09930037707090378, -0.12998679280281067, -0.02307489700615406, -0.23009222745895386, 0.08629095554351807, 0.008936096914112568, -0.10642731189727783, -0.19111406803131104, 0.15616823732852936, 0.07674180716276169, 0.07584917545318604, -0.21183376014232635, 0.00200711190700531, 0.2710523009300232, -0.05273779109120369, 0.22502876818180084, 0.23355863988399506, -0.022614510729908943, -0.2636265754699707, 0.0158432237803936, 0.3517078459262848, 0.2579689919948578, 0.3551969528198242, -0.16884544491767883, -0.11582714319229126, 0.08372227102518082, 0.19975465536117554, 0.11759329587221146, 0.13685736060142517, 0.2709352970123291, 0.015225201845169067, 0.33095353841781616, 0.30164432525634766, -0.26198655366897583, 0.06581896543502808, 0.2910180985927582, 0.1646604984998703, -0.16136278212070465, 0.12653322517871857, -0.39822709560394287, -0.14640748500823975, 0.13263018429279327, -0.21799400448799133, 0.588129460811615, 0.06312451511621475, 0.11150085180997849, -0.05271933972835541, -0.19212374091148376, -0.11754041910171509, 0.18742507696151733, 0.2297852337360382, 0.16150493919849396, 0.016304530203342438, 0.3049250543117523, 0.1622617542743683, 0.060778938233852386, -0.17360782623291016, -0.0382668599486351, -0.1311819702386856, -0.09183590114116669, 0.4163548946380615, -0.18459372222423553, 0.22801479697227478, -0.005452318117022514, 0.07192324101924896, -0.2408050298690796, -0.12140093743801117, -0.1621195673942566, 0.3536481559276581, -0.0417688749730587, 0.2278558313846588, 0.06332658231258392, -0.32217052578926086, -0.06890714913606644, -0.7709740400314331, 0.11348545551300049, -0.2688446044921875, -0.05245254933834076, -0.08571068942546844, 0.18443363904953003, -0.005084715783596039, 0.309754341840744, -0.020548410713672638, -0.021266676485538483, -0.2724926471710205, 0.007422596216201782, -0.044756557792425156, -0.05550582334399223, -0.16648666560649872, -0.15492208302021027, -0.31887826323509216, 0.13659244775772095, -0.09691893309354782, 0.10688992589712143, -0.3769274055957794, -0.06312546879053116, 0.11030948162078857, -0.11895497143268585, -0.09265711158514023, -0.07409792393445969, -0.19952282309532166, -0.19430910050868988, -0.1944786012172699, 0.08016228675842285, -0.14688235521316528, 0.20413854718208313, -0.13801449537277222, 0.20630890130996704, 0.040929656475782394, 0.006377052515745163, 0.19338178634643555, 0.02263665199279785, -0.21691402792930603, 0.2886476218700409, -0.11987762153148651, -0.3185597062110901, -0.18630993366241455, 0.07158207148313522, 0.007584581151604652, 0.4284087121486664, -0.216495081782341, -0.057806532829999924, -0.34078511595726013, 0.5596916079521179, -0.11203023791313171, -0.0012064632028341293, 0.6730290651321411, 0.23135560750961304, -0.06974716484546661, 0.0406809076666832, -0.3152039647102356, -0.28974461555480957, 0.13325506448745728, -0.21573039889335632, -0.02821642905473709, 0.03650349751114845, -0.0007741227746009827, 0.8916971683502197, -0.05049961060285568, -0.29985934495925903, 0.12278255820274353, -0.010991246439516544, 0.13431349396705627, -0.20105291903018951, -0.40165993571281433, -0.17833828926086426, -0.6139928698539734, 0.2206340730190277, 0.01397031545639038, -0.04905564337968826, -0.5759798884391785, -0.009133949875831604, -0.049105219542980194, 0.12911203503608704, -0.2302626222372055, 0.3234083354473114, -0.1950187236070633, 0.33404970169067383, 0.05886572599411011, 0.06540998816490173, -0.46465200185775757, -0.07433375716209412, 0.16897398233413696, -0.3357516825199127, 0.05938452482223511, -0.3345017433166504, -0.2268354892730713, -0.030366189777851105, -0.5562558770179749, 0.23158708214759827, 0.36368751525878906, 0.18168339133262634, 0.14846983551979065, -0.29867079854011536, 0.20960532128810883, -0.06788567453622818, 0.15838593244552612, 0.24588322639465332, -0.16896606981754303, 0.31832146644592285, -0.4804256558418274, -0.5240616798400879, -0.07653569430112839, -0.13533809781074524, 0.7259318232536316, 0.5388087034225464, 0.2674604058265686, -0.02119947224855423, -0.37543874979019165, 0.13646967709064484, 0.4260232746601105, 0.16153930127620697, -0.12927421927452087, -0.374671995639801, -0.03894960507750511, -0.03494950383901596, 0.12322428822517395, 0.1447731852531433, 0.23735812306404114, -0.002261929214000702, 0.1424648016691208, -0.1390942633152008, -0.004037767648696899, 0.1397227644920349, 0.07016432285308838, 0.058576930314302444, -0.13673943281173706, 0.33462926745414734, 0.08253241330385208, 0.09187346696853638, 0.08639927953481674, 0.3683132529258728, -0.09589493274688721, -0.21463899314403534, 0.017113909125328064, 0.030064623802900314, 0.16024844348430634, 0.15774554014205933, 0.0007024481892585754, -0.006411146372556686, -0.3012911379337311, 0.1976311355829239, -0.3796122670173645, 0.00188455730676651, 0.448045939207077, 0.23053470253944397, -0.21377047896385193, -0.10245825350284576, 0.2336898148059845, 0.3417017459869385, -0.2436012327671051, 0.6123666167259216, -0.5634170770645142, -0.039146196097135544, -0.06487808376550674, 0.3941568434238434, 0.6347044706344604, -0.21475288271903992, 0.3546554446220398, -0.13487450778484344, -0.2701227366924286, 0.03978292644023895, -0.07729313522577286, 0.21157893538475037, -0.13304637372493744, -0.2822892367839813, 0.16253498196601868, -0.26759132742881775, 0.2632221579551697, -0.04570775106549263, 0.20867323875427246, 0.21403487026691437, 0.003783807158470154, 0.06827722489833832, 0.029613368213176727, 0.28035086393356323, 0.20691925287246704, -0.48866263031959534, 0.39487582445144653, 0.0563458688557148, 0.053963594138622284, 0.21027010679244995, 0.04303461313247681, 0.10324746370315552, 0.01976899802684784, -0.17147493362426758, -0.24524065852165222, -0.036515507847070694, -0.2828308343887329, 0.2814599573612213, -0.016123997047543526, -0.24245384335517883, 0.23883238434791565, 0.540283203125, -0.14946381747722626, -0.22413671016693115, 0.012134328484535217, 0.110452800989151, 0.23812152445316315, 0.3282053470611572, 0.2900829613208771, -0.3178138732910156, -0.07554659992456436, -0.06332316249608994, -0.09423326700925827, 0.025089353322982788, -0.21128946542739868, -0.384826123714447, -0.018911734223365784, 0.6451441645622253, 0.1381845474243164, 0.14051346480846405, -0.16956739127635956, 0.2635914087295532, 0.16329827904701233, -0.1728842705488205, 0.0883500948548317, 0.19081129133701324, 0.05936639755964279, 0.6027625203132629, -0.43626707792282104, -0.4651700258255005, -0.1628390997648239, 0.4395195543766022, 0.18682295083999634, -0.2342274785041809, 0.14257366955280304, 0.03841441124677658, -0.27309155464172363, -0.07538226246833801, 0.13187310099601746, -0.13123682141304016, -0.3578130900859833, 0.005176808685064316, 0.0014950446784496307, -0.34152108430862427, -0.05068574845790863, -0.24738648533821106, -0.16397057473659515, 0.06199650093913078, -0.14514972269535065, 0.048906534910202026, -0.3499699831008911, -0.15635156631469727, 0.09449560940265656, -0.031103670597076416, 0.13848143815994263, -0.0799175351858139, -0.029191795736551285, 0.2793042063713074, -0.2218770682811737, 0.07596660405397415, 0.11297709494829178, 0.173626109957695, 0.1077914834022522, 0.08770431578159332, 0.13612855970859528, -0.17387616634368896, 0.08208370953798294, 0.04073739051818848, -0.004760324954986572, -0.17731784284114838, -0.16765186190605164, 0.08794032037258148, -0.31021448969841003, -0.1889391839504242, 0.18995915353298187, -0.10748788714408875, 0.08461975306272507, -0.3853607773780823, 0.1808057278394699, 0.43079662322998047, -0.11301983147859573, 0.03769717738032341, 0.2176319807767868, -0.035491522401571274, -0.07451143860816956, 0.34779998660087585, -0.2561613917350769, 0.2973581552505493, -0.07383875548839569, 0.18560826778411865, 0.28464967012405396, 0.04202234745025635, -0.008075226098299026, -0.1425001174211502, -0.01456156000494957, 0.12625503540039062, 0.18470385670661926, -0.031870946288108826, -0.02930746227502823, 0.07167042791843414, 0.11453275382518768, 0.18161006271839142, -0.19934678077697754, -0.1130446121096611, 0.08025634288787842, 0.1288265883922577, -0.12329193204641342, -0.6569594144821167, 0.17972047626972198, -0.08981934189796448, 0.26561063528060913, 0.1884152889251709, 0.22276201844215393, 0.4475044012069702, 0.4806917905807495, 0.09562621265649796, 0.05367060750722885, -0.06034533679485321, 0.16412635147571564, 0.017953962087631226, 0.19092980027198792, 0.08684898167848587, 0.358048677444458, 0.14891430735588074, 0.16393011808395386, 0.27408021688461304, 0.27013203501701355, 0.5688855648040771, 0.31792208552360535, 0.09657846391201019, -0.08927616477012634, -0.2248304784297943, 0.008463848382234573, -0.10310249775648117, -0.3498827815055847, 0.10314382612705231, -0.00866222009062767, 0.15440084040164948, -0.5726430416107178, -0.45506060123443604, 0.013974800705909729, 0.2965838313102722, -0.1196407675743103, -0.07757969945669174, 0.3889392614364624, 0.2358814775943756, 0.19540444016456604, 0.21821051836013794, -0.03640257939696312, 0.1103215217590332, 0.594135046005249, 0.3276582360267639, -0.16252265870571136, -0.06269529461860657, -0.1419711858034134, -0.09843859076499939, 0.22461487352848053, -0.0034904852509498596, -0.057303883135318756, 0.00912800058722496, -0.12404286861419678, -0.2456577718257904, 0.22176389396190643, 0.36849677562713623, 0.1638665795326233, -0.4215240478515625, 0.06610187888145447, -0.10198796540498734, 0.10243351757526398, -0.007384363561868668, 0.10199734568595886, -0.24368540942668915, 0.13168485462665558, 0.06004450097680092, 0.01442011445760727, -0.18579550087451935, -0.21678844094276428, 0.0021841740235686302, 0.3177189826965332, -0.16411857306957245, 0.5866031050682068, -0.09282872825860977, -0.3587164282798767, 0.1052323579788208, 0.17297938466072083, -0.10011427104473114, -0.09924571216106415, 0.5128940343856812, -0.08784382045269012, -0.11660762131214142, -0.1852351725101471, 0.053437210619449615, 0.1408325582742691, 0.6047966480255127, 0.039293598383665085, 0.4495299458503723, -0.2453632950782776, -0.005678847432136536, -0.5463719964027405, 0.03421133756637573, -0.33331361413002014, 0.14369618892669678, 0.12243134528398514, 0.02734450250864029, 0.03188495710492134, 0.3908598721027374, 0.29487094283103943, -0.39340677857398987, 0.26408812403678894, 0.03304643929004669, -0.44385865330696106, 0.08350478112697601, -0.20116543769836426, 0.047029562294483185, 0.18058663606643677, -0.46383413672447205, 0.15178048610687256, -0.04340830817818642, 0.08194402605295181, -0.3489178419113159, -0.1250966191291809, 0.15425102412700653, 0.16722789406776428, 0.41152679920196533, -0.01131077203899622, 0.2229103147983551, 0.10867614299058914, -0.1080840677022934, 0.010391328483819962, 0.20527273416519165, -0.043146029114723206, -0.012278996407985687, 0.07229229807853699, 0.1205696314573288, -0.31190335750579834, -0.35464975237846375, -0.1977628767490387, 0.5019510984420776, 0.01539495587348938, -0.12858372926712036, -0.064959317445755, 0.03783547878265381, 0.09812825918197632, 0.3094906508922577, -0.042335446923971176, 0.43173596262931824, 0.03726406767964363, -0.04183816909790039, -0.3938644528388977, -0.21355992555618286, 0.2758973240852356, -0.23989315330982208, -0.3447035551071167, -0.36019015312194824, 0.4127122163772583, -0.2289685755968094, 0.06863700598478317, -0.27586764097213745, -0.15361225605010986, 0.1482384353876114, 0.03945862129330635, -0.352286159992218, 0.21032065153121948, -0.17575612664222717, -0.1557471752166748, -0.16105049848556519, 0.31786155700683594, -0.1993897259235382, -0.10983133316040039, 0.006147764623165131, -0.10876865684986115 ]
https://github.com/huggingface/datasets/issues/5927
Easy fix would be to add: ```python null_indices -= np.arange(len(null_indices)) ``` before L279, but I'm not sure it's the most intuitive way to fix it.
`IndexError` when indexing `Sequence` of `Array2D` with `None` values
### Describe the bug Having `None` values in a `Sequence` of `ArrayND` fails. ### Steps to reproduce the bug ```python from datasets import Array2D, Dataset, Features, Sequence data = [ [ [[0]], None, None, ] ] feature = Sequence(Array2D((1, 1), dtype="int64")) dataset = Dataset.from_dict({"a": data}, features=Features({"a": feature})) dataset[0] # error raised only when indexing ``` ``` Traceback (most recent call last): File "/Users/quentingallouedec/gia/c.py", line 13, in <module> dataset[0] # error raised only when indexing File "/Users/quentingallouedec/gia/env/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2658, in __getitem__ return self._getitem(key) File "/Users/quentingallouedec/gia/env/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2643, in _getitem formatted_output = format_table( File "/Users/quentingallouedec/gia/env/lib/python3.10/site-packages/datasets/formatting/formatting.py", line 634, in format_table return formatter(pa_table, query_type=query_type) File "/Users/quentingallouedec/gia/env/lib/python3.10/site-packages/datasets/formatting/formatting.py", line 406, in __call__ return self.format_row(pa_table) File "/Users/quentingallouedec/gia/env/lib/python3.10/site-packages/datasets/formatting/formatting.py", line 441, in format_row row = self.python_arrow_extractor().extract_row(pa_table) File "/Users/quentingallouedec/gia/env/lib/python3.10/site-packages/datasets/formatting/formatting.py", line 144, in extract_row return _unnest(pa_table.to_pydict()) File "pyarrow/table.pxi", line 4146, in pyarrow.lib.Table.to_pydict File "pyarrow/table.pxi", line 1312, in pyarrow.lib.ChunkedArray.to_pylist File "pyarrow/array.pxi", line 1521, in pyarrow.lib.Array.to_pylist File "pyarrow/scalar.pxi", line 675, in pyarrow.lib.ListScalar.as_py File "/Users/quentingallouedec/gia/env/lib/python3.10/site-packages/datasets/features/features.py", line 760, in to_pylist return self.to_numpy(zero_copy_only=zero_copy_only).tolist() File "/Users/quentingallouedec/gia/env/lib/python3.10/site-packages/datasets/features/features.py", line 725, in to_numpy numpy_arr = np.insert(numpy_arr.astype(np.float64), null_indices, np.nan, axis=0) File "<__array_function__ internals>", line 200, in insert File "/Users/quentingallouedec/gia/env/lib/python3.10/site-packages/numpy/lib/function_base.py", line 5426, in insert old_mask[indices] = False IndexError: index 3 is out of bounds for axis 0 with size 3 ``` AFAIK, the problem only occurs when you use a `Sequence` of `ArrayND`. I strongly suspect that the problem comes from this line, or `np.insert` is misused: https://github.com/huggingface/datasets/blob/02ee418831aba68d0be93227bce8b3f42ef8980f/src/datasets/features/features.py#L729 To put t simply, you want something that do that: ```python import numpy as np numpy_arr = np.zeros((1, 1, 1)) null_indices = np.array([1, 2]) np.insert(numpy_arr, null_indices, np.nan, axis=0) # raise an error, instead of outputting # array([[[ 0.]], # [[nan]], # [[nan]]]) ``` ### Expected behavior The previous code should not raise an error. ### Environment info - Python 3.10.11 - datasets 2.10.0 - pyarrow 12.0.0
25
`IndexError` when indexing `Sequence` of `Array2D` with `None` values ### Describe the bug Having `None` values in a `Sequence` of `ArrayND` fails. ### Steps to reproduce the bug ```python from datasets import Array2D, Dataset, Features, Sequence data = [ [ [[0]], None, None, ] ] feature = Sequence(Array2D((1, 1), dtype="int64")) dataset = Dataset.from_dict({"a": data}, features=Features({"a": feature})) dataset[0] # error raised only when indexing ``` ``` Traceback (most recent call last): File "/Users/quentingallouedec/gia/c.py", line 13, in <module> dataset[0] # error raised only when indexing File "/Users/quentingallouedec/gia/env/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2658, in __getitem__ return self._getitem(key) File "/Users/quentingallouedec/gia/env/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 2643, in _getitem formatted_output = format_table( File "/Users/quentingallouedec/gia/env/lib/python3.10/site-packages/datasets/formatting/formatting.py", line 634, in format_table return formatter(pa_table, query_type=query_type) File "/Users/quentingallouedec/gia/env/lib/python3.10/site-packages/datasets/formatting/formatting.py", line 406, in __call__ return self.format_row(pa_table) File "/Users/quentingallouedec/gia/env/lib/python3.10/site-packages/datasets/formatting/formatting.py", line 441, in format_row row = self.python_arrow_extractor().extract_row(pa_table) File "/Users/quentingallouedec/gia/env/lib/python3.10/site-packages/datasets/formatting/formatting.py", line 144, in extract_row return _unnest(pa_table.to_pydict()) File "pyarrow/table.pxi", line 4146, in pyarrow.lib.Table.to_pydict File "pyarrow/table.pxi", line 1312, in pyarrow.lib.ChunkedArray.to_pylist File "pyarrow/array.pxi", line 1521, in pyarrow.lib.Array.to_pylist File "pyarrow/scalar.pxi", line 675, in pyarrow.lib.ListScalar.as_py File "/Users/quentingallouedec/gia/env/lib/python3.10/site-packages/datasets/features/features.py", line 760, in to_pylist return self.to_numpy(zero_copy_only=zero_copy_only).tolist() File "/Users/quentingallouedec/gia/env/lib/python3.10/site-packages/datasets/features/features.py", line 725, in to_numpy numpy_arr = np.insert(numpy_arr.astype(np.float64), null_indices, np.nan, axis=0) File "<__array_function__ internals>", line 200, in insert File "/Users/quentingallouedec/gia/env/lib/python3.10/site-packages/numpy/lib/function_base.py", line 5426, in insert old_mask[indices] = False IndexError: index 3 is out of bounds for axis 0 with size 3 ``` AFAIK, the problem only occurs when you use a `Sequence` of `ArrayND`. I strongly suspect that the problem comes from this line, or `np.insert` is misused: https://github.com/huggingface/datasets/blob/02ee418831aba68d0be93227bce8b3f42ef8980f/src/datasets/features/features.py#L729 To put t simply, you want something that do that: ```python import numpy as np numpy_arr = np.zeros((1, 1, 1)) null_indices = np.array([1, 2]) np.insert(numpy_arr, null_indices, np.nan, axis=0) # raise an error, instead of outputting # array([[[ 0.]], # [[nan]], # [[nan]]]) ``` ### Expected behavior The previous code should not raise an error. ### Environment info - Python 3.10.11 - datasets 2.10.0 - pyarrow 12.0.0 Easy fix would be to add: ```python null_indices -= np.arange(len(null_indices)) ``` before L279, but I'm not sure it's the most intuitive way to fix it.
[ 0.07399076223373413, -0.09210389852523804, -0.20227259397506714, 0.2803235650062561, 0.09471626579761505, 0.08701851218938828, 0.4704388678073883, 0.2795632481575012, 0.11865653097629547, 0.1826413869857788, -0.0019682087004184723, 0.1382116973400116, -0.3078857362270355, -0.014532994478940964, -0.2770649790763855, -0.14994055032730103, -0.030056238174438477, 0.4417455494403839, 0.07971195131540298, 0.18658730387687683, -0.1833534836769104, 0.09351030737161636, -0.5314512252807617, 0.12037584185600281, -0.3110036849975586, -0.10606618970632553, -0.09916284680366516, 0.02545027807354927, 0.23014700412750244, -0.7382034659385681, 0.28446805477142334, -0.27659061551094055, 0.07375413179397583, 0.3931537866592407, -0.00010836929141078144, 0.06712455302476883, 0.574797511100769, -0.06518994271755219, -0.16004502773284912, -0.10740430653095245, -0.13217511773109436, -0.08159485459327698, 0.14534950256347656, -0.4604998826980591, -0.08568917214870453, -0.473827064037323, -0.18511536717414856, -0.24756108224391937, 0.19633328914642334, 0.1145472377538681, 0.27650725841522217, 0.1705607771873474, 0.2482270896434784, -0.144295334815979, 0.20259657502174377, 0.10814429819583893, 0.0769374892115593, -0.10580228269100189, 0.06557819247245789, 0.0932660922408104, 0.20272542536258698, 0.3060127794742584, -0.41951999068260193, 0.0671948492527008, 0.1762586086988449, 0.08698736131191254, 0.07910710573196411, -0.19779391586780548, 0.012253765016794205, 0.1668039858341217, 0.31318435072898865, -0.1457439363002777, -0.1742473542690277, -0.1369355171918869, 0.12284588813781738, -0.30735811591148376, 0.13274046778678894, -0.05315268412232399, -0.037165507674217224, 0.19122479856014252, 0.12119360268115997, 0.12479344755411148, -0.21352288126945496, 0.11785019934177399, -0.15422537922859192, 0.4408312141895294, -0.1628677248954773, -0.047870613634586334, -0.06291013956069946, -0.41524001955986023, -0.0954480916261673, 0.08131734281778336, -0.005722383037209511, 0.09194927662611008, -0.29532289505004883, -0.09375692158937454, 0.16170962154865265, -0.6608651876449585, -0.20711994171142578, 0.1056690588593483, -0.054618969559669495, 0.0026806332170963287, 0.11323584616184235, 0.08267782628536224, -0.11549795418977737, 0.14908547699451447, 0.20928025245666504, 0.1523272544145584, 0.15921840071678162, -0.010615315288305283, 0.11211467534303665, 0.07053351402282715, 0.10008668899536133, 0.00996842235326767, 0.1973077356815338, 0.11361844837665558, 0.5135548114776611, -0.1076963022351265, -0.2458609640598297, 0.1980777084827423, -0.22803567349910736, -0.0956648737192154, -0.0704379677772522, 0.20560862123966217, 0.13302046060562134, 0.04782071337103844, 0.06661200523376465, 0.2086290419101715, -0.1588398516178131, 0.13990114629268646, -0.31848976016044617, 0.12788641452789307, 0.2298038750886917, -0.16752779483795166, -0.015513613820075989, -0.05322788655757904, 0.30175328254699707, 0.11167626082897186, -0.11536484211683273, 0.22132310271263123, 0.025308184325695038, -0.21340352296829224, 0.20482414960861206, 0.23892340064048767, -0.13839080929756165, 0.1065291091799736, 0.2780385911464691, 0.09981035441160202, 0.04086002707481384, 0.22055813670158386, -0.3909357786178589, -0.29088854789733887, -0.19759990274906158, 0.3074572682380676, -0.08313866704702377, 0.3521670699119568, 0.08397546410560608, -0.1464034914970398, 0.28172457218170166, -0.09947488456964493, 0.02982918731868267, -0.08821359276771545, -0.28940942883491516, -0.267742782831192, 0.13928425312042236, 0.44624602794647217, -0.08113805204629898, 0.1932789385318756, 0.24815018475055695, 0.012099642306566238, -0.10233716666698456, -0.03340565785765648, -0.14702598750591278, 0.07831524312496185, -0.4225500524044037, 0.2409459948539734, 0.15620604157447815, -0.3062734007835388, -0.14397019147872925, 0.08482810854911804, -0.26956602931022644, -0.06512029469013214, 0.17537757754325867, 0.1731940507888794, 0.1587696373462677, -0.184300035238266, 0.40758639574050903, -0.06346850842237473, 0.10324712097644806, -0.19046777486801147, -0.20885249972343445, -0.08360414952039719, 0.4212052524089813, 0.08577974140644073, -0.11451950669288635, 0.017569804564118385, -0.17026817798614502, 0.0014352239668369293, 0.07136309146881104, -0.11835208535194397, -0.03944167494773865, 0.34113019704818726, 0.09931925684213638, 0.09876321256160736, 0.2812916934490204, -0.3478286862373352, -0.16803082823753357, 0.22716024518013, -0.03269417956471443, -0.1742882877588272, -0.42573535442352295, 0.036701083183288574, -0.17703469097614288, -0.14294621348381042, -0.21341678500175476, -0.07046440243721008, 0.28025615215301514, -0.0957476794719696, -0.009183011949062347, 0.08839242160320282, -0.33573031425476074, 0.1985516995191574, -0.009840704500675201, -0.0839185044169426, -0.38399940729141235, 0.3491678833961487, -0.06160477548837662, -0.3539377450942993, -0.026469126343727112, 0.30899184942245483, 0.21677003800868988, -0.09805160015821457, -0.15402863919734955, 0.3934444189071655, 0.15141524374485016, -0.4084323048591614, -0.1344558298587799, -0.09421059489250183, -0.010966828092932701, -0.4510812759399414, 0.01412878930568695, 0.5252329707145691, 0.22737281024456024, -0.15006549656391144, 0.09518700838088989, 0.39283427596092224, -0.2780604958534241, 0.4659128785133362, -0.29779237508773804, -0.13926196098327637, 0.11838019639253616, 0.07883201539516449, 0.07136771827936172, -0.23489876091480255, 0.154312863945961, -0.15025700628757477, 0.11831509321928024, 0.10627004504203796, -0.24367354810237885, 0.10900326073169708, -0.20140796899795532, 0.09222905337810516, 0.021174468100070953, 0.11915548890829086, 0.023352880030870438, 0.06789714097976685, -0.0527951717376709, -0.1605769693851471, 0.27064961194992065, 0.24413008987903595, -0.15183694660663605, 0.06543616205453873, 0.022282548248767853, -0.12299458682537079, 0.1317870169878006, -0.11528646945953369, 0.02188262715935707, 0.22056856751441956, 0.14435754716396332, 0.07195958495140076, 0.23478257656097412, -0.48330098390579224, -0.13905641436576843, 0.40724238753318787, -0.2884041666984558, 0.06637441366910934, -0.28813642263412476, -0.41870248317718506, 0.04620251804590225, 0.09369340538978577, -0.15796101093292236, -0.13077421486377716, -0.17651185393333435, 0.017936797812581062, -0.16010752320289612, 0.06611652672290802, -0.5305108428001404, -0.2658451199531555, 0.36907100677490234, -0.04000275209546089, 0.06388384103775024, -0.03244832903146744, -0.07530942559242249, 0.08407443761825562, 0.12464374303817749, 0.33366701006889343, 0.2569462060928345, -0.03602827340364456, -0.24704867601394653, -0.026210466399788857, -0.041568905115127563, -0.15685692429542542, 0.006324769929051399, -0.062433935701847076, 0.46927890181541443, 0.13463623821735382, -0.11001116037368774, -0.2957029938697815, 0.12444423139095306, 0.156060129404068, -0.2962619364261627, 0.2448740005493164, 0.14603307843208313, 0.19108076393604279, -0.2972288727760315, -0.3039960563182831, -0.1203169971704483, -0.3196249306201935, -0.14780236780643463, -0.16269144415855408, 0.36613723635673523, 0.1541164517402649, -0.09704697132110596, 0.22369728982448578, -0.05936628207564354, 0.09658215939998627, 0.06854159384965897, 0.40110355615615845, 0.344749391078949, -0.015760887414216995, -0.06042648106813431, 0.0038186684250831604, -0.36941036581993103, -0.10177461802959442, 0.042599137872457504, -0.1906205266714096, -0.189341202378273, -0.14753670990467072, -0.08394370973110199, -0.2842938005924225, 0.017716793343424797, 0.2826180160045624, 0.19472715258598328, -0.2711847722530365, -0.09223336726427078, 0.055421411991119385, 0.2049178183078766, -0.1618267297744751, -0.1976294368505478, 0.27938616275787354, 0.44011321663856506, -0.17593026161193848, 0.08986426144838333, 0.20401206612586975, 0.01022781990468502, 0.2920604944229126, 0.03989632427692413, 0.3185446560382843, -0.18682309985160828, -0.32993799448013306, -0.3098953366279602, 0.4603244364261627, -0.1267819106578827, 0.03472825139760971, -0.15118378400802612, -0.24356941878795624, -0.05661429092288017, -0.17504465579986572, -0.20418311655521393, -0.0478166863322258, 0.001724395900964737, -0.10885369032621384, 0.35105955600738525, -0.16734781861305237, 0.03216726332902908, -0.07241398841142654, -0.18165256083011627, -0.16035571694374084, -0.180037260055542, 0.21330519020557404, -0.23990410566329956, -0.3960101306438446, -0.21556030213832855, -0.249143585562706, 0.22159017622470856, 0.3653486967086792, 0.4932069480419159, -0.03148755431175232, -0.06566646695137024, -0.05849044397473335, -0.03816865012049675, 0.48462748527526855, -0.060998670756816864, 0.00013626040890812874, 0.5168102383613586, -0.12499607354402542, -0.46105295419692993, -0.09471040219068527, -0.40672749280929565, 0.21967023611068726, 0.060573186725378036, 0.46989893913269043, -0.2653294801712036, -0.1737414002418518, 0.30397406220436096, 0.05836920812726021, -0.05675618350505829, -0.3080097436904907, -0.2031000554561615, -0.13999906182289124, 0.09831967204809189, 0.049216240644454956, 0.11411380022764206, 0.5087107419967651, 0.05451840162277222, 0.0020885542035102844, -0.3755539357662201, -0.228669673204422, -0.06630142033100128, -0.11687285453081131, 0.6078540682792664, 0.011160977184772491, 0.11511692404747009, 0.10527107119560242, 0.08812138438224792, 0.178272545337677, -0.054029785096645355, 0.32760098576545715, 0.21153688430786133, 0.06794211268424988, -0.25713464617729187, 0.1160316914319992, 0.18871115148067474, -0.17434588074684143, 0.3060669004917145, -0.42628413438796997, 0.21471771597862244, 0.007158063352108002, -0.33944398164749146, 0.20677709579467773, -0.29110202193260193, -0.3573776185512543, -0.2023528814315796, 0.38921722769737244, 0.044969603419303894, 0.1163773238658905, -0.02875351533293724, 0.242727592587471, -0.16210266947746277, 0.4962984621524811, 0.12866473197937012, 0.5505430698394775, 0.49584633111953735, -0.0520816408097744, 0.461357057094574, -0.2365768849849701, 0.5254949927330017, 0.3749294877052307, 0.1556834876537323, -0.391666442155838, -0.36679863929748535, -0.03495226800441742, -0.09684664011001587, -0.02482425421476364, -0.042956095188856125, -0.1912488043308258, 0.43459007143974304, -0.3848925232887268, -0.11961188167333603, -0.05298344045877457, -0.1835726797580719, 0.25836628675460815, 0.05812803655862808, -0.2183837592601776, 0.08926001936197281, 0.0058500198647379875, -0.18308421969413757, 0.018012162297964096, -0.2003065049648285, -0.015467405319213867, -0.07362505793571472, -0.049681633710861206, -0.08986476808786392, -0.051982589066028595, 0.41005465388298035, -0.09400792419910431, -0.17607071995735168, 0.06782731413841248, 0.14536362886428833, 0.18330799043178558, -0.018575601279735565, -0.10281816869974136, -0.1991279572248459, 0.012377266772091389, 0.20269392430782318, 0.03002520650625229, -0.05934181436896324, 0.2243977040052414, 0.04978740215301514, -0.1959698498249054, 0.12716923654079437, -0.11852370202541351, -0.29589736461639404, -0.0017221570014953613, 0.26087984442710876, -0.27547964453697205, -0.14766031503677368, -0.4437163770198822, -0.026796746999025345, 0.11616145074367523, -0.09477280080318451, 0.21601882576942444, 0.24025176465511322, -0.27176615595817566, 0.17116858065128326, -0.17575307190418243, -0.3850492835044861, 0.059369977563619614, 0.5281446576118469, 0.34310123324394226, 0.02622552216053009, 0.45139825344085693, 0.033166490495204926, -0.32017672061920166, -0.21181419491767883, 0.07582845538854599, 0.210374653339386, -0.266327440738678, 0.27448147535324097, 0.08694132417440414, 0.21888121962547302, 0.014787331223487854, 0.027463633567094803, 0.040367837995290756, 0.282384991645813, -0.13093839585781097, -0.09358641505241394, -0.16536277532577515, 0.25169825553894043, 0.20773917436599731, 0.021224284544587135, -0.05060899257659912, -0.1644286811351776, -0.15333105623722076, -0.25405535101890564, -0.3890489637851715, 0.13862943649291992, -0.3099759817123413, 0.25567924976348877, -0.15737013518810272, 0.009504441171884537, 0.022294461727142334, 0.10269467532634735, 0.19228333234786987, 0.01001531071960926, -0.15818792581558228, -0.33317872881889343, 0.0745181143283844, 0.08010900020599365, -0.22350218892097473, -0.22797182202339172, 0.014122184365987778, -0.17380082607269287, -0.22422197461128235, -0.10247623920440674, -0.10038182884454727, 0.29110395908355713, 0.1959206610918045, 0.1496545672416687, 0.0746849998831749, 0.17258383333683014, -0.101026251912117, 0.26714012026786804, -0.23182575404644012, -0.1188148483633995, -0.019702497869729996, 0.18568968772888184, -0.22185321152210236, 0.004045411944389343, -0.15721480548381805, -0.0024531297385692596, -0.6182365417480469, -0.15500684082508087, 0.18040825426578522, -0.5718128681182861, -0.24668148159980774, 0.4287184178829193, 0.33379966020584106, 0.09834106266498566, -0.1740099936723709, -0.14340811967849731, 0.057550013065338135, 0.27712365984916687, -0.22522836923599243, 0.017981909215450287, 0.3709040880203247, 0.4178386926651001, 0.11643580347299576, 0.3454161286354065, 0.1746063232421875, -0.18426620960235596, 0.07373600453138351, 0.20275834202766418, 0.22134847939014435, -0.23332273960113525, 0.17156176269054413, 0.42919445037841797, 0.04374094307422638, -0.3286590278148651, 0.15296001732349396, -0.06934934854507446, 0.45432159304618835, 0.5532816052436829, 0.23728427290916443, 0.45861849188804626, 0.5123244524002075, -0.0023949146270751953, -0.3334675431251526, -0.16761192679405212, -0.11793585121631622, 0.25008800625801086, 0.1641838103532791, -0.14482751488685608, 0.005510199815034866, 0.10386800765991211, -0.2630625367164612, -0.31722569465637207, 0.1283908486366272, -0.023344578221440315, -0.2898426353931427, 0.21850579977035522, 0.19905996322631836, 0.012849971652030945, -0.1755029261112213, -0.29045888781547546, 0.17630535364151, 0.06659916788339615, -0.09768463671207428, 0.063178151845932, -0.2843274474143982, -0.3552015721797943, 0.41573721170425415, 0.483151376247406, 0.2997356951236725, -0.04331976920366287, -0.020453710108995438, 0.4127669930458069, 0.16672690212726593, 0.2987768054008484, 0.5090479254722595, 0.5086452960968018, 0.3162839412689209, -0.22473250329494476, -0.1011095941066742, -0.06293325126171112, -0.30234450101852417, 0.06965231150388718, 0.00622188113629818, -0.24628831446170807, 0.04246759042143822, 0.03628756105899811, 0.19569914042949677, -0.21089819073677063, 0.15056709945201874, 0.2746322751045227, 0.1235918328166008, -0.148558109998703, 0.27704161405563354, -0.23555031418800354, -0.042127564549446106, 0.08121766149997711, -0.03698057681322098, -0.5235157012939453, 0.04057265445590019, 0.0690934807062149, 0.12172192335128784, 0.08490830659866333, 0.34184566140174866, 0.13104648888111115, -0.21458493173122406, 0.14380832016468048, 0.15122777223587036, -0.0026538576930761337, -0.016379982233047485, -0.030411817133426666, -0.5894402265548706, 0.0703442394733429, -0.05495724454522133, 0.10593198239803314, 0.25239458680152893, 0.19435973465442657, -0.17823761701583862, -0.20025087893009186, 0.10180781036615372, 0.009432561695575714, 0.016350407153367996, 0.232443705201149, -0.42371049523353577, 0.013057859614491463, -0.1033010259270668, -0.12263978272676468, -0.2864569425582886, -0.09866716712713242, -0.11265748739242554, -0.2516891360282898, 0.18848548829555511, 0.1530291885137558, 0.018107831478118896, -0.17468301951885223, 0.14848566055297852, 0.22974972426891327, 0.10747406631708145, 0.09034974873065948, 0.1693193018436432, 0.03996466100215912, -0.18613310158252716, -0.28258103132247925, 0.04751845449209213, 0.4250483214855194, 0.48406291007995605, 0.5255087018013, -0.24674619734287262, -0.174125075340271, -0.027963604778051376, 0.6668362617492676, -0.13896510004997253, 0.11624360084533691, -0.24991615116596222, 0.4686688780784607, -0.18485060334205627, 0.0802680253982544, -0.26916763186454773, -0.2536528408527374, 0.15951475501060486, 0.24329613149166107, -0.11099882423877716, -0.6881630420684814, 0.44481730461120605, -0.07936931401491165, -0.16808435320854187, -0.0602710023522377, 0.3521002233028412, 0.583819568157196, 0.11034568399190903, -0.24863781034946442, -0.05936723202466965, 0.46798452734947205, -0.025077365338802338, -0.10000213235616684, 0.1631295084953308, -0.15867513418197632, 0.029057234525680542, -0.030970096588134766, 0.04599832743406296, -0.12432745099067688, -0.07447926700115204, 0.15688662230968475, -0.08114145696163177 ]
https://github.com/huggingface/datasets/issues/5923
Based on https://github.com/rapidsai/cudf/issues/10187, this probably means your `pyarrow` installation is not compatible with `datasets`. Can you please execute the following commands in the terminal and paste the output here? ``` conda list | grep arrow ``` ``` python -c "import pyarrow; print(pyarrow.__file__)" ```
Cannot import datasets - ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility
### Describe the bug When trying to import datasets, I get a pyarrow ValueError: Traceback (most recent call last): File "/Users/edward/test/test.py", line 1, in <module> import datasets File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module> from .arrow_dataset import Dataset File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 65, in <module> from .arrow_reader import ArrowReader File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_reader.py", line 28, in <module> import pyarrow.parquet as pq File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/__init__.py", line 20, in <module> from .core import * File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/core.py", line 45, in <module> from pyarrow.fs import (LocalFileSystem, FileSystem, FileType, File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/fs.py", line 49, in <module> from pyarrow._gcsfs import GcsFileSystem # noqa File "pyarrow/_gcsfs.pyx", line 1, in init pyarrow._gcsfs ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject ### Steps to reproduce the bug `import datasets` ### Expected behavior Successful import ### Environment info Conda environment, MacOS python 3.9.12 datasets 2.12.0
43
Cannot import datasets - ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility ### Describe the bug When trying to import datasets, I get a pyarrow ValueError: Traceback (most recent call last): File "/Users/edward/test/test.py", line 1, in <module> import datasets File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module> from .arrow_dataset import Dataset File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 65, in <module> from .arrow_reader import ArrowReader File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_reader.py", line 28, in <module> import pyarrow.parquet as pq File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/__init__.py", line 20, in <module> from .core import * File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/core.py", line 45, in <module> from pyarrow.fs import (LocalFileSystem, FileSystem, FileType, File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/fs.py", line 49, in <module> from pyarrow._gcsfs import GcsFileSystem # noqa File "pyarrow/_gcsfs.pyx", line 1, in init pyarrow._gcsfs ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject ### Steps to reproduce the bug `import datasets` ### Expected behavior Successful import ### Environment info Conda environment, MacOS python 3.9.12 datasets 2.12.0 Based on https://github.com/rapidsai/cudf/issues/10187, this probably means your `pyarrow` installation is not compatible with `datasets`. Can you please execute the following commands in the terminal and paste the output here? ``` conda list | grep arrow ``` ``` python -c "import pyarrow; print(pyarrow.__file__)" ```
[ -0.5389391183853149, 0.41014090180397034, -0.09792473912239075, 0.2319422960281372, 0.14288535714149475, -0.13102033734321594, 0.21223437786102295, 0.2684710919857025, -0.408712774515152, 0.09050598740577698, -0.20407867431640625, 0.27507221698760986, -0.12025684118270874, 0.1409701108932495, -0.16671998798847198, 0.01760251820087433, 0.05824655294418335, 0.2816929221153259, -0.1661183387041092, 0.113141730427742, -0.10728545486927032, 0.16610445082187653, -0.21358206868171692, 0.11508075147867203, 0.011453785002231598, -0.10817255824804306, -0.14227774739265442, 0.24949845671653748, -0.43753454089164734, -0.7070934176445007, 0.3522906005382538, -0.086106076836586, 0.07033614069223404, 0.4895254969596863, -0.00011616970732575282, 0.18690964579582214, 0.2657691538333893, 0.06419306993484497, -0.253903865814209, -0.07424189150333405, 0.06377491354942322, -0.2764390707015991, 0.26972654461860657, -0.11235450953245163, 0.3193272650241852, -0.5484874248504639, 0.06671421974897385, 0.16740885376930237, 0.054839521646499634, 0.40047457814216614, 0.19530938565731049, 0.38214990496635437, 0.6554259061813354, 0.1227761059999466, 0.5305083990097046, 0.04909924045205116, 0.03578562289476395, 0.5898970365524292, 0.2579425871372223, 0.05691107362508774, 0.0021759532392024994, -0.20591427385807037, -0.1010093167424202, -0.048358254134655, 0.15855109691619873, -0.18132737278938293, -0.03536137938499451, -0.18852782249450684, -0.06856274604797363, -0.08543333411216736, 0.4250427186489105, -0.5830304026603699, -0.302016019821167, -0.09135070443153381, 0.10421205312013626, -0.45955967903137207, 0.28538691997528076, 0.21514496207237244, 0.1239168643951416, 0.22662369906902313, -0.08318190276622772, -0.12021125853061676, -0.3959175944328308, 0.18164576590061188, -0.32514679431915283, 0.24191302061080933, 0.029269661754369736, 0.19708991050720215, 0.00875172670930624, -0.18387901782989502, 0.42467594146728516, -0.02596220001578331, -0.23255464434623718, 0.08952406048774719, -0.22075620293617249, 0.081318199634552, 0.020974012091755867, 0.13495442271232605, -0.04143968224525452, 0.02640334889292717, -0.058164432644844055, -0.15183407068252563, -0.033698271960020065, 0.33083441853523254, 0.024396397173404694, 0.05486329272389412, -0.12570367753505707, 0.2684255838394165, 0.1664728820323944, 0.1868094801902771, -0.005677856504917145, -0.02999785915017128, -0.04185599088668823, -0.3846703767776489, 0.08216149359941483, 0.0356256403028965, 0.4344305098056793, -0.1588757187128067, -0.29218998551368713, -0.012626070529222488, -0.25384315848350525, 0.026433870196342468, -0.17737063765525818, 0.2993183434009552, -0.01885107159614563, 0.2504885196685791, 0.1386951059103012, 0.2536332607269287, -0.11470460891723633, -0.23161382973194122, -0.05686569958925247, 0.10283129662275314, -0.0738179013133049, -0.22125279903411865, 0.08629242330789566, -0.1755020022392273, 0.13045690953731537, 0.12832950055599213, 0.1933923065662384, 0.12288786470890045, -0.06554929167032242, -0.24240773916244507, -0.04746447876095772, 0.31247541308403015, -0.03729112073779106, 0.10041829198598862, 0.015014491975307465, -0.30412307381629944, -0.21219328045845032, 0.14690840244293213, -0.3801676332950592, -0.11307426542043686, -0.38429704308509827, 0.17333675920963287, -0.00567549467086792, -0.05924506485462189, -0.19764062762260437, -0.09340038895606995, 0.1950654685497284, -0.4064936637878418, -0.0562329925596714, -0.48926854133605957, 0.16215912997722626, -0.4678736925125122, -0.015019897371530533, 0.15141348540782928, -0.7889991998672485, 0.07376639544963837, 0.04906328022480011, 0.004440071061253548, 0.1919279396533966, 0.3100696802139282, -0.2902900278568268, -0.12284907698631287, -0.0004233941435813904, 0.1427394151687622, 0.2366839200258255, -0.21537001430988312, -0.6268244385719299, 0.0864512026309967, 0.03838047385215759, -0.24220477044582367, 0.1674947738647461, -0.17949894070625305, 0.19456103444099426, 0.09760883450508118, -0.10673335194587708, 0.1721334308385849, -0.07684064656496048, 0.04093795269727707, -0.19862762093544006, -0.5216740369796753, 0.2674814760684967, -0.03322679176926613, 0.10352544486522675, -0.39543211460113525, 0.35555097460746765, -0.3969314396381378, 0.29034629464149475, -0.1645258665084839, 0.057519592344760895, 0.33262306451797485, 0.3348727524280548, -0.11456172168254852, 0.021700289100408554, -0.2176801711320877, -0.2977602779865265, 0.1422601044178009, -0.381434828042984, -0.11011587828397751, -0.3259420096874237, -0.1059422641992569, -0.3133503198623657, 0.26993176341056824, 0.05359809473156929, -0.006133888382464647, 0.05970541015267372, 0.057409174740314484, -0.016452211886644363, 0.10308235138654709, -0.03366893529891968, 0.07832518219947815, -0.0958491861820221, 0.19671405851840973, -0.24218088388442993, 0.5291696190834045, -0.3428577184677124, -0.4746672213077545, 0.19328927993774414, -0.0023095812648534775, 0.0374557301402092, -0.06310087442398071, -0.14555492997169495, 0.4702662229537964, -0.028681166470050812, 0.3286389708518982, -0.1707378774881363, 0.084703728556633, 0.21563316881656647, -0.229253888130188, 0.32963529229164124, -0.028982695192098618, 0.08914411067962646, 0.20938627421855927, 0.13785672187805176, 0.16456446051597595, 0.16380859911441803, 0.09281909465789795, 0.12126252800226212, -0.22491805255413055, -0.030612699687480927, 0.13591116666793823, 0.1629302054643631, -0.009373307228088379, 0.04221060499548912, 0.1983906328678131, 0.12568755447864532, 0.1722821295261383, -0.2852168679237366, 0.08072225749492645, 0.42531582713127136, 0.0626024603843689, -0.008041251450777054, 0.1384713351726532, -0.2746993601322174, 0.050757043063640594, 0.36250460147857666, -0.14058038592338562, 0.29622507095336914, 0.3149271309375763, -0.1703774780035019, -0.029386475682258606, -0.0971117913722992, -0.052491623908281326, 0.18679046630859375, 0.13654297590255737, 0.2397942692041397, 0.07676659524440765, 0.623730480670929, 0.04727469012141228, -0.2200196385383606, -0.13672858476638794, 0.04518246650695801, 0.27634674310684204, -0.452684223651886, 0.308177649974823, -0.4269106388092041, -0.0024414435029029846, -0.23781991004943848, -0.154685840010643, -0.3824634552001953, -0.27317434549331665, -0.2290082722902298, 0.3882075548171997, 0.031330808997154236, 0.08750251680612564, -0.023035410791635513, -0.1944246143102646, 0.18350647389888763, -0.17203259468078613, 0.06762979924678802, -0.11229591071605682, -0.3621595501899719, 0.0946991890668869, 0.342587411403656, 0.12063385546207428, 0.19353339076042175, 0.03205987066030502, 0.03860313445329666, -0.05090917646884918, -0.47778546810150146, -0.1438167691230774, -0.025089098140597343, 0.19900289177894592, 0.1817106157541275, 0.11551493406295776, -0.07299236208200455, -0.46838411688804626, 0.057287078350782394, 0.08416453748941422, -0.3447721004486084, 0.1372157782316208, -0.34398332238197327, -0.1998528391122818, -0.0028321966528892517, -0.276289165019989, -0.4295882284641266, -0.3780532479286194, 0.1362106204032898, 0.3020915985107422, 0.23640713095664978, 0.3542707860469818, 0.3423806130886078, 0.01274484395980835, -0.0786948874592781, -0.10726942867040634, 0.23830220103263855, 0.028377175331115723, 0.28393781185150146, -0.07516976445913315, -0.257251501083374, -0.07669791579246521, -0.037464335560798645, 0.08720491826534271, 0.294569194316864, -0.4791855216026306, -0.014134753495454788, -0.3582625985145569, 0.5260703563690186, -0.08312098681926727, 0.14493517577648163, 0.22535274922847748, 0.15895995497703552, -0.004194937646389008, 0.003344491124153137, -0.1563226580619812, -0.26622116565704346, 0.2833780348300934, 0.07547761499881744, 0.055676694959402084, 0.3319579064846039, -0.19856581091880798, 0.6400830745697021, 0.023299410939216614, -0.2738661468029022, 0.4377114176750183, -0.2375326156616211, 0.45192140340805054, -0.10431645810604095, -0.3032712936401367, 0.06629733741283417, -0.10827210545539856, -0.07401157915592194, 0.044195711612701416, -0.22602307796478271, -0.3297971487045288, 0.12052588909864426, -0.18412691354751587, -0.23381878435611725, -0.14523108303546906, 0.09087691456079483, 0.14159071445465088, 0.3312854468822479, -0.08640037477016449, -0.2960985600948334, -0.2364920675754547, -0.21792711317539215, 0.025277383625507355, -0.08264269679784775, -0.22591671347618103, 0.038069967180490494, -0.035965826362371445, -0.13339830935001373, -0.34121182560920715, 0.30971473455429077, 0.17489559948444366, 0.2464342564344406, 0.1721387505531311, -0.0410853810608387, 0.11113014817237854, -0.21800363063812256, 0.32807719707489014, 0.09706304222345352, -0.182765394449234, 0.27574849128723145, 0.40072202682495117, -0.496793270111084, -0.23470546305179596, -0.19102361798286438, 0.27748310565948486, 0.24770592153072357, 0.18386921286582947, -0.3402397632598877, 0.15343794226646423, 0.16168956458568573, 0.5132279396057129, -0.044120822101831436, 0.16416697204113007, -0.27002739906311035, -0.10140333324670792, -0.4776964485645294, -0.10504379123449326, -0.01761382445693016, 0.33137673139572144, 0.005467850714921951, 0.06343299150466919, -0.14889757335186005, -0.24708475172519684, 0.0832427591085434, 0.28902047872543335, 0.3243051767349243, -0.07903829216957092, 0.11278222501277924, -0.31734713912010193, 0.0913165807723999, 0.5340574979782104, 0.7704090476036072, 0.20883658528327942, -0.34903720021247864, -0.016412770375609398, 0.05045154318213463, 0.32675692439079285, 0.11366061866283417, -0.19308175146579742, 0.18378815054893494, -0.11625105142593384, 0.10890750586986542, 0.12137383967638016, 0.04006081819534302, 0.24377843737602234, -0.07671591639518738, -0.2914526164531708, 0.08982376009225845, 0.41707974672317505, -0.03200620412826538, -0.013796605169773102, 0.18926988542079926, 0.4060444235801697, -0.1646333634853363, 0.3946790099143982, 0.03605928644537926, 0.8309652805328369, -0.04272161424160004, 0.0664454996585846, 0.5179725289344788, -0.40474075078964233, 0.16809165477752686, -0.02481294423341751, -0.0014977939426898956, -0.5320702791213989, 0.02998863160610199, 0.010089166462421417, -0.32545042037963867, 0.378400057554245, -0.024959616363048553, -0.2201615273952484, 0.13777568936347961, -0.01617369055747986, 0.21605737507343292, 0.007065225392580032, 0.16433557868003845, -0.0762438178062439, 0.12335334718227386, -0.3094923794269562, 0.09066323190927505, -0.1320367455482483, -0.20527583360671997, -0.05608992651104927, -0.08132266998291016, -0.27471923828125, -0.2721797823905945, -0.2812002897262573, -0.04469974339008331, -0.4894630014896393, 0.2627429664134979, 0.32856354117393494, -0.33071666955947876, 0.3076707124710083, 0.16620312631130219, -0.04406396299600601, 0.13957718014717102, -0.0796767994761467, 0.097402423620224, -0.013216350227594376, -0.056625720113515854, 0.12572379410266876, 0.13607007265090942, 0.10124372690916061, -0.051036760210990906, -0.24735097587108612, 0.3664361834526062, 0.06387249380350113, -0.17888739705085754, 0.14817728102207184, 0.12165239453315735, 0.2961480915546417, -0.3896706700325012, -0.059169575572013855, -0.42517295479774475, 0.09698713570833206, -0.15345673263072968, 0.05929594486951828, -0.1271677315235138, 0.26862481236457825, 0.20056328177452087, 0.013806306757032871, -0.1889253556728363, -0.2841084599494934, 0.4088476896286011, 0.03163333982229233, 0.268120139837265, 0.5743934512138367, 0.2638583779335022, -0.18598122894763947, -0.036853402853012085, 0.12482032179832458, 0.1295132040977478, -0.489487886428833, -0.0472915843129158, -0.09893018007278442, 0.1132626086473465, 0.06401893496513367, 0.03400582820177078, 0.283963680267334, 0.2301625907421112, -0.06152021512389183, -0.3313921093940735, -0.2537413239479065, 0.23526616394519806, 0.0836174413561821, -0.05974213778972626, 0.28060585260391235, 0.17075057327747345, -0.13414418697357178, -0.07644034922122955, -0.24748116731643677, 0.30566567182540894, -0.06656534224748611, 0.2226821929216385, 0.08635172247886658, -0.04553864151239395, -0.05687759071588516, -0.22526873648166656, 0.13118326663970947, 0.01636163704097271, 0.012625876814126968, -0.17638233304023743, -0.16661405563354492, 0.09999198466539383, -0.001013217493891716, -0.08072219789028168, -0.016165312379598618, -0.15215787291526794, -0.011200176551938057, -0.01796279475092888, 0.07604896277189255, -0.01460535079240799, -0.11940799653530121, -0.1400480568408966, 0.2809409499168396, -0.12060108780860901, -0.1210639476776123, 0.23246072232723236, -0.23627105355262756, 0.22578051686286926, 0.059537820518016815, 0.5264185070991516, -0.024768680334091187, 0.03063800185918808, -0.1317235678434372, 0.15129616856575012, -0.34175971150398254, -0.05293168127536774, 0.25683096051216125, -0.3094082772731781, -0.06632181257009506, 0.09374935925006866, 0.23149418830871582, 0.41054677963256836, -0.12172404676675797, -0.08593331277370453, 0.2554229199886322, 0.13186591863632202, -0.3775715231895447, -0.17314814031124115, 0.04951814189553261, -0.10026286542415619, -0.025594010949134827, 0.059920601546764374, 0.3110899329185486, -0.18170717358589172, 0.09042950719594955, 0.34185144305229187, 0.2442220151424408, 0.26974204182624817, -0.0024246424436569214, 0.44836151599884033, 0.012056268751621246, -0.20428091287612915, 0.4182865619659424, 0.1756482720375061, 0.31129884719848633, 0.26551252603530884, -0.21094004809856415, 0.16680176556110382, 0.049634188413619995, -0.19737444818019867, 0.09603322297334671, -0.42627519369125366, -0.19237294793128967, -0.0999845340847969, 0.31498318910598755, -0.061651088297367096, 0.46200695633888245, 0.45272618532180786, 0.27119389176368713, -0.07099601626396179, 0.02905261516571045, 0.3461710214614868, -0.00007067294791340828, 0.0676976889371872, -0.07238531112670898, -0.2340080291032791, -0.2650998830795288, -0.014262579381465912, -0.2551712691783905, -0.24806059896945953, 0.30818596482276917, 0.2364887148141861, -0.3372643291950226, -0.7492637038230896, 0.3052001893520355, 0.1087694764137268, 0.12708932161331177, -0.2866680324077606, 0.35383695363998413, 0.24741961061954498, -0.1135721281170845, -0.10147155821323395, 0.30838122963905334, 0.8915085792541504, 0.31771764159202576, -0.02600981295108795, 0.0024152323603630066, -0.004144560545682907, -0.15640640258789062, 0.04656856507062912, -0.1994176208972931, -0.19490215182304382, 0.4521815776824951, 0.2232360988855362, 0.17558464407920837, -0.14350566267967224, -0.19015607237815857, 0.08037736266851425, -0.002545885741710663, -0.268173485994339, 0.13124673068523407, -0.1365811973810196, -0.20019450783729553, 0.0013935090973973274, -0.0007405504584312439, -0.42817452549934387, -0.00899314135313034, 0.4281740188598633, 0.13380154967308044, 0.11360006779432297, -0.12113121151924133, 0.04415826499462128, 0.045718587934970856, 0.44777101278305054, 0.6064440011978149, 0.13685736060142517, -0.1345338374376297, -0.08647548407316208, -0.42366355657577515, 0.275939404964447, -0.332254558801651, -0.044852398335933685, 0.12691543996334076, 0.20620226860046387, 0.0542919784784317, 0.07830438017845154, 0.27757400274276733, 0.420621782541275, -0.17724910378456116, -0.05108058452606201, -0.332472562789917, -0.10067255795001984, 0.046692438423633575, -0.22204174101352692, -0.12957659363746643, -0.24664458632469177, 0.3911384344100952, -0.2919163107872009, 0.06642098724842072, -0.3800824284553528, -0.14073927700519562, 0.25868332386016846, -0.08691835403442383, 0.45785221457481384, 0.0009060781449079514, 0.41875797510147095, 0.03265461325645447, -0.17067331075668335, -0.3290652632713318, -0.3339603543281555, -0.28833654522895813, 0.3402409255504608, -0.05063445493578911, 0.4427412152290344, -0.18638867139816284, -0.3720743954181671, -0.10302574187517166, 0.2508411407470703, -0.09061776846647263, 0.15800976753234863, 0.19902543723583221, 0.03442266583442688, 0.0075860098004341125, 0.01790967583656311, -0.08486709743738174, -0.08275871723890305, 0.09513992816209793, 0.16722926497459412, -0.2761419415473938, -0.6448034048080444, 0.241926908493042, -0.2260374277830124, -0.20503024756908417, 0.04457248002290726, 0.05650459975004196, 0.17781129479408264, 0.026200050488114357, -0.4378465712070465, 0.234495609998703, 0.40572476387023926, -0.15454722940921783, -0.12775224447250366, 0.18590374290943146, 0.10264274477958679, 0.14742787182331085, -0.025282561779022217, 0.3295576870441437, -0.06774131953716278, -0.28767818212509155, -0.11397577822208405, -0.18642500042915344 ]
https://github.com/huggingface/datasets/issues/5923
> Based on [rapidsai/cudf#10187](https://github.com/rapidsai/cudf/issues/10187), this probably means your `pyarrow` installation is not compatible with `datasets`. > > Can you please execute the following commands in the terminal and paste the output here? > > ``` > conda list | grep arrow > ``` > > ``` > python -c "import pyarrow; print(pyarrow.__file__)" > ``` Here is the output to the first command: ``` arrow-cpp 11.0.0 py39h7f74497_0 pyarrow 12.0.0 pypi_0 pypi ``` and the second: ``` /Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/__init__.py ``` Thanks!
Cannot import datasets - ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility
### Describe the bug When trying to import datasets, I get a pyarrow ValueError: Traceback (most recent call last): File "/Users/edward/test/test.py", line 1, in <module> import datasets File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module> from .arrow_dataset import Dataset File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 65, in <module> from .arrow_reader import ArrowReader File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_reader.py", line 28, in <module> import pyarrow.parquet as pq File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/__init__.py", line 20, in <module> from .core import * File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/core.py", line 45, in <module> from pyarrow.fs import (LocalFileSystem, FileSystem, FileType, File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/fs.py", line 49, in <module> from pyarrow._gcsfs import GcsFileSystem # noqa File "pyarrow/_gcsfs.pyx", line 1, in init pyarrow._gcsfs ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject ### Steps to reproduce the bug `import datasets` ### Expected behavior Successful import ### Environment info Conda environment, MacOS python 3.9.12 datasets 2.12.0
78
Cannot import datasets - ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility ### Describe the bug When trying to import datasets, I get a pyarrow ValueError: Traceback (most recent call last): File "/Users/edward/test/test.py", line 1, in <module> import datasets File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module> from .arrow_dataset import Dataset File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 65, in <module> from .arrow_reader import ArrowReader File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_reader.py", line 28, in <module> import pyarrow.parquet as pq File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/__init__.py", line 20, in <module> from .core import * File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/core.py", line 45, in <module> from pyarrow.fs import (LocalFileSystem, FileSystem, FileType, File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/fs.py", line 49, in <module> from pyarrow._gcsfs import GcsFileSystem # noqa File "pyarrow/_gcsfs.pyx", line 1, in init pyarrow._gcsfs ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject ### Steps to reproduce the bug `import datasets` ### Expected behavior Successful import ### Environment info Conda environment, MacOS python 3.9.12 datasets 2.12.0 > Based on [rapidsai/cudf#10187](https://github.com/rapidsai/cudf/issues/10187), this probably means your `pyarrow` installation is not compatible with `datasets`. > > Can you please execute the following commands in the terminal and paste the output here? > > ``` > conda list | grep arrow > ``` > > ``` > python -c "import pyarrow; print(pyarrow.__file__)" > ``` Here is the output to the first command: ``` arrow-cpp 11.0.0 py39h7f74497_0 pyarrow 12.0.0 pypi_0 pypi ``` and the second: ``` /Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/__init__.py ``` Thanks!
[ -0.5389391183853149, 0.41014090180397034, -0.09792473912239075, 0.2319422960281372, 0.14288535714149475, -0.13102033734321594, 0.21223437786102295, 0.2684710919857025, -0.408712774515152, 0.09050598740577698, -0.20407867431640625, 0.27507221698760986, -0.12025684118270874, 0.1409701108932495, -0.16671998798847198, 0.01760251820087433, 0.05824655294418335, 0.2816929221153259, -0.1661183387041092, 0.113141730427742, -0.10728545486927032, 0.16610445082187653, -0.21358206868171692, 0.11508075147867203, 0.011453785002231598, -0.10817255824804306, -0.14227774739265442, 0.24949845671653748, -0.43753454089164734, -0.7070934176445007, 0.3522906005382538, -0.086106076836586, 0.07033614069223404, 0.4895254969596863, -0.00011616970732575282, 0.18690964579582214, 0.2657691538333893, 0.06419306993484497, -0.253903865814209, -0.07424189150333405, 0.06377491354942322, -0.2764390707015991, 0.26972654461860657, -0.11235450953245163, 0.3193272650241852, -0.5484874248504639, 0.06671421974897385, 0.16740885376930237, 0.054839521646499634, 0.40047457814216614, 0.19530938565731049, 0.38214990496635437, 0.6554259061813354, 0.1227761059999466, 0.5305083990097046, 0.04909924045205116, 0.03578562289476395, 0.5898970365524292, 0.2579425871372223, 0.05691107362508774, 0.0021759532392024994, -0.20591427385807037, -0.1010093167424202, -0.048358254134655, 0.15855109691619873, -0.18132737278938293, -0.03536137938499451, -0.18852782249450684, -0.06856274604797363, -0.08543333411216736, 0.4250427186489105, -0.5830304026603699, -0.302016019821167, -0.09135070443153381, 0.10421205312013626, -0.45955967903137207, 0.28538691997528076, 0.21514496207237244, 0.1239168643951416, 0.22662369906902313, -0.08318190276622772, -0.12021125853061676, -0.3959175944328308, 0.18164576590061188, -0.32514679431915283, 0.24191302061080933, 0.029269661754369736, 0.19708991050720215, 0.00875172670930624, -0.18387901782989502, 0.42467594146728516, -0.02596220001578331, -0.23255464434623718, 0.08952406048774719, -0.22075620293617249, 0.081318199634552, 0.020974012091755867, 0.13495442271232605, -0.04143968224525452, 0.02640334889292717, -0.058164432644844055, -0.15183407068252563, -0.033698271960020065, 0.33083441853523254, 0.024396397173404694, 0.05486329272389412, -0.12570367753505707, 0.2684255838394165, 0.1664728820323944, 0.1868094801902771, -0.005677856504917145, -0.02999785915017128, -0.04185599088668823, -0.3846703767776489, 0.08216149359941483, 0.0356256403028965, 0.4344305098056793, -0.1588757187128067, -0.29218998551368713, -0.012626070529222488, -0.25384315848350525, 0.026433870196342468, -0.17737063765525818, 0.2993183434009552, -0.01885107159614563, 0.2504885196685791, 0.1386951059103012, 0.2536332607269287, -0.11470460891723633, -0.23161382973194122, -0.05686569958925247, 0.10283129662275314, -0.0738179013133049, -0.22125279903411865, 0.08629242330789566, -0.1755020022392273, 0.13045690953731537, 0.12832950055599213, 0.1933923065662384, 0.12288786470890045, -0.06554929167032242, -0.24240773916244507, -0.04746447876095772, 0.31247541308403015, -0.03729112073779106, 0.10041829198598862, 0.015014491975307465, -0.30412307381629944, -0.21219328045845032, 0.14690840244293213, -0.3801676332950592, -0.11307426542043686, -0.38429704308509827, 0.17333675920963287, -0.00567549467086792, -0.05924506485462189, -0.19764062762260437, -0.09340038895606995, 0.1950654685497284, -0.4064936637878418, -0.0562329925596714, -0.48926854133605957, 0.16215912997722626, -0.4678736925125122, -0.015019897371530533, 0.15141348540782928, -0.7889991998672485, 0.07376639544963837, 0.04906328022480011, 0.004440071061253548, 0.1919279396533966, 0.3100696802139282, -0.2902900278568268, -0.12284907698631287, -0.0004233941435813904, 0.1427394151687622, 0.2366839200258255, -0.21537001430988312, -0.6268244385719299, 0.0864512026309967, 0.03838047385215759, -0.24220477044582367, 0.1674947738647461, -0.17949894070625305, 0.19456103444099426, 0.09760883450508118, -0.10673335194587708, 0.1721334308385849, -0.07684064656496048, 0.04093795269727707, -0.19862762093544006, -0.5216740369796753, 0.2674814760684967, -0.03322679176926613, 0.10352544486522675, -0.39543211460113525, 0.35555097460746765, -0.3969314396381378, 0.29034629464149475, -0.1645258665084839, 0.057519592344760895, 0.33262306451797485, 0.3348727524280548, -0.11456172168254852, 0.021700289100408554, -0.2176801711320877, -0.2977602779865265, 0.1422601044178009, -0.381434828042984, -0.11011587828397751, -0.3259420096874237, -0.1059422641992569, -0.3133503198623657, 0.26993176341056824, 0.05359809473156929, -0.006133888382464647, 0.05970541015267372, 0.057409174740314484, -0.016452211886644363, 0.10308235138654709, -0.03366893529891968, 0.07832518219947815, -0.0958491861820221, 0.19671405851840973, -0.24218088388442993, 0.5291696190834045, -0.3428577184677124, -0.4746672213077545, 0.19328927993774414, -0.0023095812648534775, 0.0374557301402092, -0.06310087442398071, -0.14555492997169495, 0.4702662229537964, -0.028681166470050812, 0.3286389708518982, -0.1707378774881363, 0.084703728556633, 0.21563316881656647, -0.229253888130188, 0.32963529229164124, -0.028982695192098618, 0.08914411067962646, 0.20938627421855927, 0.13785672187805176, 0.16456446051597595, 0.16380859911441803, 0.09281909465789795, 0.12126252800226212, -0.22491805255413055, -0.030612699687480927, 0.13591116666793823, 0.1629302054643631, -0.009373307228088379, 0.04221060499548912, 0.1983906328678131, 0.12568755447864532, 0.1722821295261383, -0.2852168679237366, 0.08072225749492645, 0.42531582713127136, 0.0626024603843689, -0.008041251450777054, 0.1384713351726532, -0.2746993601322174, 0.050757043063640594, 0.36250460147857666, -0.14058038592338562, 0.29622507095336914, 0.3149271309375763, -0.1703774780035019, -0.029386475682258606, -0.0971117913722992, -0.052491623908281326, 0.18679046630859375, 0.13654297590255737, 0.2397942692041397, 0.07676659524440765, 0.623730480670929, 0.04727469012141228, -0.2200196385383606, -0.13672858476638794, 0.04518246650695801, 0.27634674310684204, -0.452684223651886, 0.308177649974823, -0.4269106388092041, -0.0024414435029029846, -0.23781991004943848, -0.154685840010643, -0.3824634552001953, -0.27317434549331665, -0.2290082722902298, 0.3882075548171997, 0.031330808997154236, 0.08750251680612564, -0.023035410791635513, -0.1944246143102646, 0.18350647389888763, -0.17203259468078613, 0.06762979924678802, -0.11229591071605682, -0.3621595501899719, 0.0946991890668869, 0.342587411403656, 0.12063385546207428, 0.19353339076042175, 0.03205987066030502, 0.03860313445329666, -0.05090917646884918, -0.47778546810150146, -0.1438167691230774, -0.025089098140597343, 0.19900289177894592, 0.1817106157541275, 0.11551493406295776, -0.07299236208200455, -0.46838411688804626, 0.057287078350782394, 0.08416453748941422, -0.3447721004486084, 0.1372157782316208, -0.34398332238197327, -0.1998528391122818, -0.0028321966528892517, -0.276289165019989, -0.4295882284641266, -0.3780532479286194, 0.1362106204032898, 0.3020915985107422, 0.23640713095664978, 0.3542707860469818, 0.3423806130886078, 0.01274484395980835, -0.0786948874592781, -0.10726942867040634, 0.23830220103263855, 0.028377175331115723, 0.28393781185150146, -0.07516976445913315, -0.257251501083374, -0.07669791579246521, -0.037464335560798645, 0.08720491826534271, 0.294569194316864, -0.4791855216026306, -0.014134753495454788, -0.3582625985145569, 0.5260703563690186, -0.08312098681926727, 0.14493517577648163, 0.22535274922847748, 0.15895995497703552, -0.004194937646389008, 0.003344491124153137, -0.1563226580619812, -0.26622116565704346, 0.2833780348300934, 0.07547761499881744, 0.055676694959402084, 0.3319579064846039, -0.19856581091880798, 0.6400830745697021, 0.023299410939216614, -0.2738661468029022, 0.4377114176750183, -0.2375326156616211, 0.45192140340805054, -0.10431645810604095, -0.3032712936401367, 0.06629733741283417, -0.10827210545539856, -0.07401157915592194, 0.044195711612701416, -0.22602307796478271, -0.3297971487045288, 0.12052588909864426, -0.18412691354751587, -0.23381878435611725, -0.14523108303546906, 0.09087691456079483, 0.14159071445465088, 0.3312854468822479, -0.08640037477016449, -0.2960985600948334, -0.2364920675754547, -0.21792711317539215, 0.025277383625507355, -0.08264269679784775, -0.22591671347618103, 0.038069967180490494, -0.035965826362371445, -0.13339830935001373, -0.34121182560920715, 0.30971473455429077, 0.17489559948444366, 0.2464342564344406, 0.1721387505531311, -0.0410853810608387, 0.11113014817237854, -0.21800363063812256, 0.32807719707489014, 0.09706304222345352, -0.182765394449234, 0.27574849128723145, 0.40072202682495117, -0.496793270111084, -0.23470546305179596, -0.19102361798286438, 0.27748310565948486, 0.24770592153072357, 0.18386921286582947, -0.3402397632598877, 0.15343794226646423, 0.16168956458568573, 0.5132279396057129, -0.044120822101831436, 0.16416697204113007, -0.27002739906311035, -0.10140333324670792, -0.4776964485645294, -0.10504379123449326, -0.01761382445693016, 0.33137673139572144, 0.005467850714921951, 0.06343299150466919, -0.14889757335186005, -0.24708475172519684, 0.0832427591085434, 0.28902047872543335, 0.3243051767349243, -0.07903829216957092, 0.11278222501277924, -0.31734713912010193, 0.0913165807723999, 0.5340574979782104, 0.7704090476036072, 0.20883658528327942, -0.34903720021247864, -0.016412770375609398, 0.05045154318213463, 0.32675692439079285, 0.11366061866283417, -0.19308175146579742, 0.18378815054893494, -0.11625105142593384, 0.10890750586986542, 0.12137383967638016, 0.04006081819534302, 0.24377843737602234, -0.07671591639518738, -0.2914526164531708, 0.08982376009225845, 0.41707974672317505, -0.03200620412826538, -0.013796605169773102, 0.18926988542079926, 0.4060444235801697, -0.1646333634853363, 0.3946790099143982, 0.03605928644537926, 0.8309652805328369, -0.04272161424160004, 0.0664454996585846, 0.5179725289344788, -0.40474075078964233, 0.16809165477752686, -0.02481294423341751, -0.0014977939426898956, -0.5320702791213989, 0.02998863160610199, 0.010089166462421417, -0.32545042037963867, 0.378400057554245, -0.024959616363048553, -0.2201615273952484, 0.13777568936347961, -0.01617369055747986, 0.21605737507343292, 0.007065225392580032, 0.16433557868003845, -0.0762438178062439, 0.12335334718227386, -0.3094923794269562, 0.09066323190927505, -0.1320367455482483, -0.20527583360671997, -0.05608992651104927, -0.08132266998291016, -0.27471923828125, -0.2721797823905945, -0.2812002897262573, -0.04469974339008331, -0.4894630014896393, 0.2627429664134979, 0.32856354117393494, -0.33071666955947876, 0.3076707124710083, 0.16620312631130219, -0.04406396299600601, 0.13957718014717102, -0.0796767994761467, 0.097402423620224, -0.013216350227594376, -0.056625720113515854, 0.12572379410266876, 0.13607007265090942, 0.10124372690916061, -0.051036760210990906, -0.24735097587108612, 0.3664361834526062, 0.06387249380350113, -0.17888739705085754, 0.14817728102207184, 0.12165239453315735, 0.2961480915546417, -0.3896706700325012, -0.059169575572013855, -0.42517295479774475, 0.09698713570833206, -0.15345673263072968, 0.05929594486951828, -0.1271677315235138, 0.26862481236457825, 0.20056328177452087, 0.013806306757032871, -0.1889253556728363, -0.2841084599494934, 0.4088476896286011, 0.03163333982229233, 0.268120139837265, 0.5743934512138367, 0.2638583779335022, -0.18598122894763947, -0.036853402853012085, 0.12482032179832458, 0.1295132040977478, -0.489487886428833, -0.0472915843129158, -0.09893018007278442, 0.1132626086473465, 0.06401893496513367, 0.03400582820177078, 0.283963680267334, 0.2301625907421112, -0.06152021512389183, -0.3313921093940735, -0.2537413239479065, 0.23526616394519806, 0.0836174413561821, -0.05974213778972626, 0.28060585260391235, 0.17075057327747345, -0.13414418697357178, -0.07644034922122955, -0.24748116731643677, 0.30566567182540894, -0.06656534224748611, 0.2226821929216385, 0.08635172247886658, -0.04553864151239395, -0.05687759071588516, -0.22526873648166656, 0.13118326663970947, 0.01636163704097271, 0.012625876814126968, -0.17638233304023743, -0.16661405563354492, 0.09999198466539383, -0.001013217493891716, -0.08072219789028168, -0.016165312379598618, -0.15215787291526794, -0.011200176551938057, -0.01796279475092888, 0.07604896277189255, -0.01460535079240799, -0.11940799653530121, -0.1400480568408966, 0.2809409499168396, -0.12060108780860901, -0.1210639476776123, 0.23246072232723236, -0.23627105355262756, 0.22578051686286926, 0.059537820518016815, 0.5264185070991516, -0.024768680334091187, 0.03063800185918808, -0.1317235678434372, 0.15129616856575012, -0.34175971150398254, -0.05293168127536774, 0.25683096051216125, -0.3094082772731781, -0.06632181257009506, 0.09374935925006866, 0.23149418830871582, 0.41054677963256836, -0.12172404676675797, -0.08593331277370453, 0.2554229199886322, 0.13186591863632202, -0.3775715231895447, -0.17314814031124115, 0.04951814189553261, -0.10026286542415619, -0.025594010949134827, 0.059920601546764374, 0.3110899329185486, -0.18170717358589172, 0.09042950719594955, 0.34185144305229187, 0.2442220151424408, 0.26974204182624817, -0.0024246424436569214, 0.44836151599884033, 0.012056268751621246, -0.20428091287612915, 0.4182865619659424, 0.1756482720375061, 0.31129884719848633, 0.26551252603530884, -0.21094004809856415, 0.16680176556110382, 0.049634188413619995, -0.19737444818019867, 0.09603322297334671, -0.42627519369125366, -0.19237294793128967, -0.0999845340847969, 0.31498318910598755, -0.061651088297367096, 0.46200695633888245, 0.45272618532180786, 0.27119389176368713, -0.07099601626396179, 0.02905261516571045, 0.3461710214614868, -0.00007067294791340828, 0.0676976889371872, -0.07238531112670898, -0.2340080291032791, -0.2650998830795288, -0.014262579381465912, -0.2551712691783905, -0.24806059896945953, 0.30818596482276917, 0.2364887148141861, -0.3372643291950226, -0.7492637038230896, 0.3052001893520355, 0.1087694764137268, 0.12708932161331177, -0.2866680324077606, 0.35383695363998413, 0.24741961061954498, -0.1135721281170845, -0.10147155821323395, 0.30838122963905334, 0.8915085792541504, 0.31771764159202576, -0.02600981295108795, 0.0024152323603630066, -0.004144560545682907, -0.15640640258789062, 0.04656856507062912, -0.1994176208972931, -0.19490215182304382, 0.4521815776824951, 0.2232360988855362, 0.17558464407920837, -0.14350566267967224, -0.19015607237815857, 0.08037736266851425, -0.002545885741710663, -0.268173485994339, 0.13124673068523407, -0.1365811973810196, -0.20019450783729553, 0.0013935090973973274, -0.0007405504584312439, -0.42817452549934387, -0.00899314135313034, 0.4281740188598633, 0.13380154967308044, 0.11360006779432297, -0.12113121151924133, 0.04415826499462128, 0.045718587934970856, 0.44777101278305054, 0.6064440011978149, 0.13685736060142517, -0.1345338374376297, -0.08647548407316208, -0.42366355657577515, 0.275939404964447, -0.332254558801651, -0.044852398335933685, 0.12691543996334076, 0.20620226860046387, 0.0542919784784317, 0.07830438017845154, 0.27757400274276733, 0.420621782541275, -0.17724910378456116, -0.05108058452606201, -0.332472562789917, -0.10067255795001984, 0.046692438423633575, -0.22204174101352692, -0.12957659363746643, -0.24664458632469177, 0.3911384344100952, -0.2919163107872009, 0.06642098724842072, -0.3800824284553528, -0.14073927700519562, 0.25868332386016846, -0.08691835403442383, 0.45785221457481384, 0.0009060781449079514, 0.41875797510147095, 0.03265461325645447, -0.17067331075668335, -0.3290652632713318, -0.3339603543281555, -0.28833654522895813, 0.3402409255504608, -0.05063445493578911, 0.4427412152290344, -0.18638867139816284, -0.3720743954181671, -0.10302574187517166, 0.2508411407470703, -0.09061776846647263, 0.15800976753234863, 0.19902543723583221, 0.03442266583442688, 0.0075860098004341125, 0.01790967583656311, -0.08486709743738174, -0.08275871723890305, 0.09513992816209793, 0.16722926497459412, -0.2761419415473938, -0.6448034048080444, 0.241926908493042, -0.2260374277830124, -0.20503024756908417, 0.04457248002290726, 0.05650459975004196, 0.17781129479408264, 0.026200050488114357, -0.4378465712070465, 0.234495609998703, 0.40572476387023926, -0.15454722940921783, -0.12775224447250366, 0.18590374290943146, 0.10264274477958679, 0.14742787182331085, -0.025282561779022217, 0.3295576870441437, -0.06774131953716278, -0.28767818212509155, -0.11397577822208405, -0.18642500042915344 ]
https://github.com/huggingface/datasets/issues/5923
RuntimeError: Failed to import transformers.trainer because of the following error (look up to see its traceback): pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject
Cannot import datasets - ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility
### Describe the bug When trying to import datasets, I get a pyarrow ValueError: Traceback (most recent call last): File "/Users/edward/test/test.py", line 1, in <module> import datasets File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module> from .arrow_dataset import Dataset File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 65, in <module> from .arrow_reader import ArrowReader File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_reader.py", line 28, in <module> import pyarrow.parquet as pq File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/__init__.py", line 20, in <module> from .core import * File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/core.py", line 45, in <module> from pyarrow.fs import (LocalFileSystem, FileSystem, FileType, File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/fs.py", line 49, in <module> from pyarrow._gcsfs import GcsFileSystem # noqa File "pyarrow/_gcsfs.pyx", line 1, in init pyarrow._gcsfs ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject ### Steps to reproduce the bug `import datasets` ### Expected behavior Successful import ### Environment info Conda environment, MacOS python 3.9.12 datasets 2.12.0
32
Cannot import datasets - ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility ### Describe the bug When trying to import datasets, I get a pyarrow ValueError: Traceback (most recent call last): File "/Users/edward/test/test.py", line 1, in <module> import datasets File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module> from .arrow_dataset import Dataset File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 65, in <module> from .arrow_reader import ArrowReader File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_reader.py", line 28, in <module> import pyarrow.parquet as pq File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/__init__.py", line 20, in <module> from .core import * File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/core.py", line 45, in <module> from pyarrow.fs import (LocalFileSystem, FileSystem, FileType, File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/fs.py", line 49, in <module> from pyarrow._gcsfs import GcsFileSystem # noqa File "pyarrow/_gcsfs.pyx", line 1, in init pyarrow._gcsfs ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject ### Steps to reproduce the bug `import datasets` ### Expected behavior Successful import ### Environment info Conda environment, MacOS python 3.9.12 datasets 2.12.0 RuntimeError: Failed to import transformers.trainer because of the following error (look up to see its traceback): pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject
[ -0.5389391183853149, 0.41014090180397034, -0.09792473912239075, 0.2319422960281372, 0.14288535714149475, -0.13102033734321594, 0.21223437786102295, 0.2684710919857025, -0.408712774515152, 0.09050598740577698, -0.20407867431640625, 0.27507221698760986, -0.12025684118270874, 0.1409701108932495, -0.16671998798847198, 0.01760251820087433, 0.05824655294418335, 0.2816929221153259, -0.1661183387041092, 0.113141730427742, -0.10728545486927032, 0.16610445082187653, -0.21358206868171692, 0.11508075147867203, 0.011453785002231598, -0.10817255824804306, -0.14227774739265442, 0.24949845671653748, -0.43753454089164734, -0.7070934176445007, 0.3522906005382538, -0.086106076836586, 0.07033614069223404, 0.4895254969596863, -0.00011616970732575282, 0.18690964579582214, 0.2657691538333893, 0.06419306993484497, -0.253903865814209, -0.07424189150333405, 0.06377491354942322, -0.2764390707015991, 0.26972654461860657, -0.11235450953245163, 0.3193272650241852, -0.5484874248504639, 0.06671421974897385, 0.16740885376930237, 0.054839521646499634, 0.40047457814216614, 0.19530938565731049, 0.38214990496635437, 0.6554259061813354, 0.1227761059999466, 0.5305083990097046, 0.04909924045205116, 0.03578562289476395, 0.5898970365524292, 0.2579425871372223, 0.05691107362508774, 0.0021759532392024994, -0.20591427385807037, -0.1010093167424202, -0.048358254134655, 0.15855109691619873, -0.18132737278938293, -0.03536137938499451, -0.18852782249450684, -0.06856274604797363, -0.08543333411216736, 0.4250427186489105, -0.5830304026603699, -0.302016019821167, -0.09135070443153381, 0.10421205312013626, -0.45955967903137207, 0.28538691997528076, 0.21514496207237244, 0.1239168643951416, 0.22662369906902313, -0.08318190276622772, -0.12021125853061676, -0.3959175944328308, 0.18164576590061188, -0.32514679431915283, 0.24191302061080933, 0.029269661754369736, 0.19708991050720215, 0.00875172670930624, -0.18387901782989502, 0.42467594146728516, -0.02596220001578331, -0.23255464434623718, 0.08952406048774719, -0.22075620293617249, 0.081318199634552, 0.020974012091755867, 0.13495442271232605, -0.04143968224525452, 0.02640334889292717, -0.058164432644844055, -0.15183407068252563, -0.033698271960020065, 0.33083441853523254, 0.024396397173404694, 0.05486329272389412, -0.12570367753505707, 0.2684255838394165, 0.1664728820323944, 0.1868094801902771, -0.005677856504917145, -0.02999785915017128, -0.04185599088668823, -0.3846703767776489, 0.08216149359941483, 0.0356256403028965, 0.4344305098056793, -0.1588757187128067, -0.29218998551368713, -0.012626070529222488, -0.25384315848350525, 0.026433870196342468, -0.17737063765525818, 0.2993183434009552, -0.01885107159614563, 0.2504885196685791, 0.1386951059103012, 0.2536332607269287, -0.11470460891723633, -0.23161382973194122, -0.05686569958925247, 0.10283129662275314, -0.0738179013133049, -0.22125279903411865, 0.08629242330789566, -0.1755020022392273, 0.13045690953731537, 0.12832950055599213, 0.1933923065662384, 0.12288786470890045, -0.06554929167032242, -0.24240773916244507, -0.04746447876095772, 0.31247541308403015, -0.03729112073779106, 0.10041829198598862, 0.015014491975307465, -0.30412307381629944, -0.21219328045845032, 0.14690840244293213, -0.3801676332950592, -0.11307426542043686, -0.38429704308509827, 0.17333675920963287, -0.00567549467086792, -0.05924506485462189, -0.19764062762260437, -0.09340038895606995, 0.1950654685497284, -0.4064936637878418, -0.0562329925596714, -0.48926854133605957, 0.16215912997722626, -0.4678736925125122, -0.015019897371530533, 0.15141348540782928, -0.7889991998672485, 0.07376639544963837, 0.04906328022480011, 0.004440071061253548, 0.1919279396533966, 0.3100696802139282, -0.2902900278568268, -0.12284907698631287, -0.0004233941435813904, 0.1427394151687622, 0.2366839200258255, -0.21537001430988312, -0.6268244385719299, 0.0864512026309967, 0.03838047385215759, -0.24220477044582367, 0.1674947738647461, -0.17949894070625305, 0.19456103444099426, 0.09760883450508118, -0.10673335194587708, 0.1721334308385849, -0.07684064656496048, 0.04093795269727707, -0.19862762093544006, -0.5216740369796753, 0.2674814760684967, -0.03322679176926613, 0.10352544486522675, -0.39543211460113525, 0.35555097460746765, -0.3969314396381378, 0.29034629464149475, -0.1645258665084839, 0.057519592344760895, 0.33262306451797485, 0.3348727524280548, -0.11456172168254852, 0.021700289100408554, -0.2176801711320877, -0.2977602779865265, 0.1422601044178009, -0.381434828042984, -0.11011587828397751, -0.3259420096874237, -0.1059422641992569, -0.3133503198623657, 0.26993176341056824, 0.05359809473156929, -0.006133888382464647, 0.05970541015267372, 0.057409174740314484, -0.016452211886644363, 0.10308235138654709, -0.03366893529891968, 0.07832518219947815, -0.0958491861820221, 0.19671405851840973, -0.24218088388442993, 0.5291696190834045, -0.3428577184677124, -0.4746672213077545, 0.19328927993774414, -0.0023095812648534775, 0.0374557301402092, -0.06310087442398071, -0.14555492997169495, 0.4702662229537964, -0.028681166470050812, 0.3286389708518982, -0.1707378774881363, 0.084703728556633, 0.21563316881656647, -0.229253888130188, 0.32963529229164124, -0.028982695192098618, 0.08914411067962646, 0.20938627421855927, 0.13785672187805176, 0.16456446051597595, 0.16380859911441803, 0.09281909465789795, 0.12126252800226212, -0.22491805255413055, -0.030612699687480927, 0.13591116666793823, 0.1629302054643631, -0.009373307228088379, 0.04221060499548912, 0.1983906328678131, 0.12568755447864532, 0.1722821295261383, -0.2852168679237366, 0.08072225749492645, 0.42531582713127136, 0.0626024603843689, -0.008041251450777054, 0.1384713351726532, -0.2746993601322174, 0.050757043063640594, 0.36250460147857666, -0.14058038592338562, 0.29622507095336914, 0.3149271309375763, -0.1703774780035019, -0.029386475682258606, -0.0971117913722992, -0.052491623908281326, 0.18679046630859375, 0.13654297590255737, 0.2397942692041397, 0.07676659524440765, 0.623730480670929, 0.04727469012141228, -0.2200196385383606, -0.13672858476638794, 0.04518246650695801, 0.27634674310684204, -0.452684223651886, 0.308177649974823, -0.4269106388092041, -0.0024414435029029846, -0.23781991004943848, -0.154685840010643, -0.3824634552001953, -0.27317434549331665, -0.2290082722902298, 0.3882075548171997, 0.031330808997154236, 0.08750251680612564, -0.023035410791635513, -0.1944246143102646, 0.18350647389888763, -0.17203259468078613, 0.06762979924678802, -0.11229591071605682, -0.3621595501899719, 0.0946991890668869, 0.342587411403656, 0.12063385546207428, 0.19353339076042175, 0.03205987066030502, 0.03860313445329666, -0.05090917646884918, -0.47778546810150146, -0.1438167691230774, -0.025089098140597343, 0.19900289177894592, 0.1817106157541275, 0.11551493406295776, -0.07299236208200455, -0.46838411688804626, 0.057287078350782394, 0.08416453748941422, -0.3447721004486084, 0.1372157782316208, -0.34398332238197327, -0.1998528391122818, -0.0028321966528892517, -0.276289165019989, -0.4295882284641266, -0.3780532479286194, 0.1362106204032898, 0.3020915985107422, 0.23640713095664978, 0.3542707860469818, 0.3423806130886078, 0.01274484395980835, -0.0786948874592781, -0.10726942867040634, 0.23830220103263855, 0.028377175331115723, 0.28393781185150146, -0.07516976445913315, -0.257251501083374, -0.07669791579246521, -0.037464335560798645, 0.08720491826534271, 0.294569194316864, -0.4791855216026306, -0.014134753495454788, -0.3582625985145569, 0.5260703563690186, -0.08312098681926727, 0.14493517577648163, 0.22535274922847748, 0.15895995497703552, -0.004194937646389008, 0.003344491124153137, -0.1563226580619812, -0.26622116565704346, 0.2833780348300934, 0.07547761499881744, 0.055676694959402084, 0.3319579064846039, -0.19856581091880798, 0.6400830745697021, 0.023299410939216614, -0.2738661468029022, 0.4377114176750183, -0.2375326156616211, 0.45192140340805054, -0.10431645810604095, -0.3032712936401367, 0.06629733741283417, -0.10827210545539856, -0.07401157915592194, 0.044195711612701416, -0.22602307796478271, -0.3297971487045288, 0.12052588909864426, -0.18412691354751587, -0.23381878435611725, -0.14523108303546906, 0.09087691456079483, 0.14159071445465088, 0.3312854468822479, -0.08640037477016449, -0.2960985600948334, -0.2364920675754547, -0.21792711317539215, 0.025277383625507355, -0.08264269679784775, -0.22591671347618103, 0.038069967180490494, -0.035965826362371445, -0.13339830935001373, -0.34121182560920715, 0.30971473455429077, 0.17489559948444366, 0.2464342564344406, 0.1721387505531311, -0.0410853810608387, 0.11113014817237854, -0.21800363063812256, 0.32807719707489014, 0.09706304222345352, -0.182765394449234, 0.27574849128723145, 0.40072202682495117, -0.496793270111084, -0.23470546305179596, -0.19102361798286438, 0.27748310565948486, 0.24770592153072357, 0.18386921286582947, -0.3402397632598877, 0.15343794226646423, 0.16168956458568573, 0.5132279396057129, -0.044120822101831436, 0.16416697204113007, -0.27002739906311035, -0.10140333324670792, -0.4776964485645294, -0.10504379123449326, -0.01761382445693016, 0.33137673139572144, 0.005467850714921951, 0.06343299150466919, -0.14889757335186005, -0.24708475172519684, 0.0832427591085434, 0.28902047872543335, 0.3243051767349243, -0.07903829216957092, 0.11278222501277924, -0.31734713912010193, 0.0913165807723999, 0.5340574979782104, 0.7704090476036072, 0.20883658528327942, -0.34903720021247864, -0.016412770375609398, 0.05045154318213463, 0.32675692439079285, 0.11366061866283417, -0.19308175146579742, 0.18378815054893494, -0.11625105142593384, 0.10890750586986542, 0.12137383967638016, 0.04006081819534302, 0.24377843737602234, -0.07671591639518738, -0.2914526164531708, 0.08982376009225845, 0.41707974672317505, -0.03200620412826538, -0.013796605169773102, 0.18926988542079926, 0.4060444235801697, -0.1646333634853363, 0.3946790099143982, 0.03605928644537926, 0.8309652805328369, -0.04272161424160004, 0.0664454996585846, 0.5179725289344788, -0.40474075078964233, 0.16809165477752686, -0.02481294423341751, -0.0014977939426898956, -0.5320702791213989, 0.02998863160610199, 0.010089166462421417, -0.32545042037963867, 0.378400057554245, -0.024959616363048553, -0.2201615273952484, 0.13777568936347961, -0.01617369055747986, 0.21605737507343292, 0.007065225392580032, 0.16433557868003845, -0.0762438178062439, 0.12335334718227386, -0.3094923794269562, 0.09066323190927505, -0.1320367455482483, -0.20527583360671997, -0.05608992651104927, -0.08132266998291016, -0.27471923828125, -0.2721797823905945, -0.2812002897262573, -0.04469974339008331, -0.4894630014896393, 0.2627429664134979, 0.32856354117393494, -0.33071666955947876, 0.3076707124710083, 0.16620312631130219, -0.04406396299600601, 0.13957718014717102, -0.0796767994761467, 0.097402423620224, -0.013216350227594376, -0.056625720113515854, 0.12572379410266876, 0.13607007265090942, 0.10124372690916061, -0.051036760210990906, -0.24735097587108612, 0.3664361834526062, 0.06387249380350113, -0.17888739705085754, 0.14817728102207184, 0.12165239453315735, 0.2961480915546417, -0.3896706700325012, -0.059169575572013855, -0.42517295479774475, 0.09698713570833206, -0.15345673263072968, 0.05929594486951828, -0.1271677315235138, 0.26862481236457825, 0.20056328177452087, 0.013806306757032871, -0.1889253556728363, -0.2841084599494934, 0.4088476896286011, 0.03163333982229233, 0.268120139837265, 0.5743934512138367, 0.2638583779335022, -0.18598122894763947, -0.036853402853012085, 0.12482032179832458, 0.1295132040977478, -0.489487886428833, -0.0472915843129158, -0.09893018007278442, 0.1132626086473465, 0.06401893496513367, 0.03400582820177078, 0.283963680267334, 0.2301625907421112, -0.06152021512389183, -0.3313921093940735, -0.2537413239479065, 0.23526616394519806, 0.0836174413561821, -0.05974213778972626, 0.28060585260391235, 0.17075057327747345, -0.13414418697357178, -0.07644034922122955, -0.24748116731643677, 0.30566567182540894, -0.06656534224748611, 0.2226821929216385, 0.08635172247886658, -0.04553864151239395, -0.05687759071588516, -0.22526873648166656, 0.13118326663970947, 0.01636163704097271, 0.012625876814126968, -0.17638233304023743, -0.16661405563354492, 0.09999198466539383, -0.001013217493891716, -0.08072219789028168, -0.016165312379598618, -0.15215787291526794, -0.011200176551938057, -0.01796279475092888, 0.07604896277189255, -0.01460535079240799, -0.11940799653530121, -0.1400480568408966, 0.2809409499168396, -0.12060108780860901, -0.1210639476776123, 0.23246072232723236, -0.23627105355262756, 0.22578051686286926, 0.059537820518016815, 0.5264185070991516, -0.024768680334091187, 0.03063800185918808, -0.1317235678434372, 0.15129616856575012, -0.34175971150398254, -0.05293168127536774, 0.25683096051216125, -0.3094082772731781, -0.06632181257009506, 0.09374935925006866, 0.23149418830871582, 0.41054677963256836, -0.12172404676675797, -0.08593331277370453, 0.2554229199886322, 0.13186591863632202, -0.3775715231895447, -0.17314814031124115, 0.04951814189553261, -0.10026286542415619, -0.025594010949134827, 0.059920601546764374, 0.3110899329185486, -0.18170717358589172, 0.09042950719594955, 0.34185144305229187, 0.2442220151424408, 0.26974204182624817, -0.0024246424436569214, 0.44836151599884033, 0.012056268751621246, -0.20428091287612915, 0.4182865619659424, 0.1756482720375061, 0.31129884719848633, 0.26551252603530884, -0.21094004809856415, 0.16680176556110382, 0.049634188413619995, -0.19737444818019867, 0.09603322297334671, -0.42627519369125366, -0.19237294793128967, -0.0999845340847969, 0.31498318910598755, -0.061651088297367096, 0.46200695633888245, 0.45272618532180786, 0.27119389176368713, -0.07099601626396179, 0.02905261516571045, 0.3461710214614868, -0.00007067294791340828, 0.0676976889371872, -0.07238531112670898, -0.2340080291032791, -0.2650998830795288, -0.014262579381465912, -0.2551712691783905, -0.24806059896945953, 0.30818596482276917, 0.2364887148141861, -0.3372643291950226, -0.7492637038230896, 0.3052001893520355, 0.1087694764137268, 0.12708932161331177, -0.2866680324077606, 0.35383695363998413, 0.24741961061954498, -0.1135721281170845, -0.10147155821323395, 0.30838122963905334, 0.8915085792541504, 0.31771764159202576, -0.02600981295108795, 0.0024152323603630066, -0.004144560545682907, -0.15640640258789062, 0.04656856507062912, -0.1994176208972931, -0.19490215182304382, 0.4521815776824951, 0.2232360988855362, 0.17558464407920837, -0.14350566267967224, -0.19015607237815857, 0.08037736266851425, -0.002545885741710663, -0.268173485994339, 0.13124673068523407, -0.1365811973810196, -0.20019450783729553, 0.0013935090973973274, -0.0007405504584312439, -0.42817452549934387, -0.00899314135313034, 0.4281740188598633, 0.13380154967308044, 0.11360006779432297, -0.12113121151924133, 0.04415826499462128, 0.045718587934970856, 0.44777101278305054, 0.6064440011978149, 0.13685736060142517, -0.1345338374376297, -0.08647548407316208, -0.42366355657577515, 0.275939404964447, -0.332254558801651, -0.044852398335933685, 0.12691543996334076, 0.20620226860046387, 0.0542919784784317, 0.07830438017845154, 0.27757400274276733, 0.420621782541275, -0.17724910378456116, -0.05108058452606201, -0.332472562789917, -0.10067255795001984, 0.046692438423633575, -0.22204174101352692, -0.12957659363746643, -0.24664458632469177, 0.3911384344100952, -0.2919163107872009, 0.06642098724842072, -0.3800824284553528, -0.14073927700519562, 0.25868332386016846, -0.08691835403442383, 0.45785221457481384, 0.0009060781449079514, 0.41875797510147095, 0.03265461325645447, -0.17067331075668335, -0.3290652632713318, -0.3339603543281555, -0.28833654522895813, 0.3402409255504608, -0.05063445493578911, 0.4427412152290344, -0.18638867139816284, -0.3720743954181671, -0.10302574187517166, 0.2508411407470703, -0.09061776846647263, 0.15800976753234863, 0.19902543723583221, 0.03442266583442688, 0.0075860098004341125, 0.01790967583656311, -0.08486709743738174, -0.08275871723890305, 0.09513992816209793, 0.16722926497459412, -0.2761419415473938, -0.6448034048080444, 0.241926908493042, -0.2260374277830124, -0.20503024756908417, 0.04457248002290726, 0.05650459975004196, 0.17781129479408264, 0.026200050488114357, -0.4378465712070465, 0.234495609998703, 0.40572476387023926, -0.15454722940921783, -0.12775224447250366, 0.18590374290943146, 0.10264274477958679, 0.14742787182331085, -0.025282561779022217, 0.3295576870441437, -0.06774131953716278, -0.28767818212509155, -0.11397577822208405, -0.18642500042915344 ]
https://github.com/huggingface/datasets/issues/5923
I got the same error, pyarrow 12.0.0 released May/2023 (https://pypi.org/project/pyarrow/) is not compatible, running `pip install pyarrow==11.0.0` to force install the previous version solved the problem. Do we need to update dependencies?
Cannot import datasets - ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility
### Describe the bug When trying to import datasets, I get a pyarrow ValueError: Traceback (most recent call last): File "/Users/edward/test/test.py", line 1, in <module> import datasets File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module> from .arrow_dataset import Dataset File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 65, in <module> from .arrow_reader import ArrowReader File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_reader.py", line 28, in <module> import pyarrow.parquet as pq File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/__init__.py", line 20, in <module> from .core import * File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/core.py", line 45, in <module> from pyarrow.fs import (LocalFileSystem, FileSystem, FileType, File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/fs.py", line 49, in <module> from pyarrow._gcsfs import GcsFileSystem # noqa File "pyarrow/_gcsfs.pyx", line 1, in init pyarrow._gcsfs ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject ### Steps to reproduce the bug `import datasets` ### Expected behavior Successful import ### Environment info Conda environment, MacOS python 3.9.12 datasets 2.12.0
32
Cannot import datasets - ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility ### Describe the bug When trying to import datasets, I get a pyarrow ValueError: Traceback (most recent call last): File "/Users/edward/test/test.py", line 1, in <module> import datasets File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module> from .arrow_dataset import Dataset File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 65, in <module> from .arrow_reader import ArrowReader File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_reader.py", line 28, in <module> import pyarrow.parquet as pq File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/__init__.py", line 20, in <module> from .core import * File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/core.py", line 45, in <module> from pyarrow.fs import (LocalFileSystem, FileSystem, FileType, File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/fs.py", line 49, in <module> from pyarrow._gcsfs import GcsFileSystem # noqa File "pyarrow/_gcsfs.pyx", line 1, in init pyarrow._gcsfs ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject ### Steps to reproduce the bug `import datasets` ### Expected behavior Successful import ### Environment info Conda environment, MacOS python 3.9.12 datasets 2.12.0 I got the same error, pyarrow 12.0.0 released May/2023 (https://pypi.org/project/pyarrow/) is not compatible, running `pip install pyarrow==11.0.0` to force install the previous version solved the problem. Do we need to update dependencies?
[ -0.5389391183853149, 0.41014090180397034, -0.09792473912239075, 0.2319422960281372, 0.14288535714149475, -0.13102033734321594, 0.21223437786102295, 0.2684710919857025, -0.408712774515152, 0.09050598740577698, -0.20407867431640625, 0.27507221698760986, -0.12025684118270874, 0.1409701108932495, -0.16671998798847198, 0.01760251820087433, 0.05824655294418335, 0.2816929221153259, -0.1661183387041092, 0.113141730427742, -0.10728545486927032, 0.16610445082187653, -0.21358206868171692, 0.11508075147867203, 0.011453785002231598, -0.10817255824804306, -0.14227774739265442, 0.24949845671653748, -0.43753454089164734, -0.7070934176445007, 0.3522906005382538, -0.086106076836586, 0.07033614069223404, 0.4895254969596863, -0.00011616970732575282, 0.18690964579582214, 0.2657691538333893, 0.06419306993484497, -0.253903865814209, -0.07424189150333405, 0.06377491354942322, -0.2764390707015991, 0.26972654461860657, -0.11235450953245163, 0.3193272650241852, -0.5484874248504639, 0.06671421974897385, 0.16740885376930237, 0.054839521646499634, 0.40047457814216614, 0.19530938565731049, 0.38214990496635437, 0.6554259061813354, 0.1227761059999466, 0.5305083990097046, 0.04909924045205116, 0.03578562289476395, 0.5898970365524292, 0.2579425871372223, 0.05691107362508774, 0.0021759532392024994, -0.20591427385807037, -0.1010093167424202, -0.048358254134655, 0.15855109691619873, -0.18132737278938293, -0.03536137938499451, -0.18852782249450684, -0.06856274604797363, -0.08543333411216736, 0.4250427186489105, -0.5830304026603699, -0.302016019821167, -0.09135070443153381, 0.10421205312013626, -0.45955967903137207, 0.28538691997528076, 0.21514496207237244, 0.1239168643951416, 0.22662369906902313, -0.08318190276622772, -0.12021125853061676, -0.3959175944328308, 0.18164576590061188, -0.32514679431915283, 0.24191302061080933, 0.029269661754369736, 0.19708991050720215, 0.00875172670930624, -0.18387901782989502, 0.42467594146728516, -0.02596220001578331, -0.23255464434623718, 0.08952406048774719, -0.22075620293617249, 0.081318199634552, 0.020974012091755867, 0.13495442271232605, -0.04143968224525452, 0.02640334889292717, -0.058164432644844055, -0.15183407068252563, -0.033698271960020065, 0.33083441853523254, 0.024396397173404694, 0.05486329272389412, -0.12570367753505707, 0.2684255838394165, 0.1664728820323944, 0.1868094801902771, -0.005677856504917145, -0.02999785915017128, -0.04185599088668823, -0.3846703767776489, 0.08216149359941483, 0.0356256403028965, 0.4344305098056793, -0.1588757187128067, -0.29218998551368713, -0.012626070529222488, -0.25384315848350525, 0.026433870196342468, -0.17737063765525818, 0.2993183434009552, -0.01885107159614563, 0.2504885196685791, 0.1386951059103012, 0.2536332607269287, -0.11470460891723633, -0.23161382973194122, -0.05686569958925247, 0.10283129662275314, -0.0738179013133049, -0.22125279903411865, 0.08629242330789566, -0.1755020022392273, 0.13045690953731537, 0.12832950055599213, 0.1933923065662384, 0.12288786470890045, -0.06554929167032242, -0.24240773916244507, -0.04746447876095772, 0.31247541308403015, -0.03729112073779106, 0.10041829198598862, 0.015014491975307465, -0.30412307381629944, -0.21219328045845032, 0.14690840244293213, -0.3801676332950592, -0.11307426542043686, -0.38429704308509827, 0.17333675920963287, -0.00567549467086792, -0.05924506485462189, -0.19764062762260437, -0.09340038895606995, 0.1950654685497284, -0.4064936637878418, -0.0562329925596714, -0.48926854133605957, 0.16215912997722626, -0.4678736925125122, -0.015019897371530533, 0.15141348540782928, -0.7889991998672485, 0.07376639544963837, 0.04906328022480011, 0.004440071061253548, 0.1919279396533966, 0.3100696802139282, -0.2902900278568268, -0.12284907698631287, -0.0004233941435813904, 0.1427394151687622, 0.2366839200258255, -0.21537001430988312, -0.6268244385719299, 0.0864512026309967, 0.03838047385215759, -0.24220477044582367, 0.1674947738647461, -0.17949894070625305, 0.19456103444099426, 0.09760883450508118, -0.10673335194587708, 0.1721334308385849, -0.07684064656496048, 0.04093795269727707, -0.19862762093544006, -0.5216740369796753, 0.2674814760684967, -0.03322679176926613, 0.10352544486522675, -0.39543211460113525, 0.35555097460746765, -0.3969314396381378, 0.29034629464149475, -0.1645258665084839, 0.057519592344760895, 0.33262306451797485, 0.3348727524280548, -0.11456172168254852, 0.021700289100408554, -0.2176801711320877, -0.2977602779865265, 0.1422601044178009, -0.381434828042984, -0.11011587828397751, -0.3259420096874237, -0.1059422641992569, -0.3133503198623657, 0.26993176341056824, 0.05359809473156929, -0.006133888382464647, 0.05970541015267372, 0.057409174740314484, -0.016452211886644363, 0.10308235138654709, -0.03366893529891968, 0.07832518219947815, -0.0958491861820221, 0.19671405851840973, -0.24218088388442993, 0.5291696190834045, -0.3428577184677124, -0.4746672213077545, 0.19328927993774414, -0.0023095812648534775, 0.0374557301402092, -0.06310087442398071, -0.14555492997169495, 0.4702662229537964, -0.028681166470050812, 0.3286389708518982, -0.1707378774881363, 0.084703728556633, 0.21563316881656647, -0.229253888130188, 0.32963529229164124, -0.028982695192098618, 0.08914411067962646, 0.20938627421855927, 0.13785672187805176, 0.16456446051597595, 0.16380859911441803, 0.09281909465789795, 0.12126252800226212, -0.22491805255413055, -0.030612699687480927, 0.13591116666793823, 0.1629302054643631, -0.009373307228088379, 0.04221060499548912, 0.1983906328678131, 0.12568755447864532, 0.1722821295261383, -0.2852168679237366, 0.08072225749492645, 0.42531582713127136, 0.0626024603843689, -0.008041251450777054, 0.1384713351726532, -0.2746993601322174, 0.050757043063640594, 0.36250460147857666, -0.14058038592338562, 0.29622507095336914, 0.3149271309375763, -0.1703774780035019, -0.029386475682258606, -0.0971117913722992, -0.052491623908281326, 0.18679046630859375, 0.13654297590255737, 0.2397942692041397, 0.07676659524440765, 0.623730480670929, 0.04727469012141228, -0.2200196385383606, -0.13672858476638794, 0.04518246650695801, 0.27634674310684204, -0.452684223651886, 0.308177649974823, -0.4269106388092041, -0.0024414435029029846, -0.23781991004943848, -0.154685840010643, -0.3824634552001953, -0.27317434549331665, -0.2290082722902298, 0.3882075548171997, 0.031330808997154236, 0.08750251680612564, -0.023035410791635513, -0.1944246143102646, 0.18350647389888763, -0.17203259468078613, 0.06762979924678802, -0.11229591071605682, -0.3621595501899719, 0.0946991890668869, 0.342587411403656, 0.12063385546207428, 0.19353339076042175, 0.03205987066030502, 0.03860313445329666, -0.05090917646884918, -0.47778546810150146, -0.1438167691230774, -0.025089098140597343, 0.19900289177894592, 0.1817106157541275, 0.11551493406295776, -0.07299236208200455, -0.46838411688804626, 0.057287078350782394, 0.08416453748941422, -0.3447721004486084, 0.1372157782316208, -0.34398332238197327, -0.1998528391122818, -0.0028321966528892517, -0.276289165019989, -0.4295882284641266, -0.3780532479286194, 0.1362106204032898, 0.3020915985107422, 0.23640713095664978, 0.3542707860469818, 0.3423806130886078, 0.01274484395980835, -0.0786948874592781, -0.10726942867040634, 0.23830220103263855, 0.028377175331115723, 0.28393781185150146, -0.07516976445913315, -0.257251501083374, -0.07669791579246521, -0.037464335560798645, 0.08720491826534271, 0.294569194316864, -0.4791855216026306, -0.014134753495454788, -0.3582625985145569, 0.5260703563690186, -0.08312098681926727, 0.14493517577648163, 0.22535274922847748, 0.15895995497703552, -0.004194937646389008, 0.003344491124153137, -0.1563226580619812, -0.26622116565704346, 0.2833780348300934, 0.07547761499881744, 0.055676694959402084, 0.3319579064846039, -0.19856581091880798, 0.6400830745697021, 0.023299410939216614, -0.2738661468029022, 0.4377114176750183, -0.2375326156616211, 0.45192140340805054, -0.10431645810604095, -0.3032712936401367, 0.06629733741283417, -0.10827210545539856, -0.07401157915592194, 0.044195711612701416, -0.22602307796478271, -0.3297971487045288, 0.12052588909864426, -0.18412691354751587, -0.23381878435611725, -0.14523108303546906, 0.09087691456079483, 0.14159071445465088, 0.3312854468822479, -0.08640037477016449, -0.2960985600948334, -0.2364920675754547, -0.21792711317539215, 0.025277383625507355, -0.08264269679784775, -0.22591671347618103, 0.038069967180490494, -0.035965826362371445, -0.13339830935001373, -0.34121182560920715, 0.30971473455429077, 0.17489559948444366, 0.2464342564344406, 0.1721387505531311, -0.0410853810608387, 0.11113014817237854, -0.21800363063812256, 0.32807719707489014, 0.09706304222345352, -0.182765394449234, 0.27574849128723145, 0.40072202682495117, -0.496793270111084, -0.23470546305179596, -0.19102361798286438, 0.27748310565948486, 0.24770592153072357, 0.18386921286582947, -0.3402397632598877, 0.15343794226646423, 0.16168956458568573, 0.5132279396057129, -0.044120822101831436, 0.16416697204113007, -0.27002739906311035, -0.10140333324670792, -0.4776964485645294, -0.10504379123449326, -0.01761382445693016, 0.33137673139572144, 0.005467850714921951, 0.06343299150466919, -0.14889757335186005, -0.24708475172519684, 0.0832427591085434, 0.28902047872543335, 0.3243051767349243, -0.07903829216957092, 0.11278222501277924, -0.31734713912010193, 0.0913165807723999, 0.5340574979782104, 0.7704090476036072, 0.20883658528327942, -0.34903720021247864, -0.016412770375609398, 0.05045154318213463, 0.32675692439079285, 0.11366061866283417, -0.19308175146579742, 0.18378815054893494, -0.11625105142593384, 0.10890750586986542, 0.12137383967638016, 0.04006081819534302, 0.24377843737602234, -0.07671591639518738, -0.2914526164531708, 0.08982376009225845, 0.41707974672317505, -0.03200620412826538, -0.013796605169773102, 0.18926988542079926, 0.4060444235801697, -0.1646333634853363, 0.3946790099143982, 0.03605928644537926, 0.8309652805328369, -0.04272161424160004, 0.0664454996585846, 0.5179725289344788, -0.40474075078964233, 0.16809165477752686, -0.02481294423341751, -0.0014977939426898956, -0.5320702791213989, 0.02998863160610199, 0.010089166462421417, -0.32545042037963867, 0.378400057554245, -0.024959616363048553, -0.2201615273952484, 0.13777568936347961, -0.01617369055747986, 0.21605737507343292, 0.007065225392580032, 0.16433557868003845, -0.0762438178062439, 0.12335334718227386, -0.3094923794269562, 0.09066323190927505, -0.1320367455482483, -0.20527583360671997, -0.05608992651104927, -0.08132266998291016, -0.27471923828125, -0.2721797823905945, -0.2812002897262573, -0.04469974339008331, -0.4894630014896393, 0.2627429664134979, 0.32856354117393494, -0.33071666955947876, 0.3076707124710083, 0.16620312631130219, -0.04406396299600601, 0.13957718014717102, -0.0796767994761467, 0.097402423620224, -0.013216350227594376, -0.056625720113515854, 0.12572379410266876, 0.13607007265090942, 0.10124372690916061, -0.051036760210990906, -0.24735097587108612, 0.3664361834526062, 0.06387249380350113, -0.17888739705085754, 0.14817728102207184, 0.12165239453315735, 0.2961480915546417, -0.3896706700325012, -0.059169575572013855, -0.42517295479774475, 0.09698713570833206, -0.15345673263072968, 0.05929594486951828, -0.1271677315235138, 0.26862481236457825, 0.20056328177452087, 0.013806306757032871, -0.1889253556728363, -0.2841084599494934, 0.4088476896286011, 0.03163333982229233, 0.268120139837265, 0.5743934512138367, 0.2638583779335022, -0.18598122894763947, -0.036853402853012085, 0.12482032179832458, 0.1295132040977478, -0.489487886428833, -0.0472915843129158, -0.09893018007278442, 0.1132626086473465, 0.06401893496513367, 0.03400582820177078, 0.283963680267334, 0.2301625907421112, -0.06152021512389183, -0.3313921093940735, -0.2537413239479065, 0.23526616394519806, 0.0836174413561821, -0.05974213778972626, 0.28060585260391235, 0.17075057327747345, -0.13414418697357178, -0.07644034922122955, -0.24748116731643677, 0.30566567182540894, -0.06656534224748611, 0.2226821929216385, 0.08635172247886658, -0.04553864151239395, -0.05687759071588516, -0.22526873648166656, 0.13118326663970947, 0.01636163704097271, 0.012625876814126968, -0.17638233304023743, -0.16661405563354492, 0.09999198466539383, -0.001013217493891716, -0.08072219789028168, -0.016165312379598618, -0.15215787291526794, -0.011200176551938057, -0.01796279475092888, 0.07604896277189255, -0.01460535079240799, -0.11940799653530121, -0.1400480568408966, 0.2809409499168396, -0.12060108780860901, -0.1210639476776123, 0.23246072232723236, -0.23627105355262756, 0.22578051686286926, 0.059537820518016815, 0.5264185070991516, -0.024768680334091187, 0.03063800185918808, -0.1317235678434372, 0.15129616856575012, -0.34175971150398254, -0.05293168127536774, 0.25683096051216125, -0.3094082772731781, -0.06632181257009506, 0.09374935925006866, 0.23149418830871582, 0.41054677963256836, -0.12172404676675797, -0.08593331277370453, 0.2554229199886322, 0.13186591863632202, -0.3775715231895447, -0.17314814031124115, 0.04951814189553261, -0.10026286542415619, -0.025594010949134827, 0.059920601546764374, 0.3110899329185486, -0.18170717358589172, 0.09042950719594955, 0.34185144305229187, 0.2442220151424408, 0.26974204182624817, -0.0024246424436569214, 0.44836151599884033, 0.012056268751621246, -0.20428091287612915, 0.4182865619659424, 0.1756482720375061, 0.31129884719848633, 0.26551252603530884, -0.21094004809856415, 0.16680176556110382, 0.049634188413619995, -0.19737444818019867, 0.09603322297334671, -0.42627519369125366, -0.19237294793128967, -0.0999845340847969, 0.31498318910598755, -0.061651088297367096, 0.46200695633888245, 0.45272618532180786, 0.27119389176368713, -0.07099601626396179, 0.02905261516571045, 0.3461710214614868, -0.00007067294791340828, 0.0676976889371872, -0.07238531112670898, -0.2340080291032791, -0.2650998830795288, -0.014262579381465912, -0.2551712691783905, -0.24806059896945953, 0.30818596482276917, 0.2364887148141861, -0.3372643291950226, -0.7492637038230896, 0.3052001893520355, 0.1087694764137268, 0.12708932161331177, -0.2866680324077606, 0.35383695363998413, 0.24741961061954498, -0.1135721281170845, -0.10147155821323395, 0.30838122963905334, 0.8915085792541504, 0.31771764159202576, -0.02600981295108795, 0.0024152323603630066, -0.004144560545682907, -0.15640640258789062, 0.04656856507062912, -0.1994176208972931, -0.19490215182304382, 0.4521815776824951, 0.2232360988855362, 0.17558464407920837, -0.14350566267967224, -0.19015607237815857, 0.08037736266851425, -0.002545885741710663, -0.268173485994339, 0.13124673068523407, -0.1365811973810196, -0.20019450783729553, 0.0013935090973973274, -0.0007405504584312439, -0.42817452549934387, -0.00899314135313034, 0.4281740188598633, 0.13380154967308044, 0.11360006779432297, -0.12113121151924133, 0.04415826499462128, 0.045718587934970856, 0.44777101278305054, 0.6064440011978149, 0.13685736060142517, -0.1345338374376297, -0.08647548407316208, -0.42366355657577515, 0.275939404964447, -0.332254558801651, -0.044852398335933685, 0.12691543996334076, 0.20620226860046387, 0.0542919784784317, 0.07830438017845154, 0.27757400274276733, 0.420621782541275, -0.17724910378456116, -0.05108058452606201, -0.332472562789917, -0.10067255795001984, 0.046692438423633575, -0.22204174101352692, -0.12957659363746643, -0.24664458632469177, 0.3911384344100952, -0.2919163107872009, 0.06642098724842072, -0.3800824284553528, -0.14073927700519562, 0.25868332386016846, -0.08691835403442383, 0.45785221457481384, 0.0009060781449079514, 0.41875797510147095, 0.03265461325645447, -0.17067331075668335, -0.3290652632713318, -0.3339603543281555, -0.28833654522895813, 0.3402409255504608, -0.05063445493578911, 0.4427412152290344, -0.18638867139816284, -0.3720743954181671, -0.10302574187517166, 0.2508411407470703, -0.09061776846647263, 0.15800976753234863, 0.19902543723583221, 0.03442266583442688, 0.0075860098004341125, 0.01790967583656311, -0.08486709743738174, -0.08275871723890305, 0.09513992816209793, 0.16722926497459412, -0.2761419415473938, -0.6448034048080444, 0.241926908493042, -0.2260374277830124, -0.20503024756908417, 0.04457248002290726, 0.05650459975004196, 0.17781129479408264, 0.026200050488114357, -0.4378465712070465, 0.234495609998703, 0.40572476387023926, -0.15454722940921783, -0.12775224447250366, 0.18590374290943146, 0.10264274477958679, 0.14742787182331085, -0.025282561779022217, 0.3295576870441437, -0.06774131953716278, -0.28767818212509155, -0.11397577822208405, -0.18642500042915344 ]
https://github.com/huggingface/datasets/issues/5923
Please note that our CI properly passes all tests with `pyarrow-12.0.0`, for Python 3.7 and Python 3.10, for Ubuntu and Windows: see for example https://github.com/huggingface/datasets/actions/runs/5157324334/jobs/9289582291
Cannot import datasets - ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility
### Describe the bug When trying to import datasets, I get a pyarrow ValueError: Traceback (most recent call last): File "/Users/edward/test/test.py", line 1, in <module> import datasets File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module> from .arrow_dataset import Dataset File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 65, in <module> from .arrow_reader import ArrowReader File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_reader.py", line 28, in <module> import pyarrow.parquet as pq File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/__init__.py", line 20, in <module> from .core import * File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/core.py", line 45, in <module> from pyarrow.fs import (LocalFileSystem, FileSystem, FileType, File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/fs.py", line 49, in <module> from pyarrow._gcsfs import GcsFileSystem # noqa File "pyarrow/_gcsfs.pyx", line 1, in init pyarrow._gcsfs ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject ### Steps to reproduce the bug `import datasets` ### Expected behavior Successful import ### Environment info Conda environment, MacOS python 3.9.12 datasets 2.12.0
25
Cannot import datasets - ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility ### Describe the bug When trying to import datasets, I get a pyarrow ValueError: Traceback (most recent call last): File "/Users/edward/test/test.py", line 1, in <module> import datasets File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module> from .arrow_dataset import Dataset File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 65, in <module> from .arrow_reader import ArrowReader File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_reader.py", line 28, in <module> import pyarrow.parquet as pq File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/__init__.py", line 20, in <module> from .core import * File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/core.py", line 45, in <module> from pyarrow.fs import (LocalFileSystem, FileSystem, FileType, File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/fs.py", line 49, in <module> from pyarrow._gcsfs import GcsFileSystem # noqa File "pyarrow/_gcsfs.pyx", line 1, in init pyarrow._gcsfs ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject ### Steps to reproduce the bug `import datasets` ### Expected behavior Successful import ### Environment info Conda environment, MacOS python 3.9.12 datasets 2.12.0 Please note that our CI properly passes all tests with `pyarrow-12.0.0`, for Python 3.7 and Python 3.10, for Ubuntu and Windows: see for example https://github.com/huggingface/datasets/actions/runs/5157324334/jobs/9289582291
[ -0.5389391183853149, 0.41014090180397034, -0.09792473912239075, 0.2319422960281372, 0.14288535714149475, -0.13102033734321594, 0.21223437786102295, 0.2684710919857025, -0.408712774515152, 0.09050598740577698, -0.20407867431640625, 0.27507221698760986, -0.12025684118270874, 0.1409701108932495, -0.16671998798847198, 0.01760251820087433, 0.05824655294418335, 0.2816929221153259, -0.1661183387041092, 0.113141730427742, -0.10728545486927032, 0.16610445082187653, -0.21358206868171692, 0.11508075147867203, 0.011453785002231598, -0.10817255824804306, -0.14227774739265442, 0.24949845671653748, -0.43753454089164734, -0.7070934176445007, 0.3522906005382538, -0.086106076836586, 0.07033614069223404, 0.4895254969596863, -0.00011616970732575282, 0.18690964579582214, 0.2657691538333893, 0.06419306993484497, -0.253903865814209, -0.07424189150333405, 0.06377491354942322, -0.2764390707015991, 0.26972654461860657, -0.11235450953245163, 0.3193272650241852, -0.5484874248504639, 0.06671421974897385, 0.16740885376930237, 0.054839521646499634, 0.40047457814216614, 0.19530938565731049, 0.38214990496635437, 0.6554259061813354, 0.1227761059999466, 0.5305083990097046, 0.04909924045205116, 0.03578562289476395, 0.5898970365524292, 0.2579425871372223, 0.05691107362508774, 0.0021759532392024994, -0.20591427385807037, -0.1010093167424202, -0.048358254134655, 0.15855109691619873, -0.18132737278938293, -0.03536137938499451, -0.18852782249450684, -0.06856274604797363, -0.08543333411216736, 0.4250427186489105, -0.5830304026603699, -0.302016019821167, -0.09135070443153381, 0.10421205312013626, -0.45955967903137207, 0.28538691997528076, 0.21514496207237244, 0.1239168643951416, 0.22662369906902313, -0.08318190276622772, -0.12021125853061676, -0.3959175944328308, 0.18164576590061188, -0.32514679431915283, 0.24191302061080933, 0.029269661754369736, 0.19708991050720215, 0.00875172670930624, -0.18387901782989502, 0.42467594146728516, -0.02596220001578331, -0.23255464434623718, 0.08952406048774719, -0.22075620293617249, 0.081318199634552, 0.020974012091755867, 0.13495442271232605, -0.04143968224525452, 0.02640334889292717, -0.058164432644844055, -0.15183407068252563, -0.033698271960020065, 0.33083441853523254, 0.024396397173404694, 0.05486329272389412, -0.12570367753505707, 0.2684255838394165, 0.1664728820323944, 0.1868094801902771, -0.005677856504917145, -0.02999785915017128, -0.04185599088668823, -0.3846703767776489, 0.08216149359941483, 0.0356256403028965, 0.4344305098056793, -0.1588757187128067, -0.29218998551368713, -0.012626070529222488, -0.25384315848350525, 0.026433870196342468, -0.17737063765525818, 0.2993183434009552, -0.01885107159614563, 0.2504885196685791, 0.1386951059103012, 0.2536332607269287, -0.11470460891723633, -0.23161382973194122, -0.05686569958925247, 0.10283129662275314, -0.0738179013133049, -0.22125279903411865, 0.08629242330789566, -0.1755020022392273, 0.13045690953731537, 0.12832950055599213, 0.1933923065662384, 0.12288786470890045, -0.06554929167032242, -0.24240773916244507, -0.04746447876095772, 0.31247541308403015, -0.03729112073779106, 0.10041829198598862, 0.015014491975307465, -0.30412307381629944, -0.21219328045845032, 0.14690840244293213, -0.3801676332950592, -0.11307426542043686, -0.38429704308509827, 0.17333675920963287, -0.00567549467086792, -0.05924506485462189, -0.19764062762260437, -0.09340038895606995, 0.1950654685497284, -0.4064936637878418, -0.0562329925596714, -0.48926854133605957, 0.16215912997722626, -0.4678736925125122, -0.015019897371530533, 0.15141348540782928, -0.7889991998672485, 0.07376639544963837, 0.04906328022480011, 0.004440071061253548, 0.1919279396533966, 0.3100696802139282, -0.2902900278568268, -0.12284907698631287, -0.0004233941435813904, 0.1427394151687622, 0.2366839200258255, -0.21537001430988312, -0.6268244385719299, 0.0864512026309967, 0.03838047385215759, -0.24220477044582367, 0.1674947738647461, -0.17949894070625305, 0.19456103444099426, 0.09760883450508118, -0.10673335194587708, 0.1721334308385849, -0.07684064656496048, 0.04093795269727707, -0.19862762093544006, -0.5216740369796753, 0.2674814760684967, -0.03322679176926613, 0.10352544486522675, -0.39543211460113525, 0.35555097460746765, -0.3969314396381378, 0.29034629464149475, -0.1645258665084839, 0.057519592344760895, 0.33262306451797485, 0.3348727524280548, -0.11456172168254852, 0.021700289100408554, -0.2176801711320877, -0.2977602779865265, 0.1422601044178009, -0.381434828042984, -0.11011587828397751, -0.3259420096874237, -0.1059422641992569, -0.3133503198623657, 0.26993176341056824, 0.05359809473156929, -0.006133888382464647, 0.05970541015267372, 0.057409174740314484, -0.016452211886644363, 0.10308235138654709, -0.03366893529891968, 0.07832518219947815, -0.0958491861820221, 0.19671405851840973, -0.24218088388442993, 0.5291696190834045, -0.3428577184677124, -0.4746672213077545, 0.19328927993774414, -0.0023095812648534775, 0.0374557301402092, -0.06310087442398071, -0.14555492997169495, 0.4702662229537964, -0.028681166470050812, 0.3286389708518982, -0.1707378774881363, 0.084703728556633, 0.21563316881656647, -0.229253888130188, 0.32963529229164124, -0.028982695192098618, 0.08914411067962646, 0.20938627421855927, 0.13785672187805176, 0.16456446051597595, 0.16380859911441803, 0.09281909465789795, 0.12126252800226212, -0.22491805255413055, -0.030612699687480927, 0.13591116666793823, 0.1629302054643631, -0.009373307228088379, 0.04221060499548912, 0.1983906328678131, 0.12568755447864532, 0.1722821295261383, -0.2852168679237366, 0.08072225749492645, 0.42531582713127136, 0.0626024603843689, -0.008041251450777054, 0.1384713351726532, -0.2746993601322174, 0.050757043063640594, 0.36250460147857666, -0.14058038592338562, 0.29622507095336914, 0.3149271309375763, -0.1703774780035019, -0.029386475682258606, -0.0971117913722992, -0.052491623908281326, 0.18679046630859375, 0.13654297590255737, 0.2397942692041397, 0.07676659524440765, 0.623730480670929, 0.04727469012141228, -0.2200196385383606, -0.13672858476638794, 0.04518246650695801, 0.27634674310684204, -0.452684223651886, 0.308177649974823, -0.4269106388092041, -0.0024414435029029846, -0.23781991004943848, -0.154685840010643, -0.3824634552001953, -0.27317434549331665, -0.2290082722902298, 0.3882075548171997, 0.031330808997154236, 0.08750251680612564, -0.023035410791635513, -0.1944246143102646, 0.18350647389888763, -0.17203259468078613, 0.06762979924678802, -0.11229591071605682, -0.3621595501899719, 0.0946991890668869, 0.342587411403656, 0.12063385546207428, 0.19353339076042175, 0.03205987066030502, 0.03860313445329666, -0.05090917646884918, -0.47778546810150146, -0.1438167691230774, -0.025089098140597343, 0.19900289177894592, 0.1817106157541275, 0.11551493406295776, -0.07299236208200455, -0.46838411688804626, 0.057287078350782394, 0.08416453748941422, -0.3447721004486084, 0.1372157782316208, -0.34398332238197327, -0.1998528391122818, -0.0028321966528892517, -0.276289165019989, -0.4295882284641266, -0.3780532479286194, 0.1362106204032898, 0.3020915985107422, 0.23640713095664978, 0.3542707860469818, 0.3423806130886078, 0.01274484395980835, -0.0786948874592781, -0.10726942867040634, 0.23830220103263855, 0.028377175331115723, 0.28393781185150146, -0.07516976445913315, -0.257251501083374, -0.07669791579246521, -0.037464335560798645, 0.08720491826534271, 0.294569194316864, -0.4791855216026306, -0.014134753495454788, -0.3582625985145569, 0.5260703563690186, -0.08312098681926727, 0.14493517577648163, 0.22535274922847748, 0.15895995497703552, -0.004194937646389008, 0.003344491124153137, -0.1563226580619812, -0.26622116565704346, 0.2833780348300934, 0.07547761499881744, 0.055676694959402084, 0.3319579064846039, -0.19856581091880798, 0.6400830745697021, 0.023299410939216614, -0.2738661468029022, 0.4377114176750183, -0.2375326156616211, 0.45192140340805054, -0.10431645810604095, -0.3032712936401367, 0.06629733741283417, -0.10827210545539856, -0.07401157915592194, 0.044195711612701416, -0.22602307796478271, -0.3297971487045288, 0.12052588909864426, -0.18412691354751587, -0.23381878435611725, -0.14523108303546906, 0.09087691456079483, 0.14159071445465088, 0.3312854468822479, -0.08640037477016449, -0.2960985600948334, -0.2364920675754547, -0.21792711317539215, 0.025277383625507355, -0.08264269679784775, -0.22591671347618103, 0.038069967180490494, -0.035965826362371445, -0.13339830935001373, -0.34121182560920715, 0.30971473455429077, 0.17489559948444366, 0.2464342564344406, 0.1721387505531311, -0.0410853810608387, 0.11113014817237854, -0.21800363063812256, 0.32807719707489014, 0.09706304222345352, -0.182765394449234, 0.27574849128723145, 0.40072202682495117, -0.496793270111084, -0.23470546305179596, -0.19102361798286438, 0.27748310565948486, 0.24770592153072357, 0.18386921286582947, -0.3402397632598877, 0.15343794226646423, 0.16168956458568573, 0.5132279396057129, -0.044120822101831436, 0.16416697204113007, -0.27002739906311035, -0.10140333324670792, -0.4776964485645294, -0.10504379123449326, -0.01761382445693016, 0.33137673139572144, 0.005467850714921951, 0.06343299150466919, -0.14889757335186005, -0.24708475172519684, 0.0832427591085434, 0.28902047872543335, 0.3243051767349243, -0.07903829216957092, 0.11278222501277924, -0.31734713912010193, 0.0913165807723999, 0.5340574979782104, 0.7704090476036072, 0.20883658528327942, -0.34903720021247864, -0.016412770375609398, 0.05045154318213463, 0.32675692439079285, 0.11366061866283417, -0.19308175146579742, 0.18378815054893494, -0.11625105142593384, 0.10890750586986542, 0.12137383967638016, 0.04006081819534302, 0.24377843737602234, -0.07671591639518738, -0.2914526164531708, 0.08982376009225845, 0.41707974672317505, -0.03200620412826538, -0.013796605169773102, 0.18926988542079926, 0.4060444235801697, -0.1646333634853363, 0.3946790099143982, 0.03605928644537926, 0.8309652805328369, -0.04272161424160004, 0.0664454996585846, 0.5179725289344788, -0.40474075078964233, 0.16809165477752686, -0.02481294423341751, -0.0014977939426898956, -0.5320702791213989, 0.02998863160610199, 0.010089166462421417, -0.32545042037963867, 0.378400057554245, -0.024959616363048553, -0.2201615273952484, 0.13777568936347961, -0.01617369055747986, 0.21605737507343292, 0.007065225392580032, 0.16433557868003845, -0.0762438178062439, 0.12335334718227386, -0.3094923794269562, 0.09066323190927505, -0.1320367455482483, -0.20527583360671997, -0.05608992651104927, -0.08132266998291016, -0.27471923828125, -0.2721797823905945, -0.2812002897262573, -0.04469974339008331, -0.4894630014896393, 0.2627429664134979, 0.32856354117393494, -0.33071666955947876, 0.3076707124710083, 0.16620312631130219, -0.04406396299600601, 0.13957718014717102, -0.0796767994761467, 0.097402423620224, -0.013216350227594376, -0.056625720113515854, 0.12572379410266876, 0.13607007265090942, 0.10124372690916061, -0.051036760210990906, -0.24735097587108612, 0.3664361834526062, 0.06387249380350113, -0.17888739705085754, 0.14817728102207184, 0.12165239453315735, 0.2961480915546417, -0.3896706700325012, -0.059169575572013855, -0.42517295479774475, 0.09698713570833206, -0.15345673263072968, 0.05929594486951828, -0.1271677315235138, 0.26862481236457825, 0.20056328177452087, 0.013806306757032871, -0.1889253556728363, -0.2841084599494934, 0.4088476896286011, 0.03163333982229233, 0.268120139837265, 0.5743934512138367, 0.2638583779335022, -0.18598122894763947, -0.036853402853012085, 0.12482032179832458, 0.1295132040977478, -0.489487886428833, -0.0472915843129158, -0.09893018007278442, 0.1132626086473465, 0.06401893496513367, 0.03400582820177078, 0.283963680267334, 0.2301625907421112, -0.06152021512389183, -0.3313921093940735, -0.2537413239479065, 0.23526616394519806, 0.0836174413561821, -0.05974213778972626, 0.28060585260391235, 0.17075057327747345, -0.13414418697357178, -0.07644034922122955, -0.24748116731643677, 0.30566567182540894, -0.06656534224748611, 0.2226821929216385, 0.08635172247886658, -0.04553864151239395, -0.05687759071588516, -0.22526873648166656, 0.13118326663970947, 0.01636163704097271, 0.012625876814126968, -0.17638233304023743, -0.16661405563354492, 0.09999198466539383, -0.001013217493891716, -0.08072219789028168, -0.016165312379598618, -0.15215787291526794, -0.011200176551938057, -0.01796279475092888, 0.07604896277189255, -0.01460535079240799, -0.11940799653530121, -0.1400480568408966, 0.2809409499168396, -0.12060108780860901, -0.1210639476776123, 0.23246072232723236, -0.23627105355262756, 0.22578051686286926, 0.059537820518016815, 0.5264185070991516, -0.024768680334091187, 0.03063800185918808, -0.1317235678434372, 0.15129616856575012, -0.34175971150398254, -0.05293168127536774, 0.25683096051216125, -0.3094082772731781, -0.06632181257009506, 0.09374935925006866, 0.23149418830871582, 0.41054677963256836, -0.12172404676675797, -0.08593331277370453, 0.2554229199886322, 0.13186591863632202, -0.3775715231895447, -0.17314814031124115, 0.04951814189553261, -0.10026286542415619, -0.025594010949134827, 0.059920601546764374, 0.3110899329185486, -0.18170717358589172, 0.09042950719594955, 0.34185144305229187, 0.2442220151424408, 0.26974204182624817, -0.0024246424436569214, 0.44836151599884033, 0.012056268751621246, -0.20428091287612915, 0.4182865619659424, 0.1756482720375061, 0.31129884719848633, 0.26551252603530884, -0.21094004809856415, 0.16680176556110382, 0.049634188413619995, -0.19737444818019867, 0.09603322297334671, -0.42627519369125366, -0.19237294793128967, -0.0999845340847969, 0.31498318910598755, -0.061651088297367096, 0.46200695633888245, 0.45272618532180786, 0.27119389176368713, -0.07099601626396179, 0.02905261516571045, 0.3461710214614868, -0.00007067294791340828, 0.0676976889371872, -0.07238531112670898, -0.2340080291032791, -0.2650998830795288, -0.014262579381465912, -0.2551712691783905, -0.24806059896945953, 0.30818596482276917, 0.2364887148141861, -0.3372643291950226, -0.7492637038230896, 0.3052001893520355, 0.1087694764137268, 0.12708932161331177, -0.2866680324077606, 0.35383695363998413, 0.24741961061954498, -0.1135721281170845, -0.10147155821323395, 0.30838122963905334, 0.8915085792541504, 0.31771764159202576, -0.02600981295108795, 0.0024152323603630066, -0.004144560545682907, -0.15640640258789062, 0.04656856507062912, -0.1994176208972931, -0.19490215182304382, 0.4521815776824951, 0.2232360988855362, 0.17558464407920837, -0.14350566267967224, -0.19015607237815857, 0.08037736266851425, -0.002545885741710663, -0.268173485994339, 0.13124673068523407, -0.1365811973810196, -0.20019450783729553, 0.0013935090973973274, -0.0007405504584312439, -0.42817452549934387, -0.00899314135313034, 0.4281740188598633, 0.13380154967308044, 0.11360006779432297, -0.12113121151924133, 0.04415826499462128, 0.045718587934970856, 0.44777101278305054, 0.6064440011978149, 0.13685736060142517, -0.1345338374376297, -0.08647548407316208, -0.42366355657577515, 0.275939404964447, -0.332254558801651, -0.044852398335933685, 0.12691543996334076, 0.20620226860046387, 0.0542919784784317, 0.07830438017845154, 0.27757400274276733, 0.420621782541275, -0.17724910378456116, -0.05108058452606201, -0.332472562789917, -0.10067255795001984, 0.046692438423633575, -0.22204174101352692, -0.12957659363746643, -0.24664458632469177, 0.3911384344100952, -0.2919163107872009, 0.06642098724842072, -0.3800824284553528, -0.14073927700519562, 0.25868332386016846, -0.08691835403442383, 0.45785221457481384, 0.0009060781449079514, 0.41875797510147095, 0.03265461325645447, -0.17067331075668335, -0.3290652632713318, -0.3339603543281555, -0.28833654522895813, 0.3402409255504608, -0.05063445493578911, 0.4427412152290344, -0.18638867139816284, -0.3720743954181671, -0.10302574187517166, 0.2508411407470703, -0.09061776846647263, 0.15800976753234863, 0.19902543723583221, 0.03442266583442688, 0.0075860098004341125, 0.01790967583656311, -0.08486709743738174, -0.08275871723890305, 0.09513992816209793, 0.16722926497459412, -0.2761419415473938, -0.6448034048080444, 0.241926908493042, -0.2260374277830124, -0.20503024756908417, 0.04457248002290726, 0.05650459975004196, 0.17781129479408264, 0.026200050488114357, -0.4378465712070465, 0.234495609998703, 0.40572476387023926, -0.15454722940921783, -0.12775224447250366, 0.18590374290943146, 0.10264274477958679, 0.14742787182331085, -0.025282561779022217, 0.3295576870441437, -0.06774131953716278, -0.28767818212509155, -0.11397577822208405, -0.18642500042915344 ]
https://github.com/huggingface/datasets/issues/5923
For conda with python3.8.16 this solved my problem! thanks! > I got the same error, pyarrow 12.0.0 released May/2023 (https://pypi.org/project/pyarrow/) is not compatible, running `pip install pyarrow==11.0.0` to force install the previous version solved the problem. > > Do we need to update dependencies? I can work on that if no one else is working on it.
Cannot import datasets - ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility
### Describe the bug When trying to import datasets, I get a pyarrow ValueError: Traceback (most recent call last): File "/Users/edward/test/test.py", line 1, in <module> import datasets File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module> from .arrow_dataset import Dataset File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 65, in <module> from .arrow_reader import ArrowReader File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_reader.py", line 28, in <module> import pyarrow.parquet as pq File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/__init__.py", line 20, in <module> from .core import * File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/core.py", line 45, in <module> from pyarrow.fs import (LocalFileSystem, FileSystem, FileType, File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/fs.py", line 49, in <module> from pyarrow._gcsfs import GcsFileSystem # noqa File "pyarrow/_gcsfs.pyx", line 1, in init pyarrow._gcsfs ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject ### Steps to reproduce the bug `import datasets` ### Expected behavior Successful import ### Environment info Conda environment, MacOS python 3.9.12 datasets 2.12.0
57
Cannot import datasets - ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility ### Describe the bug When trying to import datasets, I get a pyarrow ValueError: Traceback (most recent call last): File "/Users/edward/test/test.py", line 1, in <module> import datasets File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module> from .arrow_dataset import Dataset File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 65, in <module> from .arrow_reader import ArrowReader File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_reader.py", line 28, in <module> import pyarrow.parquet as pq File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/__init__.py", line 20, in <module> from .core import * File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/core.py", line 45, in <module> from pyarrow.fs import (LocalFileSystem, FileSystem, FileType, File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/fs.py", line 49, in <module> from pyarrow._gcsfs import GcsFileSystem # noqa File "pyarrow/_gcsfs.pyx", line 1, in init pyarrow._gcsfs ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject ### Steps to reproduce the bug `import datasets` ### Expected behavior Successful import ### Environment info Conda environment, MacOS python 3.9.12 datasets 2.12.0 For conda with python3.8.16 this solved my problem! thanks! > I got the same error, pyarrow 12.0.0 released May/2023 (https://pypi.org/project/pyarrow/) is not compatible, running `pip install pyarrow==11.0.0` to force install the previous version solved the problem. > > Do we need to update dependencies? I can work on that if no one else is working on it.
[ -0.5389391183853149, 0.41014090180397034, -0.09792473912239075, 0.2319422960281372, 0.14288535714149475, -0.13102033734321594, 0.21223437786102295, 0.2684710919857025, -0.408712774515152, 0.09050598740577698, -0.20407867431640625, 0.27507221698760986, -0.12025684118270874, 0.1409701108932495, -0.16671998798847198, 0.01760251820087433, 0.05824655294418335, 0.2816929221153259, -0.1661183387041092, 0.113141730427742, -0.10728545486927032, 0.16610445082187653, -0.21358206868171692, 0.11508075147867203, 0.011453785002231598, -0.10817255824804306, -0.14227774739265442, 0.24949845671653748, -0.43753454089164734, -0.7070934176445007, 0.3522906005382538, -0.086106076836586, 0.07033614069223404, 0.4895254969596863, -0.00011616970732575282, 0.18690964579582214, 0.2657691538333893, 0.06419306993484497, -0.253903865814209, -0.07424189150333405, 0.06377491354942322, -0.2764390707015991, 0.26972654461860657, -0.11235450953245163, 0.3193272650241852, -0.5484874248504639, 0.06671421974897385, 0.16740885376930237, 0.054839521646499634, 0.40047457814216614, 0.19530938565731049, 0.38214990496635437, 0.6554259061813354, 0.1227761059999466, 0.5305083990097046, 0.04909924045205116, 0.03578562289476395, 0.5898970365524292, 0.2579425871372223, 0.05691107362508774, 0.0021759532392024994, -0.20591427385807037, -0.1010093167424202, -0.048358254134655, 0.15855109691619873, -0.18132737278938293, -0.03536137938499451, -0.18852782249450684, -0.06856274604797363, -0.08543333411216736, 0.4250427186489105, -0.5830304026603699, -0.302016019821167, -0.09135070443153381, 0.10421205312013626, -0.45955967903137207, 0.28538691997528076, 0.21514496207237244, 0.1239168643951416, 0.22662369906902313, -0.08318190276622772, -0.12021125853061676, -0.3959175944328308, 0.18164576590061188, -0.32514679431915283, 0.24191302061080933, 0.029269661754369736, 0.19708991050720215, 0.00875172670930624, -0.18387901782989502, 0.42467594146728516, -0.02596220001578331, -0.23255464434623718, 0.08952406048774719, -0.22075620293617249, 0.081318199634552, 0.020974012091755867, 0.13495442271232605, -0.04143968224525452, 0.02640334889292717, -0.058164432644844055, -0.15183407068252563, -0.033698271960020065, 0.33083441853523254, 0.024396397173404694, 0.05486329272389412, -0.12570367753505707, 0.2684255838394165, 0.1664728820323944, 0.1868094801902771, -0.005677856504917145, -0.02999785915017128, -0.04185599088668823, -0.3846703767776489, 0.08216149359941483, 0.0356256403028965, 0.4344305098056793, -0.1588757187128067, -0.29218998551368713, -0.012626070529222488, -0.25384315848350525, 0.026433870196342468, -0.17737063765525818, 0.2993183434009552, -0.01885107159614563, 0.2504885196685791, 0.1386951059103012, 0.2536332607269287, -0.11470460891723633, -0.23161382973194122, -0.05686569958925247, 0.10283129662275314, -0.0738179013133049, -0.22125279903411865, 0.08629242330789566, -0.1755020022392273, 0.13045690953731537, 0.12832950055599213, 0.1933923065662384, 0.12288786470890045, -0.06554929167032242, -0.24240773916244507, -0.04746447876095772, 0.31247541308403015, -0.03729112073779106, 0.10041829198598862, 0.015014491975307465, -0.30412307381629944, -0.21219328045845032, 0.14690840244293213, -0.3801676332950592, -0.11307426542043686, -0.38429704308509827, 0.17333675920963287, -0.00567549467086792, -0.05924506485462189, -0.19764062762260437, -0.09340038895606995, 0.1950654685497284, -0.4064936637878418, -0.0562329925596714, -0.48926854133605957, 0.16215912997722626, -0.4678736925125122, -0.015019897371530533, 0.15141348540782928, -0.7889991998672485, 0.07376639544963837, 0.04906328022480011, 0.004440071061253548, 0.1919279396533966, 0.3100696802139282, -0.2902900278568268, -0.12284907698631287, -0.0004233941435813904, 0.1427394151687622, 0.2366839200258255, -0.21537001430988312, -0.6268244385719299, 0.0864512026309967, 0.03838047385215759, -0.24220477044582367, 0.1674947738647461, -0.17949894070625305, 0.19456103444099426, 0.09760883450508118, -0.10673335194587708, 0.1721334308385849, -0.07684064656496048, 0.04093795269727707, -0.19862762093544006, -0.5216740369796753, 0.2674814760684967, -0.03322679176926613, 0.10352544486522675, -0.39543211460113525, 0.35555097460746765, -0.3969314396381378, 0.29034629464149475, -0.1645258665084839, 0.057519592344760895, 0.33262306451797485, 0.3348727524280548, -0.11456172168254852, 0.021700289100408554, -0.2176801711320877, -0.2977602779865265, 0.1422601044178009, -0.381434828042984, -0.11011587828397751, -0.3259420096874237, -0.1059422641992569, -0.3133503198623657, 0.26993176341056824, 0.05359809473156929, -0.006133888382464647, 0.05970541015267372, 0.057409174740314484, -0.016452211886644363, 0.10308235138654709, -0.03366893529891968, 0.07832518219947815, -0.0958491861820221, 0.19671405851840973, -0.24218088388442993, 0.5291696190834045, -0.3428577184677124, -0.4746672213077545, 0.19328927993774414, -0.0023095812648534775, 0.0374557301402092, -0.06310087442398071, -0.14555492997169495, 0.4702662229537964, -0.028681166470050812, 0.3286389708518982, -0.1707378774881363, 0.084703728556633, 0.21563316881656647, -0.229253888130188, 0.32963529229164124, -0.028982695192098618, 0.08914411067962646, 0.20938627421855927, 0.13785672187805176, 0.16456446051597595, 0.16380859911441803, 0.09281909465789795, 0.12126252800226212, -0.22491805255413055, -0.030612699687480927, 0.13591116666793823, 0.1629302054643631, -0.009373307228088379, 0.04221060499548912, 0.1983906328678131, 0.12568755447864532, 0.1722821295261383, -0.2852168679237366, 0.08072225749492645, 0.42531582713127136, 0.0626024603843689, -0.008041251450777054, 0.1384713351726532, -0.2746993601322174, 0.050757043063640594, 0.36250460147857666, -0.14058038592338562, 0.29622507095336914, 0.3149271309375763, -0.1703774780035019, -0.029386475682258606, -0.0971117913722992, -0.052491623908281326, 0.18679046630859375, 0.13654297590255737, 0.2397942692041397, 0.07676659524440765, 0.623730480670929, 0.04727469012141228, -0.2200196385383606, -0.13672858476638794, 0.04518246650695801, 0.27634674310684204, -0.452684223651886, 0.308177649974823, -0.4269106388092041, -0.0024414435029029846, -0.23781991004943848, -0.154685840010643, -0.3824634552001953, -0.27317434549331665, -0.2290082722902298, 0.3882075548171997, 0.031330808997154236, 0.08750251680612564, -0.023035410791635513, -0.1944246143102646, 0.18350647389888763, -0.17203259468078613, 0.06762979924678802, -0.11229591071605682, -0.3621595501899719, 0.0946991890668869, 0.342587411403656, 0.12063385546207428, 0.19353339076042175, 0.03205987066030502, 0.03860313445329666, -0.05090917646884918, -0.47778546810150146, -0.1438167691230774, -0.025089098140597343, 0.19900289177894592, 0.1817106157541275, 0.11551493406295776, -0.07299236208200455, -0.46838411688804626, 0.057287078350782394, 0.08416453748941422, -0.3447721004486084, 0.1372157782316208, -0.34398332238197327, -0.1998528391122818, -0.0028321966528892517, -0.276289165019989, -0.4295882284641266, -0.3780532479286194, 0.1362106204032898, 0.3020915985107422, 0.23640713095664978, 0.3542707860469818, 0.3423806130886078, 0.01274484395980835, -0.0786948874592781, -0.10726942867040634, 0.23830220103263855, 0.028377175331115723, 0.28393781185150146, -0.07516976445913315, -0.257251501083374, -0.07669791579246521, -0.037464335560798645, 0.08720491826534271, 0.294569194316864, -0.4791855216026306, -0.014134753495454788, -0.3582625985145569, 0.5260703563690186, -0.08312098681926727, 0.14493517577648163, 0.22535274922847748, 0.15895995497703552, -0.004194937646389008, 0.003344491124153137, -0.1563226580619812, -0.26622116565704346, 0.2833780348300934, 0.07547761499881744, 0.055676694959402084, 0.3319579064846039, -0.19856581091880798, 0.6400830745697021, 0.023299410939216614, -0.2738661468029022, 0.4377114176750183, -0.2375326156616211, 0.45192140340805054, -0.10431645810604095, -0.3032712936401367, 0.06629733741283417, -0.10827210545539856, -0.07401157915592194, 0.044195711612701416, -0.22602307796478271, -0.3297971487045288, 0.12052588909864426, -0.18412691354751587, -0.23381878435611725, -0.14523108303546906, 0.09087691456079483, 0.14159071445465088, 0.3312854468822479, -0.08640037477016449, -0.2960985600948334, -0.2364920675754547, -0.21792711317539215, 0.025277383625507355, -0.08264269679784775, -0.22591671347618103, 0.038069967180490494, -0.035965826362371445, -0.13339830935001373, -0.34121182560920715, 0.30971473455429077, 0.17489559948444366, 0.2464342564344406, 0.1721387505531311, -0.0410853810608387, 0.11113014817237854, -0.21800363063812256, 0.32807719707489014, 0.09706304222345352, -0.182765394449234, 0.27574849128723145, 0.40072202682495117, -0.496793270111084, -0.23470546305179596, -0.19102361798286438, 0.27748310565948486, 0.24770592153072357, 0.18386921286582947, -0.3402397632598877, 0.15343794226646423, 0.16168956458568573, 0.5132279396057129, -0.044120822101831436, 0.16416697204113007, -0.27002739906311035, -0.10140333324670792, -0.4776964485645294, -0.10504379123449326, -0.01761382445693016, 0.33137673139572144, 0.005467850714921951, 0.06343299150466919, -0.14889757335186005, -0.24708475172519684, 0.0832427591085434, 0.28902047872543335, 0.3243051767349243, -0.07903829216957092, 0.11278222501277924, -0.31734713912010193, 0.0913165807723999, 0.5340574979782104, 0.7704090476036072, 0.20883658528327942, -0.34903720021247864, -0.016412770375609398, 0.05045154318213463, 0.32675692439079285, 0.11366061866283417, -0.19308175146579742, 0.18378815054893494, -0.11625105142593384, 0.10890750586986542, 0.12137383967638016, 0.04006081819534302, 0.24377843737602234, -0.07671591639518738, -0.2914526164531708, 0.08982376009225845, 0.41707974672317505, -0.03200620412826538, -0.013796605169773102, 0.18926988542079926, 0.4060444235801697, -0.1646333634853363, 0.3946790099143982, 0.03605928644537926, 0.8309652805328369, -0.04272161424160004, 0.0664454996585846, 0.5179725289344788, -0.40474075078964233, 0.16809165477752686, -0.02481294423341751, -0.0014977939426898956, -0.5320702791213989, 0.02998863160610199, 0.010089166462421417, -0.32545042037963867, 0.378400057554245, -0.024959616363048553, -0.2201615273952484, 0.13777568936347961, -0.01617369055747986, 0.21605737507343292, 0.007065225392580032, 0.16433557868003845, -0.0762438178062439, 0.12335334718227386, -0.3094923794269562, 0.09066323190927505, -0.1320367455482483, -0.20527583360671997, -0.05608992651104927, -0.08132266998291016, -0.27471923828125, -0.2721797823905945, -0.2812002897262573, -0.04469974339008331, -0.4894630014896393, 0.2627429664134979, 0.32856354117393494, -0.33071666955947876, 0.3076707124710083, 0.16620312631130219, -0.04406396299600601, 0.13957718014717102, -0.0796767994761467, 0.097402423620224, -0.013216350227594376, -0.056625720113515854, 0.12572379410266876, 0.13607007265090942, 0.10124372690916061, -0.051036760210990906, -0.24735097587108612, 0.3664361834526062, 0.06387249380350113, -0.17888739705085754, 0.14817728102207184, 0.12165239453315735, 0.2961480915546417, -0.3896706700325012, -0.059169575572013855, -0.42517295479774475, 0.09698713570833206, -0.15345673263072968, 0.05929594486951828, -0.1271677315235138, 0.26862481236457825, 0.20056328177452087, 0.013806306757032871, -0.1889253556728363, -0.2841084599494934, 0.4088476896286011, 0.03163333982229233, 0.268120139837265, 0.5743934512138367, 0.2638583779335022, -0.18598122894763947, -0.036853402853012085, 0.12482032179832458, 0.1295132040977478, -0.489487886428833, -0.0472915843129158, -0.09893018007278442, 0.1132626086473465, 0.06401893496513367, 0.03400582820177078, 0.283963680267334, 0.2301625907421112, -0.06152021512389183, -0.3313921093940735, -0.2537413239479065, 0.23526616394519806, 0.0836174413561821, -0.05974213778972626, 0.28060585260391235, 0.17075057327747345, -0.13414418697357178, -0.07644034922122955, -0.24748116731643677, 0.30566567182540894, -0.06656534224748611, 0.2226821929216385, 0.08635172247886658, -0.04553864151239395, -0.05687759071588516, -0.22526873648166656, 0.13118326663970947, 0.01636163704097271, 0.012625876814126968, -0.17638233304023743, -0.16661405563354492, 0.09999198466539383, -0.001013217493891716, -0.08072219789028168, -0.016165312379598618, -0.15215787291526794, -0.011200176551938057, -0.01796279475092888, 0.07604896277189255, -0.01460535079240799, -0.11940799653530121, -0.1400480568408966, 0.2809409499168396, -0.12060108780860901, -0.1210639476776123, 0.23246072232723236, -0.23627105355262756, 0.22578051686286926, 0.059537820518016815, 0.5264185070991516, -0.024768680334091187, 0.03063800185918808, -0.1317235678434372, 0.15129616856575012, -0.34175971150398254, -0.05293168127536774, 0.25683096051216125, -0.3094082772731781, -0.06632181257009506, 0.09374935925006866, 0.23149418830871582, 0.41054677963256836, -0.12172404676675797, -0.08593331277370453, 0.2554229199886322, 0.13186591863632202, -0.3775715231895447, -0.17314814031124115, 0.04951814189553261, -0.10026286542415619, -0.025594010949134827, 0.059920601546764374, 0.3110899329185486, -0.18170717358589172, 0.09042950719594955, 0.34185144305229187, 0.2442220151424408, 0.26974204182624817, -0.0024246424436569214, 0.44836151599884033, 0.012056268751621246, -0.20428091287612915, 0.4182865619659424, 0.1756482720375061, 0.31129884719848633, 0.26551252603530884, -0.21094004809856415, 0.16680176556110382, 0.049634188413619995, -0.19737444818019867, 0.09603322297334671, -0.42627519369125366, -0.19237294793128967, -0.0999845340847969, 0.31498318910598755, -0.061651088297367096, 0.46200695633888245, 0.45272618532180786, 0.27119389176368713, -0.07099601626396179, 0.02905261516571045, 0.3461710214614868, -0.00007067294791340828, 0.0676976889371872, -0.07238531112670898, -0.2340080291032791, -0.2650998830795288, -0.014262579381465912, -0.2551712691783905, -0.24806059896945953, 0.30818596482276917, 0.2364887148141861, -0.3372643291950226, -0.7492637038230896, 0.3052001893520355, 0.1087694764137268, 0.12708932161331177, -0.2866680324077606, 0.35383695363998413, 0.24741961061954498, -0.1135721281170845, -0.10147155821323395, 0.30838122963905334, 0.8915085792541504, 0.31771764159202576, -0.02600981295108795, 0.0024152323603630066, -0.004144560545682907, -0.15640640258789062, 0.04656856507062912, -0.1994176208972931, -0.19490215182304382, 0.4521815776824951, 0.2232360988855362, 0.17558464407920837, -0.14350566267967224, -0.19015607237815857, 0.08037736266851425, -0.002545885741710663, -0.268173485994339, 0.13124673068523407, -0.1365811973810196, -0.20019450783729553, 0.0013935090973973274, -0.0007405504584312439, -0.42817452549934387, -0.00899314135313034, 0.4281740188598633, 0.13380154967308044, 0.11360006779432297, -0.12113121151924133, 0.04415826499462128, 0.045718587934970856, 0.44777101278305054, 0.6064440011978149, 0.13685736060142517, -0.1345338374376297, -0.08647548407316208, -0.42366355657577515, 0.275939404964447, -0.332254558801651, -0.044852398335933685, 0.12691543996334076, 0.20620226860046387, 0.0542919784784317, 0.07830438017845154, 0.27757400274276733, 0.420621782541275, -0.17724910378456116, -0.05108058452606201, -0.332472562789917, -0.10067255795001984, 0.046692438423633575, -0.22204174101352692, -0.12957659363746643, -0.24664458632469177, 0.3911384344100952, -0.2919163107872009, 0.06642098724842072, -0.3800824284553528, -0.14073927700519562, 0.25868332386016846, -0.08691835403442383, 0.45785221457481384, 0.0009060781449079514, 0.41875797510147095, 0.03265461325645447, -0.17067331075668335, -0.3290652632713318, -0.3339603543281555, -0.28833654522895813, 0.3402409255504608, -0.05063445493578911, 0.4427412152290344, -0.18638867139816284, -0.3720743954181671, -0.10302574187517166, 0.2508411407470703, -0.09061776846647263, 0.15800976753234863, 0.19902543723583221, 0.03442266583442688, 0.0075860098004341125, 0.01790967583656311, -0.08486709743738174, -0.08275871723890305, 0.09513992816209793, 0.16722926497459412, -0.2761419415473938, -0.6448034048080444, 0.241926908493042, -0.2260374277830124, -0.20503024756908417, 0.04457248002290726, 0.05650459975004196, 0.17781129479408264, 0.026200050488114357, -0.4378465712070465, 0.234495609998703, 0.40572476387023926, -0.15454722940921783, -0.12775224447250366, 0.18590374290943146, 0.10264274477958679, 0.14742787182331085, -0.025282561779022217, 0.3295576870441437, -0.06774131953716278, -0.28767818212509155, -0.11397577822208405, -0.18642500042915344 ]
https://github.com/huggingface/datasets/issues/5923
Thanks for replying. I am not sure about those environments but it seems like pyarrow-12.0.0 does not work for conda with python 3.8.16. > Please note that our CI properly passes all tests with `pyarrow-12.0.0`, for Python 3.7 and Python 3.10, for Ubuntu and Windows: see for example https://github.com/huggingface/datasets/actions/runs/5157324334/jobs/9289582291
Cannot import datasets - ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility
### Describe the bug When trying to import datasets, I get a pyarrow ValueError: Traceback (most recent call last): File "/Users/edward/test/test.py", line 1, in <module> import datasets File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module> from .arrow_dataset import Dataset File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 65, in <module> from .arrow_reader import ArrowReader File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_reader.py", line 28, in <module> import pyarrow.parquet as pq File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/__init__.py", line 20, in <module> from .core import * File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/core.py", line 45, in <module> from pyarrow.fs import (LocalFileSystem, FileSystem, FileType, File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/fs.py", line 49, in <module> from pyarrow._gcsfs import GcsFileSystem # noqa File "pyarrow/_gcsfs.pyx", line 1, in init pyarrow._gcsfs ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject ### Steps to reproduce the bug `import datasets` ### Expected behavior Successful import ### Environment info Conda environment, MacOS python 3.9.12 datasets 2.12.0
49
Cannot import datasets - ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility ### Describe the bug When trying to import datasets, I get a pyarrow ValueError: Traceback (most recent call last): File "/Users/edward/test/test.py", line 1, in <module> import datasets File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module> from .arrow_dataset import Dataset File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 65, in <module> from .arrow_reader import ArrowReader File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_reader.py", line 28, in <module> import pyarrow.parquet as pq File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/__init__.py", line 20, in <module> from .core import * File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/core.py", line 45, in <module> from pyarrow.fs import (LocalFileSystem, FileSystem, FileType, File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/fs.py", line 49, in <module> from pyarrow._gcsfs import GcsFileSystem # noqa File "pyarrow/_gcsfs.pyx", line 1, in init pyarrow._gcsfs ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject ### Steps to reproduce the bug `import datasets` ### Expected behavior Successful import ### Environment info Conda environment, MacOS python 3.9.12 datasets 2.12.0 Thanks for replying. I am not sure about those environments but it seems like pyarrow-12.0.0 does not work for conda with python 3.8.16. > Please note that our CI properly passes all tests with `pyarrow-12.0.0`, for Python 3.7 and Python 3.10, for Ubuntu and Windows: see for example https://github.com/huggingface/datasets/actions/runs/5157324334/jobs/9289582291
[ -0.5389391183853149, 0.41014090180397034, -0.09792473912239075, 0.2319422960281372, 0.14288535714149475, -0.13102033734321594, 0.21223437786102295, 0.2684710919857025, -0.408712774515152, 0.09050598740577698, -0.20407867431640625, 0.27507221698760986, -0.12025684118270874, 0.1409701108932495, -0.16671998798847198, 0.01760251820087433, 0.05824655294418335, 0.2816929221153259, -0.1661183387041092, 0.113141730427742, -0.10728545486927032, 0.16610445082187653, -0.21358206868171692, 0.11508075147867203, 0.011453785002231598, -0.10817255824804306, -0.14227774739265442, 0.24949845671653748, -0.43753454089164734, -0.7070934176445007, 0.3522906005382538, -0.086106076836586, 0.07033614069223404, 0.4895254969596863, -0.00011616970732575282, 0.18690964579582214, 0.2657691538333893, 0.06419306993484497, -0.253903865814209, -0.07424189150333405, 0.06377491354942322, -0.2764390707015991, 0.26972654461860657, -0.11235450953245163, 0.3193272650241852, -0.5484874248504639, 0.06671421974897385, 0.16740885376930237, 0.054839521646499634, 0.40047457814216614, 0.19530938565731049, 0.38214990496635437, 0.6554259061813354, 0.1227761059999466, 0.5305083990097046, 0.04909924045205116, 0.03578562289476395, 0.5898970365524292, 0.2579425871372223, 0.05691107362508774, 0.0021759532392024994, -0.20591427385807037, -0.1010093167424202, -0.048358254134655, 0.15855109691619873, -0.18132737278938293, -0.03536137938499451, -0.18852782249450684, -0.06856274604797363, -0.08543333411216736, 0.4250427186489105, -0.5830304026603699, -0.302016019821167, -0.09135070443153381, 0.10421205312013626, -0.45955967903137207, 0.28538691997528076, 0.21514496207237244, 0.1239168643951416, 0.22662369906902313, -0.08318190276622772, -0.12021125853061676, -0.3959175944328308, 0.18164576590061188, -0.32514679431915283, 0.24191302061080933, 0.029269661754369736, 0.19708991050720215, 0.00875172670930624, -0.18387901782989502, 0.42467594146728516, -0.02596220001578331, -0.23255464434623718, 0.08952406048774719, -0.22075620293617249, 0.081318199634552, 0.020974012091755867, 0.13495442271232605, -0.04143968224525452, 0.02640334889292717, -0.058164432644844055, -0.15183407068252563, -0.033698271960020065, 0.33083441853523254, 0.024396397173404694, 0.05486329272389412, -0.12570367753505707, 0.2684255838394165, 0.1664728820323944, 0.1868094801902771, -0.005677856504917145, -0.02999785915017128, -0.04185599088668823, -0.3846703767776489, 0.08216149359941483, 0.0356256403028965, 0.4344305098056793, -0.1588757187128067, -0.29218998551368713, -0.012626070529222488, -0.25384315848350525, 0.026433870196342468, -0.17737063765525818, 0.2993183434009552, -0.01885107159614563, 0.2504885196685791, 0.1386951059103012, 0.2536332607269287, -0.11470460891723633, -0.23161382973194122, -0.05686569958925247, 0.10283129662275314, -0.0738179013133049, -0.22125279903411865, 0.08629242330789566, -0.1755020022392273, 0.13045690953731537, 0.12832950055599213, 0.1933923065662384, 0.12288786470890045, -0.06554929167032242, -0.24240773916244507, -0.04746447876095772, 0.31247541308403015, -0.03729112073779106, 0.10041829198598862, 0.015014491975307465, -0.30412307381629944, -0.21219328045845032, 0.14690840244293213, -0.3801676332950592, -0.11307426542043686, -0.38429704308509827, 0.17333675920963287, -0.00567549467086792, -0.05924506485462189, -0.19764062762260437, -0.09340038895606995, 0.1950654685497284, -0.4064936637878418, -0.0562329925596714, -0.48926854133605957, 0.16215912997722626, -0.4678736925125122, -0.015019897371530533, 0.15141348540782928, -0.7889991998672485, 0.07376639544963837, 0.04906328022480011, 0.004440071061253548, 0.1919279396533966, 0.3100696802139282, -0.2902900278568268, -0.12284907698631287, -0.0004233941435813904, 0.1427394151687622, 0.2366839200258255, -0.21537001430988312, -0.6268244385719299, 0.0864512026309967, 0.03838047385215759, -0.24220477044582367, 0.1674947738647461, -0.17949894070625305, 0.19456103444099426, 0.09760883450508118, -0.10673335194587708, 0.1721334308385849, -0.07684064656496048, 0.04093795269727707, -0.19862762093544006, -0.5216740369796753, 0.2674814760684967, -0.03322679176926613, 0.10352544486522675, -0.39543211460113525, 0.35555097460746765, -0.3969314396381378, 0.29034629464149475, -0.1645258665084839, 0.057519592344760895, 0.33262306451797485, 0.3348727524280548, -0.11456172168254852, 0.021700289100408554, -0.2176801711320877, -0.2977602779865265, 0.1422601044178009, -0.381434828042984, -0.11011587828397751, -0.3259420096874237, -0.1059422641992569, -0.3133503198623657, 0.26993176341056824, 0.05359809473156929, -0.006133888382464647, 0.05970541015267372, 0.057409174740314484, -0.016452211886644363, 0.10308235138654709, -0.03366893529891968, 0.07832518219947815, -0.0958491861820221, 0.19671405851840973, -0.24218088388442993, 0.5291696190834045, -0.3428577184677124, -0.4746672213077545, 0.19328927993774414, -0.0023095812648534775, 0.0374557301402092, -0.06310087442398071, -0.14555492997169495, 0.4702662229537964, -0.028681166470050812, 0.3286389708518982, -0.1707378774881363, 0.084703728556633, 0.21563316881656647, -0.229253888130188, 0.32963529229164124, -0.028982695192098618, 0.08914411067962646, 0.20938627421855927, 0.13785672187805176, 0.16456446051597595, 0.16380859911441803, 0.09281909465789795, 0.12126252800226212, -0.22491805255413055, -0.030612699687480927, 0.13591116666793823, 0.1629302054643631, -0.009373307228088379, 0.04221060499548912, 0.1983906328678131, 0.12568755447864532, 0.1722821295261383, -0.2852168679237366, 0.08072225749492645, 0.42531582713127136, 0.0626024603843689, -0.008041251450777054, 0.1384713351726532, -0.2746993601322174, 0.050757043063640594, 0.36250460147857666, -0.14058038592338562, 0.29622507095336914, 0.3149271309375763, -0.1703774780035019, -0.029386475682258606, -0.0971117913722992, -0.052491623908281326, 0.18679046630859375, 0.13654297590255737, 0.2397942692041397, 0.07676659524440765, 0.623730480670929, 0.04727469012141228, -0.2200196385383606, -0.13672858476638794, 0.04518246650695801, 0.27634674310684204, -0.452684223651886, 0.308177649974823, -0.4269106388092041, -0.0024414435029029846, -0.23781991004943848, -0.154685840010643, -0.3824634552001953, -0.27317434549331665, -0.2290082722902298, 0.3882075548171997, 0.031330808997154236, 0.08750251680612564, -0.023035410791635513, -0.1944246143102646, 0.18350647389888763, -0.17203259468078613, 0.06762979924678802, -0.11229591071605682, -0.3621595501899719, 0.0946991890668869, 0.342587411403656, 0.12063385546207428, 0.19353339076042175, 0.03205987066030502, 0.03860313445329666, -0.05090917646884918, -0.47778546810150146, -0.1438167691230774, -0.025089098140597343, 0.19900289177894592, 0.1817106157541275, 0.11551493406295776, -0.07299236208200455, -0.46838411688804626, 0.057287078350782394, 0.08416453748941422, -0.3447721004486084, 0.1372157782316208, -0.34398332238197327, -0.1998528391122818, -0.0028321966528892517, -0.276289165019989, -0.4295882284641266, -0.3780532479286194, 0.1362106204032898, 0.3020915985107422, 0.23640713095664978, 0.3542707860469818, 0.3423806130886078, 0.01274484395980835, -0.0786948874592781, -0.10726942867040634, 0.23830220103263855, 0.028377175331115723, 0.28393781185150146, -0.07516976445913315, -0.257251501083374, -0.07669791579246521, -0.037464335560798645, 0.08720491826534271, 0.294569194316864, -0.4791855216026306, -0.014134753495454788, -0.3582625985145569, 0.5260703563690186, -0.08312098681926727, 0.14493517577648163, 0.22535274922847748, 0.15895995497703552, -0.004194937646389008, 0.003344491124153137, -0.1563226580619812, -0.26622116565704346, 0.2833780348300934, 0.07547761499881744, 0.055676694959402084, 0.3319579064846039, -0.19856581091880798, 0.6400830745697021, 0.023299410939216614, -0.2738661468029022, 0.4377114176750183, -0.2375326156616211, 0.45192140340805054, -0.10431645810604095, -0.3032712936401367, 0.06629733741283417, -0.10827210545539856, -0.07401157915592194, 0.044195711612701416, -0.22602307796478271, -0.3297971487045288, 0.12052588909864426, -0.18412691354751587, -0.23381878435611725, -0.14523108303546906, 0.09087691456079483, 0.14159071445465088, 0.3312854468822479, -0.08640037477016449, -0.2960985600948334, -0.2364920675754547, -0.21792711317539215, 0.025277383625507355, -0.08264269679784775, -0.22591671347618103, 0.038069967180490494, -0.035965826362371445, -0.13339830935001373, -0.34121182560920715, 0.30971473455429077, 0.17489559948444366, 0.2464342564344406, 0.1721387505531311, -0.0410853810608387, 0.11113014817237854, -0.21800363063812256, 0.32807719707489014, 0.09706304222345352, -0.182765394449234, 0.27574849128723145, 0.40072202682495117, -0.496793270111084, -0.23470546305179596, -0.19102361798286438, 0.27748310565948486, 0.24770592153072357, 0.18386921286582947, -0.3402397632598877, 0.15343794226646423, 0.16168956458568573, 0.5132279396057129, -0.044120822101831436, 0.16416697204113007, -0.27002739906311035, -0.10140333324670792, -0.4776964485645294, -0.10504379123449326, -0.01761382445693016, 0.33137673139572144, 0.005467850714921951, 0.06343299150466919, -0.14889757335186005, -0.24708475172519684, 0.0832427591085434, 0.28902047872543335, 0.3243051767349243, -0.07903829216957092, 0.11278222501277924, -0.31734713912010193, 0.0913165807723999, 0.5340574979782104, 0.7704090476036072, 0.20883658528327942, -0.34903720021247864, -0.016412770375609398, 0.05045154318213463, 0.32675692439079285, 0.11366061866283417, -0.19308175146579742, 0.18378815054893494, -0.11625105142593384, 0.10890750586986542, 0.12137383967638016, 0.04006081819534302, 0.24377843737602234, -0.07671591639518738, -0.2914526164531708, 0.08982376009225845, 0.41707974672317505, -0.03200620412826538, -0.013796605169773102, 0.18926988542079926, 0.4060444235801697, -0.1646333634853363, 0.3946790099143982, 0.03605928644537926, 0.8309652805328369, -0.04272161424160004, 0.0664454996585846, 0.5179725289344788, -0.40474075078964233, 0.16809165477752686, -0.02481294423341751, -0.0014977939426898956, -0.5320702791213989, 0.02998863160610199, 0.010089166462421417, -0.32545042037963867, 0.378400057554245, -0.024959616363048553, -0.2201615273952484, 0.13777568936347961, -0.01617369055747986, 0.21605737507343292, 0.007065225392580032, 0.16433557868003845, -0.0762438178062439, 0.12335334718227386, -0.3094923794269562, 0.09066323190927505, -0.1320367455482483, -0.20527583360671997, -0.05608992651104927, -0.08132266998291016, -0.27471923828125, -0.2721797823905945, -0.2812002897262573, -0.04469974339008331, -0.4894630014896393, 0.2627429664134979, 0.32856354117393494, -0.33071666955947876, 0.3076707124710083, 0.16620312631130219, -0.04406396299600601, 0.13957718014717102, -0.0796767994761467, 0.097402423620224, -0.013216350227594376, -0.056625720113515854, 0.12572379410266876, 0.13607007265090942, 0.10124372690916061, -0.051036760210990906, -0.24735097587108612, 0.3664361834526062, 0.06387249380350113, -0.17888739705085754, 0.14817728102207184, 0.12165239453315735, 0.2961480915546417, -0.3896706700325012, -0.059169575572013855, -0.42517295479774475, 0.09698713570833206, -0.15345673263072968, 0.05929594486951828, -0.1271677315235138, 0.26862481236457825, 0.20056328177452087, 0.013806306757032871, -0.1889253556728363, -0.2841084599494934, 0.4088476896286011, 0.03163333982229233, 0.268120139837265, 0.5743934512138367, 0.2638583779335022, -0.18598122894763947, -0.036853402853012085, 0.12482032179832458, 0.1295132040977478, -0.489487886428833, -0.0472915843129158, -0.09893018007278442, 0.1132626086473465, 0.06401893496513367, 0.03400582820177078, 0.283963680267334, 0.2301625907421112, -0.06152021512389183, -0.3313921093940735, -0.2537413239479065, 0.23526616394519806, 0.0836174413561821, -0.05974213778972626, 0.28060585260391235, 0.17075057327747345, -0.13414418697357178, -0.07644034922122955, -0.24748116731643677, 0.30566567182540894, -0.06656534224748611, 0.2226821929216385, 0.08635172247886658, -0.04553864151239395, -0.05687759071588516, -0.22526873648166656, 0.13118326663970947, 0.01636163704097271, 0.012625876814126968, -0.17638233304023743, -0.16661405563354492, 0.09999198466539383, -0.001013217493891716, -0.08072219789028168, -0.016165312379598618, -0.15215787291526794, -0.011200176551938057, -0.01796279475092888, 0.07604896277189255, -0.01460535079240799, -0.11940799653530121, -0.1400480568408966, 0.2809409499168396, -0.12060108780860901, -0.1210639476776123, 0.23246072232723236, -0.23627105355262756, 0.22578051686286926, 0.059537820518016815, 0.5264185070991516, -0.024768680334091187, 0.03063800185918808, -0.1317235678434372, 0.15129616856575012, -0.34175971150398254, -0.05293168127536774, 0.25683096051216125, -0.3094082772731781, -0.06632181257009506, 0.09374935925006866, 0.23149418830871582, 0.41054677963256836, -0.12172404676675797, -0.08593331277370453, 0.2554229199886322, 0.13186591863632202, -0.3775715231895447, -0.17314814031124115, 0.04951814189553261, -0.10026286542415619, -0.025594010949134827, 0.059920601546764374, 0.3110899329185486, -0.18170717358589172, 0.09042950719594955, 0.34185144305229187, 0.2442220151424408, 0.26974204182624817, -0.0024246424436569214, 0.44836151599884033, 0.012056268751621246, -0.20428091287612915, 0.4182865619659424, 0.1756482720375061, 0.31129884719848633, 0.26551252603530884, -0.21094004809856415, 0.16680176556110382, 0.049634188413619995, -0.19737444818019867, 0.09603322297334671, -0.42627519369125366, -0.19237294793128967, -0.0999845340847969, 0.31498318910598755, -0.061651088297367096, 0.46200695633888245, 0.45272618532180786, 0.27119389176368713, -0.07099601626396179, 0.02905261516571045, 0.3461710214614868, -0.00007067294791340828, 0.0676976889371872, -0.07238531112670898, -0.2340080291032791, -0.2650998830795288, -0.014262579381465912, -0.2551712691783905, -0.24806059896945953, 0.30818596482276917, 0.2364887148141861, -0.3372643291950226, -0.7492637038230896, 0.3052001893520355, 0.1087694764137268, 0.12708932161331177, -0.2866680324077606, 0.35383695363998413, 0.24741961061954498, -0.1135721281170845, -0.10147155821323395, 0.30838122963905334, 0.8915085792541504, 0.31771764159202576, -0.02600981295108795, 0.0024152323603630066, -0.004144560545682907, -0.15640640258789062, 0.04656856507062912, -0.1994176208972931, -0.19490215182304382, 0.4521815776824951, 0.2232360988855362, 0.17558464407920837, -0.14350566267967224, -0.19015607237815857, 0.08037736266851425, -0.002545885741710663, -0.268173485994339, 0.13124673068523407, -0.1365811973810196, -0.20019450783729553, 0.0013935090973973274, -0.0007405504584312439, -0.42817452549934387, -0.00899314135313034, 0.4281740188598633, 0.13380154967308044, 0.11360006779432297, -0.12113121151924133, 0.04415826499462128, 0.045718587934970856, 0.44777101278305054, 0.6064440011978149, 0.13685736060142517, -0.1345338374376297, -0.08647548407316208, -0.42366355657577515, 0.275939404964447, -0.332254558801651, -0.044852398335933685, 0.12691543996334076, 0.20620226860046387, 0.0542919784784317, 0.07830438017845154, 0.27757400274276733, 0.420621782541275, -0.17724910378456116, -0.05108058452606201, -0.332472562789917, -0.10067255795001984, 0.046692438423633575, -0.22204174101352692, -0.12957659363746643, -0.24664458632469177, 0.3911384344100952, -0.2919163107872009, 0.06642098724842072, -0.3800824284553528, -0.14073927700519562, 0.25868332386016846, -0.08691835403442383, 0.45785221457481384, 0.0009060781449079514, 0.41875797510147095, 0.03265461325645447, -0.17067331075668335, -0.3290652632713318, -0.3339603543281555, -0.28833654522895813, 0.3402409255504608, -0.05063445493578911, 0.4427412152290344, -0.18638867139816284, -0.3720743954181671, -0.10302574187517166, 0.2508411407470703, -0.09061776846647263, 0.15800976753234863, 0.19902543723583221, 0.03442266583442688, 0.0075860098004341125, 0.01790967583656311, -0.08486709743738174, -0.08275871723890305, 0.09513992816209793, 0.16722926497459412, -0.2761419415473938, -0.6448034048080444, 0.241926908493042, -0.2260374277830124, -0.20503024756908417, 0.04457248002290726, 0.05650459975004196, 0.17781129479408264, 0.026200050488114357, -0.4378465712070465, 0.234495609998703, 0.40572476387023926, -0.15454722940921783, -0.12775224447250366, 0.18590374290943146, 0.10264274477958679, 0.14742787182331085, -0.025282561779022217, 0.3295576870441437, -0.06774131953716278, -0.28767818212509155, -0.11397577822208405, -0.18642500042915344 ]
https://github.com/huggingface/datasets/issues/5923
Got the same error with: ``` arrow-cpp 11.0.0 py310h7516544_0 pyarrow 12.0.0 pypi_0 pypi python 3.10.11 h7a1cb2a_2 datasets 2.13.0 pyhd8ed1ab_0 conda-forge ```
Cannot import datasets - ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility
### Describe the bug When trying to import datasets, I get a pyarrow ValueError: Traceback (most recent call last): File "/Users/edward/test/test.py", line 1, in <module> import datasets File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module> from .arrow_dataset import Dataset File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 65, in <module> from .arrow_reader import ArrowReader File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_reader.py", line 28, in <module> import pyarrow.parquet as pq File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/__init__.py", line 20, in <module> from .core import * File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/core.py", line 45, in <module> from pyarrow.fs import (LocalFileSystem, FileSystem, FileType, File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/fs.py", line 49, in <module> from pyarrow._gcsfs import GcsFileSystem # noqa File "pyarrow/_gcsfs.pyx", line 1, in init pyarrow._gcsfs ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject ### Steps to reproduce the bug `import datasets` ### Expected behavior Successful import ### Environment info Conda environment, MacOS python 3.9.12 datasets 2.12.0
21
Cannot import datasets - ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility ### Describe the bug When trying to import datasets, I get a pyarrow ValueError: Traceback (most recent call last): File "/Users/edward/test/test.py", line 1, in <module> import datasets File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module> from .arrow_dataset import Dataset File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 65, in <module> from .arrow_reader import ArrowReader File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_reader.py", line 28, in <module> import pyarrow.parquet as pq File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/__init__.py", line 20, in <module> from .core import * File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/core.py", line 45, in <module> from pyarrow.fs import (LocalFileSystem, FileSystem, FileType, File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/fs.py", line 49, in <module> from pyarrow._gcsfs import GcsFileSystem # noqa File "pyarrow/_gcsfs.pyx", line 1, in init pyarrow._gcsfs ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject ### Steps to reproduce the bug `import datasets` ### Expected behavior Successful import ### Environment info Conda environment, MacOS python 3.9.12 datasets 2.12.0 Got the same error with: ``` arrow-cpp 11.0.0 py310h7516544_0 pyarrow 12.0.0 pypi_0 pypi python 3.10.11 h7a1cb2a_2 datasets 2.13.0 pyhd8ed1ab_0 conda-forge ```
[ -0.5389391183853149, 0.41014090180397034, -0.09792473912239075, 0.2319422960281372, 0.14288535714149475, -0.13102033734321594, 0.21223437786102295, 0.2684710919857025, -0.408712774515152, 0.09050598740577698, -0.20407867431640625, 0.27507221698760986, -0.12025684118270874, 0.1409701108932495, -0.16671998798847198, 0.01760251820087433, 0.05824655294418335, 0.2816929221153259, -0.1661183387041092, 0.113141730427742, -0.10728545486927032, 0.16610445082187653, -0.21358206868171692, 0.11508075147867203, 0.011453785002231598, -0.10817255824804306, -0.14227774739265442, 0.24949845671653748, -0.43753454089164734, -0.7070934176445007, 0.3522906005382538, -0.086106076836586, 0.07033614069223404, 0.4895254969596863, -0.00011616970732575282, 0.18690964579582214, 0.2657691538333893, 0.06419306993484497, -0.253903865814209, -0.07424189150333405, 0.06377491354942322, -0.2764390707015991, 0.26972654461860657, -0.11235450953245163, 0.3193272650241852, -0.5484874248504639, 0.06671421974897385, 0.16740885376930237, 0.054839521646499634, 0.40047457814216614, 0.19530938565731049, 0.38214990496635437, 0.6554259061813354, 0.1227761059999466, 0.5305083990097046, 0.04909924045205116, 0.03578562289476395, 0.5898970365524292, 0.2579425871372223, 0.05691107362508774, 0.0021759532392024994, -0.20591427385807037, -0.1010093167424202, -0.048358254134655, 0.15855109691619873, -0.18132737278938293, -0.03536137938499451, -0.18852782249450684, -0.06856274604797363, -0.08543333411216736, 0.4250427186489105, -0.5830304026603699, -0.302016019821167, -0.09135070443153381, 0.10421205312013626, -0.45955967903137207, 0.28538691997528076, 0.21514496207237244, 0.1239168643951416, 0.22662369906902313, -0.08318190276622772, -0.12021125853061676, -0.3959175944328308, 0.18164576590061188, -0.32514679431915283, 0.24191302061080933, 0.029269661754369736, 0.19708991050720215, 0.00875172670930624, -0.18387901782989502, 0.42467594146728516, -0.02596220001578331, -0.23255464434623718, 0.08952406048774719, -0.22075620293617249, 0.081318199634552, 0.020974012091755867, 0.13495442271232605, -0.04143968224525452, 0.02640334889292717, -0.058164432644844055, -0.15183407068252563, -0.033698271960020065, 0.33083441853523254, 0.024396397173404694, 0.05486329272389412, -0.12570367753505707, 0.2684255838394165, 0.1664728820323944, 0.1868094801902771, -0.005677856504917145, -0.02999785915017128, -0.04185599088668823, -0.3846703767776489, 0.08216149359941483, 0.0356256403028965, 0.4344305098056793, -0.1588757187128067, -0.29218998551368713, -0.012626070529222488, -0.25384315848350525, 0.026433870196342468, -0.17737063765525818, 0.2993183434009552, -0.01885107159614563, 0.2504885196685791, 0.1386951059103012, 0.2536332607269287, -0.11470460891723633, -0.23161382973194122, -0.05686569958925247, 0.10283129662275314, -0.0738179013133049, -0.22125279903411865, 0.08629242330789566, -0.1755020022392273, 0.13045690953731537, 0.12832950055599213, 0.1933923065662384, 0.12288786470890045, -0.06554929167032242, -0.24240773916244507, -0.04746447876095772, 0.31247541308403015, -0.03729112073779106, 0.10041829198598862, 0.015014491975307465, -0.30412307381629944, -0.21219328045845032, 0.14690840244293213, -0.3801676332950592, -0.11307426542043686, -0.38429704308509827, 0.17333675920963287, -0.00567549467086792, -0.05924506485462189, -0.19764062762260437, -0.09340038895606995, 0.1950654685497284, -0.4064936637878418, -0.0562329925596714, -0.48926854133605957, 0.16215912997722626, -0.4678736925125122, -0.015019897371530533, 0.15141348540782928, -0.7889991998672485, 0.07376639544963837, 0.04906328022480011, 0.004440071061253548, 0.1919279396533966, 0.3100696802139282, -0.2902900278568268, -0.12284907698631287, -0.0004233941435813904, 0.1427394151687622, 0.2366839200258255, -0.21537001430988312, -0.6268244385719299, 0.0864512026309967, 0.03838047385215759, -0.24220477044582367, 0.1674947738647461, -0.17949894070625305, 0.19456103444099426, 0.09760883450508118, -0.10673335194587708, 0.1721334308385849, -0.07684064656496048, 0.04093795269727707, -0.19862762093544006, -0.5216740369796753, 0.2674814760684967, -0.03322679176926613, 0.10352544486522675, -0.39543211460113525, 0.35555097460746765, -0.3969314396381378, 0.29034629464149475, -0.1645258665084839, 0.057519592344760895, 0.33262306451797485, 0.3348727524280548, -0.11456172168254852, 0.021700289100408554, -0.2176801711320877, -0.2977602779865265, 0.1422601044178009, -0.381434828042984, -0.11011587828397751, -0.3259420096874237, -0.1059422641992569, -0.3133503198623657, 0.26993176341056824, 0.05359809473156929, -0.006133888382464647, 0.05970541015267372, 0.057409174740314484, -0.016452211886644363, 0.10308235138654709, -0.03366893529891968, 0.07832518219947815, -0.0958491861820221, 0.19671405851840973, -0.24218088388442993, 0.5291696190834045, -0.3428577184677124, -0.4746672213077545, 0.19328927993774414, -0.0023095812648534775, 0.0374557301402092, -0.06310087442398071, -0.14555492997169495, 0.4702662229537964, -0.028681166470050812, 0.3286389708518982, -0.1707378774881363, 0.084703728556633, 0.21563316881656647, -0.229253888130188, 0.32963529229164124, -0.028982695192098618, 0.08914411067962646, 0.20938627421855927, 0.13785672187805176, 0.16456446051597595, 0.16380859911441803, 0.09281909465789795, 0.12126252800226212, -0.22491805255413055, -0.030612699687480927, 0.13591116666793823, 0.1629302054643631, -0.009373307228088379, 0.04221060499548912, 0.1983906328678131, 0.12568755447864532, 0.1722821295261383, -0.2852168679237366, 0.08072225749492645, 0.42531582713127136, 0.0626024603843689, -0.008041251450777054, 0.1384713351726532, -0.2746993601322174, 0.050757043063640594, 0.36250460147857666, -0.14058038592338562, 0.29622507095336914, 0.3149271309375763, -0.1703774780035019, -0.029386475682258606, -0.0971117913722992, -0.052491623908281326, 0.18679046630859375, 0.13654297590255737, 0.2397942692041397, 0.07676659524440765, 0.623730480670929, 0.04727469012141228, -0.2200196385383606, -0.13672858476638794, 0.04518246650695801, 0.27634674310684204, -0.452684223651886, 0.308177649974823, -0.4269106388092041, -0.0024414435029029846, -0.23781991004943848, -0.154685840010643, -0.3824634552001953, -0.27317434549331665, -0.2290082722902298, 0.3882075548171997, 0.031330808997154236, 0.08750251680612564, -0.023035410791635513, -0.1944246143102646, 0.18350647389888763, -0.17203259468078613, 0.06762979924678802, -0.11229591071605682, -0.3621595501899719, 0.0946991890668869, 0.342587411403656, 0.12063385546207428, 0.19353339076042175, 0.03205987066030502, 0.03860313445329666, -0.05090917646884918, -0.47778546810150146, -0.1438167691230774, -0.025089098140597343, 0.19900289177894592, 0.1817106157541275, 0.11551493406295776, -0.07299236208200455, -0.46838411688804626, 0.057287078350782394, 0.08416453748941422, -0.3447721004486084, 0.1372157782316208, -0.34398332238197327, -0.1998528391122818, -0.0028321966528892517, -0.276289165019989, -0.4295882284641266, -0.3780532479286194, 0.1362106204032898, 0.3020915985107422, 0.23640713095664978, 0.3542707860469818, 0.3423806130886078, 0.01274484395980835, -0.0786948874592781, -0.10726942867040634, 0.23830220103263855, 0.028377175331115723, 0.28393781185150146, -0.07516976445913315, -0.257251501083374, -0.07669791579246521, -0.037464335560798645, 0.08720491826534271, 0.294569194316864, -0.4791855216026306, -0.014134753495454788, -0.3582625985145569, 0.5260703563690186, -0.08312098681926727, 0.14493517577648163, 0.22535274922847748, 0.15895995497703552, -0.004194937646389008, 0.003344491124153137, -0.1563226580619812, -0.26622116565704346, 0.2833780348300934, 0.07547761499881744, 0.055676694959402084, 0.3319579064846039, -0.19856581091880798, 0.6400830745697021, 0.023299410939216614, -0.2738661468029022, 0.4377114176750183, -0.2375326156616211, 0.45192140340805054, -0.10431645810604095, -0.3032712936401367, 0.06629733741283417, -0.10827210545539856, -0.07401157915592194, 0.044195711612701416, -0.22602307796478271, -0.3297971487045288, 0.12052588909864426, -0.18412691354751587, -0.23381878435611725, -0.14523108303546906, 0.09087691456079483, 0.14159071445465088, 0.3312854468822479, -0.08640037477016449, -0.2960985600948334, -0.2364920675754547, -0.21792711317539215, 0.025277383625507355, -0.08264269679784775, -0.22591671347618103, 0.038069967180490494, -0.035965826362371445, -0.13339830935001373, -0.34121182560920715, 0.30971473455429077, 0.17489559948444366, 0.2464342564344406, 0.1721387505531311, -0.0410853810608387, 0.11113014817237854, -0.21800363063812256, 0.32807719707489014, 0.09706304222345352, -0.182765394449234, 0.27574849128723145, 0.40072202682495117, -0.496793270111084, -0.23470546305179596, -0.19102361798286438, 0.27748310565948486, 0.24770592153072357, 0.18386921286582947, -0.3402397632598877, 0.15343794226646423, 0.16168956458568573, 0.5132279396057129, -0.044120822101831436, 0.16416697204113007, -0.27002739906311035, -0.10140333324670792, -0.4776964485645294, -0.10504379123449326, -0.01761382445693016, 0.33137673139572144, 0.005467850714921951, 0.06343299150466919, -0.14889757335186005, -0.24708475172519684, 0.0832427591085434, 0.28902047872543335, 0.3243051767349243, -0.07903829216957092, 0.11278222501277924, -0.31734713912010193, 0.0913165807723999, 0.5340574979782104, 0.7704090476036072, 0.20883658528327942, -0.34903720021247864, -0.016412770375609398, 0.05045154318213463, 0.32675692439079285, 0.11366061866283417, -0.19308175146579742, 0.18378815054893494, -0.11625105142593384, 0.10890750586986542, 0.12137383967638016, 0.04006081819534302, 0.24377843737602234, -0.07671591639518738, -0.2914526164531708, 0.08982376009225845, 0.41707974672317505, -0.03200620412826538, -0.013796605169773102, 0.18926988542079926, 0.4060444235801697, -0.1646333634853363, 0.3946790099143982, 0.03605928644537926, 0.8309652805328369, -0.04272161424160004, 0.0664454996585846, 0.5179725289344788, -0.40474075078964233, 0.16809165477752686, -0.02481294423341751, -0.0014977939426898956, -0.5320702791213989, 0.02998863160610199, 0.010089166462421417, -0.32545042037963867, 0.378400057554245, -0.024959616363048553, -0.2201615273952484, 0.13777568936347961, -0.01617369055747986, 0.21605737507343292, 0.007065225392580032, 0.16433557868003845, -0.0762438178062439, 0.12335334718227386, -0.3094923794269562, 0.09066323190927505, -0.1320367455482483, -0.20527583360671997, -0.05608992651104927, -0.08132266998291016, -0.27471923828125, -0.2721797823905945, -0.2812002897262573, -0.04469974339008331, -0.4894630014896393, 0.2627429664134979, 0.32856354117393494, -0.33071666955947876, 0.3076707124710083, 0.16620312631130219, -0.04406396299600601, 0.13957718014717102, -0.0796767994761467, 0.097402423620224, -0.013216350227594376, -0.056625720113515854, 0.12572379410266876, 0.13607007265090942, 0.10124372690916061, -0.051036760210990906, -0.24735097587108612, 0.3664361834526062, 0.06387249380350113, -0.17888739705085754, 0.14817728102207184, 0.12165239453315735, 0.2961480915546417, -0.3896706700325012, -0.059169575572013855, -0.42517295479774475, 0.09698713570833206, -0.15345673263072968, 0.05929594486951828, -0.1271677315235138, 0.26862481236457825, 0.20056328177452087, 0.013806306757032871, -0.1889253556728363, -0.2841084599494934, 0.4088476896286011, 0.03163333982229233, 0.268120139837265, 0.5743934512138367, 0.2638583779335022, -0.18598122894763947, -0.036853402853012085, 0.12482032179832458, 0.1295132040977478, -0.489487886428833, -0.0472915843129158, -0.09893018007278442, 0.1132626086473465, 0.06401893496513367, 0.03400582820177078, 0.283963680267334, 0.2301625907421112, -0.06152021512389183, -0.3313921093940735, -0.2537413239479065, 0.23526616394519806, 0.0836174413561821, -0.05974213778972626, 0.28060585260391235, 0.17075057327747345, -0.13414418697357178, -0.07644034922122955, -0.24748116731643677, 0.30566567182540894, -0.06656534224748611, 0.2226821929216385, 0.08635172247886658, -0.04553864151239395, -0.05687759071588516, -0.22526873648166656, 0.13118326663970947, 0.01636163704097271, 0.012625876814126968, -0.17638233304023743, -0.16661405563354492, 0.09999198466539383, -0.001013217493891716, -0.08072219789028168, -0.016165312379598618, -0.15215787291526794, -0.011200176551938057, -0.01796279475092888, 0.07604896277189255, -0.01460535079240799, -0.11940799653530121, -0.1400480568408966, 0.2809409499168396, -0.12060108780860901, -0.1210639476776123, 0.23246072232723236, -0.23627105355262756, 0.22578051686286926, 0.059537820518016815, 0.5264185070991516, -0.024768680334091187, 0.03063800185918808, -0.1317235678434372, 0.15129616856575012, -0.34175971150398254, -0.05293168127536774, 0.25683096051216125, -0.3094082772731781, -0.06632181257009506, 0.09374935925006866, 0.23149418830871582, 0.41054677963256836, -0.12172404676675797, -0.08593331277370453, 0.2554229199886322, 0.13186591863632202, -0.3775715231895447, -0.17314814031124115, 0.04951814189553261, -0.10026286542415619, -0.025594010949134827, 0.059920601546764374, 0.3110899329185486, -0.18170717358589172, 0.09042950719594955, 0.34185144305229187, 0.2442220151424408, 0.26974204182624817, -0.0024246424436569214, 0.44836151599884033, 0.012056268751621246, -0.20428091287612915, 0.4182865619659424, 0.1756482720375061, 0.31129884719848633, 0.26551252603530884, -0.21094004809856415, 0.16680176556110382, 0.049634188413619995, -0.19737444818019867, 0.09603322297334671, -0.42627519369125366, -0.19237294793128967, -0.0999845340847969, 0.31498318910598755, -0.061651088297367096, 0.46200695633888245, 0.45272618532180786, 0.27119389176368713, -0.07099601626396179, 0.02905261516571045, 0.3461710214614868, -0.00007067294791340828, 0.0676976889371872, -0.07238531112670898, -0.2340080291032791, -0.2650998830795288, -0.014262579381465912, -0.2551712691783905, -0.24806059896945953, 0.30818596482276917, 0.2364887148141861, -0.3372643291950226, -0.7492637038230896, 0.3052001893520355, 0.1087694764137268, 0.12708932161331177, -0.2866680324077606, 0.35383695363998413, 0.24741961061954498, -0.1135721281170845, -0.10147155821323395, 0.30838122963905334, 0.8915085792541504, 0.31771764159202576, -0.02600981295108795, 0.0024152323603630066, -0.004144560545682907, -0.15640640258789062, 0.04656856507062912, -0.1994176208972931, -0.19490215182304382, 0.4521815776824951, 0.2232360988855362, 0.17558464407920837, -0.14350566267967224, -0.19015607237815857, 0.08037736266851425, -0.002545885741710663, -0.268173485994339, 0.13124673068523407, -0.1365811973810196, -0.20019450783729553, 0.0013935090973973274, -0.0007405504584312439, -0.42817452549934387, -0.00899314135313034, 0.4281740188598633, 0.13380154967308044, 0.11360006779432297, -0.12113121151924133, 0.04415826499462128, 0.045718587934970856, 0.44777101278305054, 0.6064440011978149, 0.13685736060142517, -0.1345338374376297, -0.08647548407316208, -0.42366355657577515, 0.275939404964447, -0.332254558801651, -0.044852398335933685, 0.12691543996334076, 0.20620226860046387, 0.0542919784784317, 0.07830438017845154, 0.27757400274276733, 0.420621782541275, -0.17724910378456116, -0.05108058452606201, -0.332472562789917, -0.10067255795001984, 0.046692438423633575, -0.22204174101352692, -0.12957659363746643, -0.24664458632469177, 0.3911384344100952, -0.2919163107872009, 0.06642098724842072, -0.3800824284553528, -0.14073927700519562, 0.25868332386016846, -0.08691835403442383, 0.45785221457481384, 0.0009060781449079514, 0.41875797510147095, 0.03265461325645447, -0.17067331075668335, -0.3290652632713318, -0.3339603543281555, -0.28833654522895813, 0.3402409255504608, -0.05063445493578911, 0.4427412152290344, -0.18638867139816284, -0.3720743954181671, -0.10302574187517166, 0.2508411407470703, -0.09061776846647263, 0.15800976753234863, 0.19902543723583221, 0.03442266583442688, 0.0075860098004341125, 0.01790967583656311, -0.08486709743738174, -0.08275871723890305, 0.09513992816209793, 0.16722926497459412, -0.2761419415473938, -0.6448034048080444, 0.241926908493042, -0.2260374277830124, -0.20503024756908417, 0.04457248002290726, 0.05650459975004196, 0.17781129479408264, 0.026200050488114357, -0.4378465712070465, 0.234495609998703, 0.40572476387023926, -0.15454722940921783, -0.12775224447250366, 0.18590374290943146, 0.10264274477958679, 0.14742787182331085, -0.025282561779022217, 0.3295576870441437, -0.06774131953716278, -0.28767818212509155, -0.11397577822208405, -0.18642500042915344 ]
https://github.com/huggingface/datasets/issues/5923
> I got the same error, pyarrow 12.0.0 released May/2023 (https://pypi.org/project/pyarrow/) is not compatible, running `pip install pyarrow==11.0.0` to force install the previous version solved the problem. > > Do we need to update dependencies? This solved the issue for me as well.
Cannot import datasets - ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility
### Describe the bug When trying to import datasets, I get a pyarrow ValueError: Traceback (most recent call last): File "/Users/edward/test/test.py", line 1, in <module> import datasets File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module> from .arrow_dataset import Dataset File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 65, in <module> from .arrow_reader import ArrowReader File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_reader.py", line 28, in <module> import pyarrow.parquet as pq File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/__init__.py", line 20, in <module> from .core import * File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/core.py", line 45, in <module> from pyarrow.fs import (LocalFileSystem, FileSystem, FileType, File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/fs.py", line 49, in <module> from pyarrow._gcsfs import GcsFileSystem # noqa File "pyarrow/_gcsfs.pyx", line 1, in init pyarrow._gcsfs ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject ### Steps to reproduce the bug `import datasets` ### Expected behavior Successful import ### Environment info Conda environment, MacOS python 3.9.12 datasets 2.12.0
43
Cannot import datasets - ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility ### Describe the bug When trying to import datasets, I get a pyarrow ValueError: Traceback (most recent call last): File "/Users/edward/test/test.py", line 1, in <module> import datasets File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module> from .arrow_dataset import Dataset File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 65, in <module> from .arrow_reader import ArrowReader File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_reader.py", line 28, in <module> import pyarrow.parquet as pq File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/__init__.py", line 20, in <module> from .core import * File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/core.py", line 45, in <module> from pyarrow.fs import (LocalFileSystem, FileSystem, FileType, File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/fs.py", line 49, in <module> from pyarrow._gcsfs import GcsFileSystem # noqa File "pyarrow/_gcsfs.pyx", line 1, in init pyarrow._gcsfs ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject ### Steps to reproduce the bug `import datasets` ### Expected behavior Successful import ### Environment info Conda environment, MacOS python 3.9.12 datasets 2.12.0 > I got the same error, pyarrow 12.0.0 released May/2023 (https://pypi.org/project/pyarrow/) is not compatible, running `pip install pyarrow==11.0.0` to force install the previous version solved the problem. > > Do we need to update dependencies? This solved the issue for me as well.
[ -0.5389391183853149, 0.41014090180397034, -0.09792473912239075, 0.2319422960281372, 0.14288535714149475, -0.13102033734321594, 0.21223437786102295, 0.2684710919857025, -0.408712774515152, 0.09050598740577698, -0.20407867431640625, 0.27507221698760986, -0.12025684118270874, 0.1409701108932495, -0.16671998798847198, 0.01760251820087433, 0.05824655294418335, 0.2816929221153259, -0.1661183387041092, 0.113141730427742, -0.10728545486927032, 0.16610445082187653, -0.21358206868171692, 0.11508075147867203, 0.011453785002231598, -0.10817255824804306, -0.14227774739265442, 0.24949845671653748, -0.43753454089164734, -0.7070934176445007, 0.3522906005382538, -0.086106076836586, 0.07033614069223404, 0.4895254969596863, -0.00011616970732575282, 0.18690964579582214, 0.2657691538333893, 0.06419306993484497, -0.253903865814209, -0.07424189150333405, 0.06377491354942322, -0.2764390707015991, 0.26972654461860657, -0.11235450953245163, 0.3193272650241852, -0.5484874248504639, 0.06671421974897385, 0.16740885376930237, 0.054839521646499634, 0.40047457814216614, 0.19530938565731049, 0.38214990496635437, 0.6554259061813354, 0.1227761059999466, 0.5305083990097046, 0.04909924045205116, 0.03578562289476395, 0.5898970365524292, 0.2579425871372223, 0.05691107362508774, 0.0021759532392024994, -0.20591427385807037, -0.1010093167424202, -0.048358254134655, 0.15855109691619873, -0.18132737278938293, -0.03536137938499451, -0.18852782249450684, -0.06856274604797363, -0.08543333411216736, 0.4250427186489105, -0.5830304026603699, -0.302016019821167, -0.09135070443153381, 0.10421205312013626, -0.45955967903137207, 0.28538691997528076, 0.21514496207237244, 0.1239168643951416, 0.22662369906902313, -0.08318190276622772, -0.12021125853061676, -0.3959175944328308, 0.18164576590061188, -0.32514679431915283, 0.24191302061080933, 0.029269661754369736, 0.19708991050720215, 0.00875172670930624, -0.18387901782989502, 0.42467594146728516, -0.02596220001578331, -0.23255464434623718, 0.08952406048774719, -0.22075620293617249, 0.081318199634552, 0.020974012091755867, 0.13495442271232605, -0.04143968224525452, 0.02640334889292717, -0.058164432644844055, -0.15183407068252563, -0.033698271960020065, 0.33083441853523254, 0.024396397173404694, 0.05486329272389412, -0.12570367753505707, 0.2684255838394165, 0.1664728820323944, 0.1868094801902771, -0.005677856504917145, -0.02999785915017128, -0.04185599088668823, -0.3846703767776489, 0.08216149359941483, 0.0356256403028965, 0.4344305098056793, -0.1588757187128067, -0.29218998551368713, -0.012626070529222488, -0.25384315848350525, 0.026433870196342468, -0.17737063765525818, 0.2993183434009552, -0.01885107159614563, 0.2504885196685791, 0.1386951059103012, 0.2536332607269287, -0.11470460891723633, -0.23161382973194122, -0.05686569958925247, 0.10283129662275314, -0.0738179013133049, -0.22125279903411865, 0.08629242330789566, -0.1755020022392273, 0.13045690953731537, 0.12832950055599213, 0.1933923065662384, 0.12288786470890045, -0.06554929167032242, -0.24240773916244507, -0.04746447876095772, 0.31247541308403015, -0.03729112073779106, 0.10041829198598862, 0.015014491975307465, -0.30412307381629944, -0.21219328045845032, 0.14690840244293213, -0.3801676332950592, -0.11307426542043686, -0.38429704308509827, 0.17333675920963287, -0.00567549467086792, -0.05924506485462189, -0.19764062762260437, -0.09340038895606995, 0.1950654685497284, -0.4064936637878418, -0.0562329925596714, -0.48926854133605957, 0.16215912997722626, -0.4678736925125122, -0.015019897371530533, 0.15141348540782928, -0.7889991998672485, 0.07376639544963837, 0.04906328022480011, 0.004440071061253548, 0.1919279396533966, 0.3100696802139282, -0.2902900278568268, -0.12284907698631287, -0.0004233941435813904, 0.1427394151687622, 0.2366839200258255, -0.21537001430988312, -0.6268244385719299, 0.0864512026309967, 0.03838047385215759, -0.24220477044582367, 0.1674947738647461, -0.17949894070625305, 0.19456103444099426, 0.09760883450508118, -0.10673335194587708, 0.1721334308385849, -0.07684064656496048, 0.04093795269727707, -0.19862762093544006, -0.5216740369796753, 0.2674814760684967, -0.03322679176926613, 0.10352544486522675, -0.39543211460113525, 0.35555097460746765, -0.3969314396381378, 0.29034629464149475, -0.1645258665084839, 0.057519592344760895, 0.33262306451797485, 0.3348727524280548, -0.11456172168254852, 0.021700289100408554, -0.2176801711320877, -0.2977602779865265, 0.1422601044178009, -0.381434828042984, -0.11011587828397751, -0.3259420096874237, -0.1059422641992569, -0.3133503198623657, 0.26993176341056824, 0.05359809473156929, -0.006133888382464647, 0.05970541015267372, 0.057409174740314484, -0.016452211886644363, 0.10308235138654709, -0.03366893529891968, 0.07832518219947815, -0.0958491861820221, 0.19671405851840973, -0.24218088388442993, 0.5291696190834045, -0.3428577184677124, -0.4746672213077545, 0.19328927993774414, -0.0023095812648534775, 0.0374557301402092, -0.06310087442398071, -0.14555492997169495, 0.4702662229537964, -0.028681166470050812, 0.3286389708518982, -0.1707378774881363, 0.084703728556633, 0.21563316881656647, -0.229253888130188, 0.32963529229164124, -0.028982695192098618, 0.08914411067962646, 0.20938627421855927, 0.13785672187805176, 0.16456446051597595, 0.16380859911441803, 0.09281909465789795, 0.12126252800226212, -0.22491805255413055, -0.030612699687480927, 0.13591116666793823, 0.1629302054643631, -0.009373307228088379, 0.04221060499548912, 0.1983906328678131, 0.12568755447864532, 0.1722821295261383, -0.2852168679237366, 0.08072225749492645, 0.42531582713127136, 0.0626024603843689, -0.008041251450777054, 0.1384713351726532, -0.2746993601322174, 0.050757043063640594, 0.36250460147857666, -0.14058038592338562, 0.29622507095336914, 0.3149271309375763, -0.1703774780035019, -0.029386475682258606, -0.0971117913722992, -0.052491623908281326, 0.18679046630859375, 0.13654297590255737, 0.2397942692041397, 0.07676659524440765, 0.623730480670929, 0.04727469012141228, -0.2200196385383606, -0.13672858476638794, 0.04518246650695801, 0.27634674310684204, -0.452684223651886, 0.308177649974823, -0.4269106388092041, -0.0024414435029029846, -0.23781991004943848, -0.154685840010643, -0.3824634552001953, -0.27317434549331665, -0.2290082722902298, 0.3882075548171997, 0.031330808997154236, 0.08750251680612564, -0.023035410791635513, -0.1944246143102646, 0.18350647389888763, -0.17203259468078613, 0.06762979924678802, -0.11229591071605682, -0.3621595501899719, 0.0946991890668869, 0.342587411403656, 0.12063385546207428, 0.19353339076042175, 0.03205987066030502, 0.03860313445329666, -0.05090917646884918, -0.47778546810150146, -0.1438167691230774, -0.025089098140597343, 0.19900289177894592, 0.1817106157541275, 0.11551493406295776, -0.07299236208200455, -0.46838411688804626, 0.057287078350782394, 0.08416453748941422, -0.3447721004486084, 0.1372157782316208, -0.34398332238197327, -0.1998528391122818, -0.0028321966528892517, -0.276289165019989, -0.4295882284641266, -0.3780532479286194, 0.1362106204032898, 0.3020915985107422, 0.23640713095664978, 0.3542707860469818, 0.3423806130886078, 0.01274484395980835, -0.0786948874592781, -0.10726942867040634, 0.23830220103263855, 0.028377175331115723, 0.28393781185150146, -0.07516976445913315, -0.257251501083374, -0.07669791579246521, -0.037464335560798645, 0.08720491826534271, 0.294569194316864, -0.4791855216026306, -0.014134753495454788, -0.3582625985145569, 0.5260703563690186, -0.08312098681926727, 0.14493517577648163, 0.22535274922847748, 0.15895995497703552, -0.004194937646389008, 0.003344491124153137, -0.1563226580619812, -0.26622116565704346, 0.2833780348300934, 0.07547761499881744, 0.055676694959402084, 0.3319579064846039, -0.19856581091880798, 0.6400830745697021, 0.023299410939216614, -0.2738661468029022, 0.4377114176750183, -0.2375326156616211, 0.45192140340805054, -0.10431645810604095, -0.3032712936401367, 0.06629733741283417, -0.10827210545539856, -0.07401157915592194, 0.044195711612701416, -0.22602307796478271, -0.3297971487045288, 0.12052588909864426, -0.18412691354751587, -0.23381878435611725, -0.14523108303546906, 0.09087691456079483, 0.14159071445465088, 0.3312854468822479, -0.08640037477016449, -0.2960985600948334, -0.2364920675754547, -0.21792711317539215, 0.025277383625507355, -0.08264269679784775, -0.22591671347618103, 0.038069967180490494, -0.035965826362371445, -0.13339830935001373, -0.34121182560920715, 0.30971473455429077, 0.17489559948444366, 0.2464342564344406, 0.1721387505531311, -0.0410853810608387, 0.11113014817237854, -0.21800363063812256, 0.32807719707489014, 0.09706304222345352, -0.182765394449234, 0.27574849128723145, 0.40072202682495117, -0.496793270111084, -0.23470546305179596, -0.19102361798286438, 0.27748310565948486, 0.24770592153072357, 0.18386921286582947, -0.3402397632598877, 0.15343794226646423, 0.16168956458568573, 0.5132279396057129, -0.044120822101831436, 0.16416697204113007, -0.27002739906311035, -0.10140333324670792, -0.4776964485645294, -0.10504379123449326, -0.01761382445693016, 0.33137673139572144, 0.005467850714921951, 0.06343299150466919, -0.14889757335186005, -0.24708475172519684, 0.0832427591085434, 0.28902047872543335, 0.3243051767349243, -0.07903829216957092, 0.11278222501277924, -0.31734713912010193, 0.0913165807723999, 0.5340574979782104, 0.7704090476036072, 0.20883658528327942, -0.34903720021247864, -0.016412770375609398, 0.05045154318213463, 0.32675692439079285, 0.11366061866283417, -0.19308175146579742, 0.18378815054893494, -0.11625105142593384, 0.10890750586986542, 0.12137383967638016, 0.04006081819534302, 0.24377843737602234, -0.07671591639518738, -0.2914526164531708, 0.08982376009225845, 0.41707974672317505, -0.03200620412826538, -0.013796605169773102, 0.18926988542079926, 0.4060444235801697, -0.1646333634853363, 0.3946790099143982, 0.03605928644537926, 0.8309652805328369, -0.04272161424160004, 0.0664454996585846, 0.5179725289344788, -0.40474075078964233, 0.16809165477752686, -0.02481294423341751, -0.0014977939426898956, -0.5320702791213989, 0.02998863160610199, 0.010089166462421417, -0.32545042037963867, 0.378400057554245, -0.024959616363048553, -0.2201615273952484, 0.13777568936347961, -0.01617369055747986, 0.21605737507343292, 0.007065225392580032, 0.16433557868003845, -0.0762438178062439, 0.12335334718227386, -0.3094923794269562, 0.09066323190927505, -0.1320367455482483, -0.20527583360671997, -0.05608992651104927, -0.08132266998291016, -0.27471923828125, -0.2721797823905945, -0.2812002897262573, -0.04469974339008331, -0.4894630014896393, 0.2627429664134979, 0.32856354117393494, -0.33071666955947876, 0.3076707124710083, 0.16620312631130219, -0.04406396299600601, 0.13957718014717102, -0.0796767994761467, 0.097402423620224, -0.013216350227594376, -0.056625720113515854, 0.12572379410266876, 0.13607007265090942, 0.10124372690916061, -0.051036760210990906, -0.24735097587108612, 0.3664361834526062, 0.06387249380350113, -0.17888739705085754, 0.14817728102207184, 0.12165239453315735, 0.2961480915546417, -0.3896706700325012, -0.059169575572013855, -0.42517295479774475, 0.09698713570833206, -0.15345673263072968, 0.05929594486951828, -0.1271677315235138, 0.26862481236457825, 0.20056328177452087, 0.013806306757032871, -0.1889253556728363, -0.2841084599494934, 0.4088476896286011, 0.03163333982229233, 0.268120139837265, 0.5743934512138367, 0.2638583779335022, -0.18598122894763947, -0.036853402853012085, 0.12482032179832458, 0.1295132040977478, -0.489487886428833, -0.0472915843129158, -0.09893018007278442, 0.1132626086473465, 0.06401893496513367, 0.03400582820177078, 0.283963680267334, 0.2301625907421112, -0.06152021512389183, -0.3313921093940735, -0.2537413239479065, 0.23526616394519806, 0.0836174413561821, -0.05974213778972626, 0.28060585260391235, 0.17075057327747345, -0.13414418697357178, -0.07644034922122955, -0.24748116731643677, 0.30566567182540894, -0.06656534224748611, 0.2226821929216385, 0.08635172247886658, -0.04553864151239395, -0.05687759071588516, -0.22526873648166656, 0.13118326663970947, 0.01636163704097271, 0.012625876814126968, -0.17638233304023743, -0.16661405563354492, 0.09999198466539383, -0.001013217493891716, -0.08072219789028168, -0.016165312379598618, -0.15215787291526794, -0.011200176551938057, -0.01796279475092888, 0.07604896277189255, -0.01460535079240799, -0.11940799653530121, -0.1400480568408966, 0.2809409499168396, -0.12060108780860901, -0.1210639476776123, 0.23246072232723236, -0.23627105355262756, 0.22578051686286926, 0.059537820518016815, 0.5264185070991516, -0.024768680334091187, 0.03063800185918808, -0.1317235678434372, 0.15129616856575012, -0.34175971150398254, -0.05293168127536774, 0.25683096051216125, -0.3094082772731781, -0.06632181257009506, 0.09374935925006866, 0.23149418830871582, 0.41054677963256836, -0.12172404676675797, -0.08593331277370453, 0.2554229199886322, 0.13186591863632202, -0.3775715231895447, -0.17314814031124115, 0.04951814189553261, -0.10026286542415619, -0.025594010949134827, 0.059920601546764374, 0.3110899329185486, -0.18170717358589172, 0.09042950719594955, 0.34185144305229187, 0.2442220151424408, 0.26974204182624817, -0.0024246424436569214, 0.44836151599884033, 0.012056268751621246, -0.20428091287612915, 0.4182865619659424, 0.1756482720375061, 0.31129884719848633, 0.26551252603530884, -0.21094004809856415, 0.16680176556110382, 0.049634188413619995, -0.19737444818019867, 0.09603322297334671, -0.42627519369125366, -0.19237294793128967, -0.0999845340847969, 0.31498318910598755, -0.061651088297367096, 0.46200695633888245, 0.45272618532180786, 0.27119389176368713, -0.07099601626396179, 0.02905261516571045, 0.3461710214614868, -0.00007067294791340828, 0.0676976889371872, -0.07238531112670898, -0.2340080291032791, -0.2650998830795288, -0.014262579381465912, -0.2551712691783905, -0.24806059896945953, 0.30818596482276917, 0.2364887148141861, -0.3372643291950226, -0.7492637038230896, 0.3052001893520355, 0.1087694764137268, 0.12708932161331177, -0.2866680324077606, 0.35383695363998413, 0.24741961061954498, -0.1135721281170845, -0.10147155821323395, 0.30838122963905334, 0.8915085792541504, 0.31771764159202576, -0.02600981295108795, 0.0024152323603630066, -0.004144560545682907, -0.15640640258789062, 0.04656856507062912, -0.1994176208972931, -0.19490215182304382, 0.4521815776824951, 0.2232360988855362, 0.17558464407920837, -0.14350566267967224, -0.19015607237815857, 0.08037736266851425, -0.002545885741710663, -0.268173485994339, 0.13124673068523407, -0.1365811973810196, -0.20019450783729553, 0.0013935090973973274, -0.0007405504584312439, -0.42817452549934387, -0.00899314135313034, 0.4281740188598633, 0.13380154967308044, 0.11360006779432297, -0.12113121151924133, 0.04415826499462128, 0.045718587934970856, 0.44777101278305054, 0.6064440011978149, 0.13685736060142517, -0.1345338374376297, -0.08647548407316208, -0.42366355657577515, 0.275939404964447, -0.332254558801651, -0.044852398335933685, 0.12691543996334076, 0.20620226860046387, 0.0542919784784317, 0.07830438017845154, 0.27757400274276733, 0.420621782541275, -0.17724910378456116, -0.05108058452606201, -0.332472562789917, -0.10067255795001984, 0.046692438423633575, -0.22204174101352692, -0.12957659363746643, -0.24664458632469177, 0.3911384344100952, -0.2919163107872009, 0.06642098724842072, -0.3800824284553528, -0.14073927700519562, 0.25868332386016846, -0.08691835403442383, 0.45785221457481384, 0.0009060781449079514, 0.41875797510147095, 0.03265461325645447, -0.17067331075668335, -0.3290652632713318, -0.3339603543281555, -0.28833654522895813, 0.3402409255504608, -0.05063445493578911, 0.4427412152290344, -0.18638867139816284, -0.3720743954181671, -0.10302574187517166, 0.2508411407470703, -0.09061776846647263, 0.15800976753234863, 0.19902543723583221, 0.03442266583442688, 0.0075860098004341125, 0.01790967583656311, -0.08486709743738174, -0.08275871723890305, 0.09513992816209793, 0.16722926497459412, -0.2761419415473938, -0.6448034048080444, 0.241926908493042, -0.2260374277830124, -0.20503024756908417, 0.04457248002290726, 0.05650459975004196, 0.17781129479408264, 0.026200050488114357, -0.4378465712070465, 0.234495609998703, 0.40572476387023926, -0.15454722940921783, -0.12775224447250366, 0.18590374290943146, 0.10264274477958679, 0.14742787182331085, -0.025282561779022217, 0.3295576870441437, -0.06774131953716278, -0.28767818212509155, -0.11397577822208405, -0.18642500042915344 ]
https://github.com/huggingface/datasets/issues/5923
> I got the same error, pyarrow 12.0.0 released May/2023 (https://pypi.org/project/pyarrow/) is not compatible, running `pip install pyarrow==11.0.0` to force install the previous version solved the problem. > > Do we need to update dependencies? Solved it for me also
Cannot import datasets - ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility
### Describe the bug When trying to import datasets, I get a pyarrow ValueError: Traceback (most recent call last): File "/Users/edward/test/test.py", line 1, in <module> import datasets File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module> from .arrow_dataset import Dataset File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 65, in <module> from .arrow_reader import ArrowReader File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_reader.py", line 28, in <module> import pyarrow.parquet as pq File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/__init__.py", line 20, in <module> from .core import * File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/core.py", line 45, in <module> from pyarrow.fs import (LocalFileSystem, FileSystem, FileType, File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/fs.py", line 49, in <module> from pyarrow._gcsfs import GcsFileSystem # noqa File "pyarrow/_gcsfs.pyx", line 1, in init pyarrow._gcsfs ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject ### Steps to reproduce the bug `import datasets` ### Expected behavior Successful import ### Environment info Conda environment, MacOS python 3.9.12 datasets 2.12.0
40
Cannot import datasets - ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility ### Describe the bug When trying to import datasets, I get a pyarrow ValueError: Traceback (most recent call last): File "/Users/edward/test/test.py", line 1, in <module> import datasets File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module> from .arrow_dataset import Dataset File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 65, in <module> from .arrow_reader import ArrowReader File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_reader.py", line 28, in <module> import pyarrow.parquet as pq File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/__init__.py", line 20, in <module> from .core import * File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/core.py", line 45, in <module> from pyarrow.fs import (LocalFileSystem, FileSystem, FileType, File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/fs.py", line 49, in <module> from pyarrow._gcsfs import GcsFileSystem # noqa File "pyarrow/_gcsfs.pyx", line 1, in init pyarrow._gcsfs ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject ### Steps to reproduce the bug `import datasets` ### Expected behavior Successful import ### Environment info Conda environment, MacOS python 3.9.12 datasets 2.12.0 > I got the same error, pyarrow 12.0.0 released May/2023 (https://pypi.org/project/pyarrow/) is not compatible, running `pip install pyarrow==11.0.0` to force install the previous version solved the problem. > > Do we need to update dependencies? Solved it for me also
[ -0.5389391183853149, 0.41014090180397034, -0.09792473912239075, 0.2319422960281372, 0.14288535714149475, -0.13102033734321594, 0.21223437786102295, 0.2684710919857025, -0.408712774515152, 0.09050598740577698, -0.20407867431640625, 0.27507221698760986, -0.12025684118270874, 0.1409701108932495, -0.16671998798847198, 0.01760251820087433, 0.05824655294418335, 0.2816929221153259, -0.1661183387041092, 0.113141730427742, -0.10728545486927032, 0.16610445082187653, -0.21358206868171692, 0.11508075147867203, 0.011453785002231598, -0.10817255824804306, -0.14227774739265442, 0.24949845671653748, -0.43753454089164734, -0.7070934176445007, 0.3522906005382538, -0.086106076836586, 0.07033614069223404, 0.4895254969596863, -0.00011616970732575282, 0.18690964579582214, 0.2657691538333893, 0.06419306993484497, -0.253903865814209, -0.07424189150333405, 0.06377491354942322, -0.2764390707015991, 0.26972654461860657, -0.11235450953245163, 0.3193272650241852, -0.5484874248504639, 0.06671421974897385, 0.16740885376930237, 0.054839521646499634, 0.40047457814216614, 0.19530938565731049, 0.38214990496635437, 0.6554259061813354, 0.1227761059999466, 0.5305083990097046, 0.04909924045205116, 0.03578562289476395, 0.5898970365524292, 0.2579425871372223, 0.05691107362508774, 0.0021759532392024994, -0.20591427385807037, -0.1010093167424202, -0.048358254134655, 0.15855109691619873, -0.18132737278938293, -0.03536137938499451, -0.18852782249450684, -0.06856274604797363, -0.08543333411216736, 0.4250427186489105, -0.5830304026603699, -0.302016019821167, -0.09135070443153381, 0.10421205312013626, -0.45955967903137207, 0.28538691997528076, 0.21514496207237244, 0.1239168643951416, 0.22662369906902313, -0.08318190276622772, -0.12021125853061676, -0.3959175944328308, 0.18164576590061188, -0.32514679431915283, 0.24191302061080933, 0.029269661754369736, 0.19708991050720215, 0.00875172670930624, -0.18387901782989502, 0.42467594146728516, -0.02596220001578331, -0.23255464434623718, 0.08952406048774719, -0.22075620293617249, 0.081318199634552, 0.020974012091755867, 0.13495442271232605, -0.04143968224525452, 0.02640334889292717, -0.058164432644844055, -0.15183407068252563, -0.033698271960020065, 0.33083441853523254, 0.024396397173404694, 0.05486329272389412, -0.12570367753505707, 0.2684255838394165, 0.1664728820323944, 0.1868094801902771, -0.005677856504917145, -0.02999785915017128, -0.04185599088668823, -0.3846703767776489, 0.08216149359941483, 0.0356256403028965, 0.4344305098056793, -0.1588757187128067, -0.29218998551368713, -0.012626070529222488, -0.25384315848350525, 0.026433870196342468, -0.17737063765525818, 0.2993183434009552, -0.01885107159614563, 0.2504885196685791, 0.1386951059103012, 0.2536332607269287, -0.11470460891723633, -0.23161382973194122, -0.05686569958925247, 0.10283129662275314, -0.0738179013133049, -0.22125279903411865, 0.08629242330789566, -0.1755020022392273, 0.13045690953731537, 0.12832950055599213, 0.1933923065662384, 0.12288786470890045, -0.06554929167032242, -0.24240773916244507, -0.04746447876095772, 0.31247541308403015, -0.03729112073779106, 0.10041829198598862, 0.015014491975307465, -0.30412307381629944, -0.21219328045845032, 0.14690840244293213, -0.3801676332950592, -0.11307426542043686, -0.38429704308509827, 0.17333675920963287, -0.00567549467086792, -0.05924506485462189, -0.19764062762260437, -0.09340038895606995, 0.1950654685497284, -0.4064936637878418, -0.0562329925596714, -0.48926854133605957, 0.16215912997722626, -0.4678736925125122, -0.015019897371530533, 0.15141348540782928, -0.7889991998672485, 0.07376639544963837, 0.04906328022480011, 0.004440071061253548, 0.1919279396533966, 0.3100696802139282, -0.2902900278568268, -0.12284907698631287, -0.0004233941435813904, 0.1427394151687622, 0.2366839200258255, -0.21537001430988312, -0.6268244385719299, 0.0864512026309967, 0.03838047385215759, -0.24220477044582367, 0.1674947738647461, -0.17949894070625305, 0.19456103444099426, 0.09760883450508118, -0.10673335194587708, 0.1721334308385849, -0.07684064656496048, 0.04093795269727707, -0.19862762093544006, -0.5216740369796753, 0.2674814760684967, -0.03322679176926613, 0.10352544486522675, -0.39543211460113525, 0.35555097460746765, -0.3969314396381378, 0.29034629464149475, -0.1645258665084839, 0.057519592344760895, 0.33262306451797485, 0.3348727524280548, -0.11456172168254852, 0.021700289100408554, -0.2176801711320877, -0.2977602779865265, 0.1422601044178009, -0.381434828042984, -0.11011587828397751, -0.3259420096874237, -0.1059422641992569, -0.3133503198623657, 0.26993176341056824, 0.05359809473156929, -0.006133888382464647, 0.05970541015267372, 0.057409174740314484, -0.016452211886644363, 0.10308235138654709, -0.03366893529891968, 0.07832518219947815, -0.0958491861820221, 0.19671405851840973, -0.24218088388442993, 0.5291696190834045, -0.3428577184677124, -0.4746672213077545, 0.19328927993774414, -0.0023095812648534775, 0.0374557301402092, -0.06310087442398071, -0.14555492997169495, 0.4702662229537964, -0.028681166470050812, 0.3286389708518982, -0.1707378774881363, 0.084703728556633, 0.21563316881656647, -0.229253888130188, 0.32963529229164124, -0.028982695192098618, 0.08914411067962646, 0.20938627421855927, 0.13785672187805176, 0.16456446051597595, 0.16380859911441803, 0.09281909465789795, 0.12126252800226212, -0.22491805255413055, -0.030612699687480927, 0.13591116666793823, 0.1629302054643631, -0.009373307228088379, 0.04221060499548912, 0.1983906328678131, 0.12568755447864532, 0.1722821295261383, -0.2852168679237366, 0.08072225749492645, 0.42531582713127136, 0.0626024603843689, -0.008041251450777054, 0.1384713351726532, -0.2746993601322174, 0.050757043063640594, 0.36250460147857666, -0.14058038592338562, 0.29622507095336914, 0.3149271309375763, -0.1703774780035019, -0.029386475682258606, -0.0971117913722992, -0.052491623908281326, 0.18679046630859375, 0.13654297590255737, 0.2397942692041397, 0.07676659524440765, 0.623730480670929, 0.04727469012141228, -0.2200196385383606, -0.13672858476638794, 0.04518246650695801, 0.27634674310684204, -0.452684223651886, 0.308177649974823, -0.4269106388092041, -0.0024414435029029846, -0.23781991004943848, -0.154685840010643, -0.3824634552001953, -0.27317434549331665, -0.2290082722902298, 0.3882075548171997, 0.031330808997154236, 0.08750251680612564, -0.023035410791635513, -0.1944246143102646, 0.18350647389888763, -0.17203259468078613, 0.06762979924678802, -0.11229591071605682, -0.3621595501899719, 0.0946991890668869, 0.342587411403656, 0.12063385546207428, 0.19353339076042175, 0.03205987066030502, 0.03860313445329666, -0.05090917646884918, -0.47778546810150146, -0.1438167691230774, -0.025089098140597343, 0.19900289177894592, 0.1817106157541275, 0.11551493406295776, -0.07299236208200455, -0.46838411688804626, 0.057287078350782394, 0.08416453748941422, -0.3447721004486084, 0.1372157782316208, -0.34398332238197327, -0.1998528391122818, -0.0028321966528892517, -0.276289165019989, -0.4295882284641266, -0.3780532479286194, 0.1362106204032898, 0.3020915985107422, 0.23640713095664978, 0.3542707860469818, 0.3423806130886078, 0.01274484395980835, -0.0786948874592781, -0.10726942867040634, 0.23830220103263855, 0.028377175331115723, 0.28393781185150146, -0.07516976445913315, -0.257251501083374, -0.07669791579246521, -0.037464335560798645, 0.08720491826534271, 0.294569194316864, -0.4791855216026306, -0.014134753495454788, -0.3582625985145569, 0.5260703563690186, -0.08312098681926727, 0.14493517577648163, 0.22535274922847748, 0.15895995497703552, -0.004194937646389008, 0.003344491124153137, -0.1563226580619812, -0.26622116565704346, 0.2833780348300934, 0.07547761499881744, 0.055676694959402084, 0.3319579064846039, -0.19856581091880798, 0.6400830745697021, 0.023299410939216614, -0.2738661468029022, 0.4377114176750183, -0.2375326156616211, 0.45192140340805054, -0.10431645810604095, -0.3032712936401367, 0.06629733741283417, -0.10827210545539856, -0.07401157915592194, 0.044195711612701416, -0.22602307796478271, -0.3297971487045288, 0.12052588909864426, -0.18412691354751587, -0.23381878435611725, -0.14523108303546906, 0.09087691456079483, 0.14159071445465088, 0.3312854468822479, -0.08640037477016449, -0.2960985600948334, -0.2364920675754547, -0.21792711317539215, 0.025277383625507355, -0.08264269679784775, -0.22591671347618103, 0.038069967180490494, -0.035965826362371445, -0.13339830935001373, -0.34121182560920715, 0.30971473455429077, 0.17489559948444366, 0.2464342564344406, 0.1721387505531311, -0.0410853810608387, 0.11113014817237854, -0.21800363063812256, 0.32807719707489014, 0.09706304222345352, -0.182765394449234, 0.27574849128723145, 0.40072202682495117, -0.496793270111084, -0.23470546305179596, -0.19102361798286438, 0.27748310565948486, 0.24770592153072357, 0.18386921286582947, -0.3402397632598877, 0.15343794226646423, 0.16168956458568573, 0.5132279396057129, -0.044120822101831436, 0.16416697204113007, -0.27002739906311035, -0.10140333324670792, -0.4776964485645294, -0.10504379123449326, -0.01761382445693016, 0.33137673139572144, 0.005467850714921951, 0.06343299150466919, -0.14889757335186005, -0.24708475172519684, 0.0832427591085434, 0.28902047872543335, 0.3243051767349243, -0.07903829216957092, 0.11278222501277924, -0.31734713912010193, 0.0913165807723999, 0.5340574979782104, 0.7704090476036072, 0.20883658528327942, -0.34903720021247864, -0.016412770375609398, 0.05045154318213463, 0.32675692439079285, 0.11366061866283417, -0.19308175146579742, 0.18378815054893494, -0.11625105142593384, 0.10890750586986542, 0.12137383967638016, 0.04006081819534302, 0.24377843737602234, -0.07671591639518738, -0.2914526164531708, 0.08982376009225845, 0.41707974672317505, -0.03200620412826538, -0.013796605169773102, 0.18926988542079926, 0.4060444235801697, -0.1646333634853363, 0.3946790099143982, 0.03605928644537926, 0.8309652805328369, -0.04272161424160004, 0.0664454996585846, 0.5179725289344788, -0.40474075078964233, 0.16809165477752686, -0.02481294423341751, -0.0014977939426898956, -0.5320702791213989, 0.02998863160610199, 0.010089166462421417, -0.32545042037963867, 0.378400057554245, -0.024959616363048553, -0.2201615273952484, 0.13777568936347961, -0.01617369055747986, 0.21605737507343292, 0.007065225392580032, 0.16433557868003845, -0.0762438178062439, 0.12335334718227386, -0.3094923794269562, 0.09066323190927505, -0.1320367455482483, -0.20527583360671997, -0.05608992651104927, -0.08132266998291016, -0.27471923828125, -0.2721797823905945, -0.2812002897262573, -0.04469974339008331, -0.4894630014896393, 0.2627429664134979, 0.32856354117393494, -0.33071666955947876, 0.3076707124710083, 0.16620312631130219, -0.04406396299600601, 0.13957718014717102, -0.0796767994761467, 0.097402423620224, -0.013216350227594376, -0.056625720113515854, 0.12572379410266876, 0.13607007265090942, 0.10124372690916061, -0.051036760210990906, -0.24735097587108612, 0.3664361834526062, 0.06387249380350113, -0.17888739705085754, 0.14817728102207184, 0.12165239453315735, 0.2961480915546417, -0.3896706700325012, -0.059169575572013855, -0.42517295479774475, 0.09698713570833206, -0.15345673263072968, 0.05929594486951828, -0.1271677315235138, 0.26862481236457825, 0.20056328177452087, 0.013806306757032871, -0.1889253556728363, -0.2841084599494934, 0.4088476896286011, 0.03163333982229233, 0.268120139837265, 0.5743934512138367, 0.2638583779335022, -0.18598122894763947, -0.036853402853012085, 0.12482032179832458, 0.1295132040977478, -0.489487886428833, -0.0472915843129158, -0.09893018007278442, 0.1132626086473465, 0.06401893496513367, 0.03400582820177078, 0.283963680267334, 0.2301625907421112, -0.06152021512389183, -0.3313921093940735, -0.2537413239479065, 0.23526616394519806, 0.0836174413561821, -0.05974213778972626, 0.28060585260391235, 0.17075057327747345, -0.13414418697357178, -0.07644034922122955, -0.24748116731643677, 0.30566567182540894, -0.06656534224748611, 0.2226821929216385, 0.08635172247886658, -0.04553864151239395, -0.05687759071588516, -0.22526873648166656, 0.13118326663970947, 0.01636163704097271, 0.012625876814126968, -0.17638233304023743, -0.16661405563354492, 0.09999198466539383, -0.001013217493891716, -0.08072219789028168, -0.016165312379598618, -0.15215787291526794, -0.011200176551938057, -0.01796279475092888, 0.07604896277189255, -0.01460535079240799, -0.11940799653530121, -0.1400480568408966, 0.2809409499168396, -0.12060108780860901, -0.1210639476776123, 0.23246072232723236, -0.23627105355262756, 0.22578051686286926, 0.059537820518016815, 0.5264185070991516, -0.024768680334091187, 0.03063800185918808, -0.1317235678434372, 0.15129616856575012, -0.34175971150398254, -0.05293168127536774, 0.25683096051216125, -0.3094082772731781, -0.06632181257009506, 0.09374935925006866, 0.23149418830871582, 0.41054677963256836, -0.12172404676675797, -0.08593331277370453, 0.2554229199886322, 0.13186591863632202, -0.3775715231895447, -0.17314814031124115, 0.04951814189553261, -0.10026286542415619, -0.025594010949134827, 0.059920601546764374, 0.3110899329185486, -0.18170717358589172, 0.09042950719594955, 0.34185144305229187, 0.2442220151424408, 0.26974204182624817, -0.0024246424436569214, 0.44836151599884033, 0.012056268751621246, -0.20428091287612915, 0.4182865619659424, 0.1756482720375061, 0.31129884719848633, 0.26551252603530884, -0.21094004809856415, 0.16680176556110382, 0.049634188413619995, -0.19737444818019867, 0.09603322297334671, -0.42627519369125366, -0.19237294793128967, -0.0999845340847969, 0.31498318910598755, -0.061651088297367096, 0.46200695633888245, 0.45272618532180786, 0.27119389176368713, -0.07099601626396179, 0.02905261516571045, 0.3461710214614868, -0.00007067294791340828, 0.0676976889371872, -0.07238531112670898, -0.2340080291032791, -0.2650998830795288, -0.014262579381465912, -0.2551712691783905, -0.24806059896945953, 0.30818596482276917, 0.2364887148141861, -0.3372643291950226, -0.7492637038230896, 0.3052001893520355, 0.1087694764137268, 0.12708932161331177, -0.2866680324077606, 0.35383695363998413, 0.24741961061954498, -0.1135721281170845, -0.10147155821323395, 0.30838122963905334, 0.8915085792541504, 0.31771764159202576, -0.02600981295108795, 0.0024152323603630066, -0.004144560545682907, -0.15640640258789062, 0.04656856507062912, -0.1994176208972931, -0.19490215182304382, 0.4521815776824951, 0.2232360988855362, 0.17558464407920837, -0.14350566267967224, -0.19015607237815857, 0.08037736266851425, -0.002545885741710663, -0.268173485994339, 0.13124673068523407, -0.1365811973810196, -0.20019450783729553, 0.0013935090973973274, -0.0007405504584312439, -0.42817452549934387, -0.00899314135313034, 0.4281740188598633, 0.13380154967308044, 0.11360006779432297, -0.12113121151924133, 0.04415826499462128, 0.045718587934970856, 0.44777101278305054, 0.6064440011978149, 0.13685736060142517, -0.1345338374376297, -0.08647548407316208, -0.42366355657577515, 0.275939404964447, -0.332254558801651, -0.044852398335933685, 0.12691543996334076, 0.20620226860046387, 0.0542919784784317, 0.07830438017845154, 0.27757400274276733, 0.420621782541275, -0.17724910378456116, -0.05108058452606201, -0.332472562789917, -0.10067255795001984, 0.046692438423633575, -0.22204174101352692, -0.12957659363746643, -0.24664458632469177, 0.3911384344100952, -0.2919163107872009, 0.06642098724842072, -0.3800824284553528, -0.14073927700519562, 0.25868332386016846, -0.08691835403442383, 0.45785221457481384, 0.0009060781449079514, 0.41875797510147095, 0.03265461325645447, -0.17067331075668335, -0.3290652632713318, -0.3339603543281555, -0.28833654522895813, 0.3402409255504608, -0.05063445493578911, 0.4427412152290344, -0.18638867139816284, -0.3720743954181671, -0.10302574187517166, 0.2508411407470703, -0.09061776846647263, 0.15800976753234863, 0.19902543723583221, 0.03442266583442688, 0.0075860098004341125, 0.01790967583656311, -0.08486709743738174, -0.08275871723890305, 0.09513992816209793, 0.16722926497459412, -0.2761419415473938, -0.6448034048080444, 0.241926908493042, -0.2260374277830124, -0.20503024756908417, 0.04457248002290726, 0.05650459975004196, 0.17781129479408264, 0.026200050488114357, -0.4378465712070465, 0.234495609998703, 0.40572476387023926, -0.15454722940921783, -0.12775224447250366, 0.18590374290943146, 0.10264274477958679, 0.14742787182331085, -0.025282561779022217, 0.3295576870441437, -0.06774131953716278, -0.28767818212509155, -0.11397577822208405, -0.18642500042915344 ]
https://github.com/huggingface/datasets/issues/5923
> 基于 [rapidsai/cudf#10187](https://github.com/rapidsai/cudf/issues/10187),这可能意味着您的安装与 不兼容。`pyarrow``datasets` > > 您能否在终端中执行以下命令并将输出粘贴到此处? > > ``` > conda list | grep arrow > ``` > > ``` > python -c "import pyarrow; print(pyarrow.__file__)" > ``` arrow-cpp 11.0.0 py310h7516544_0 pyarrow 12.0.1 pypi_0 pypi /root/miniconda3/lib/python3.10/site-packages/pyarrow/__init__.py
Cannot import datasets - ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility
### Describe the bug When trying to import datasets, I get a pyarrow ValueError: Traceback (most recent call last): File "/Users/edward/test/test.py", line 1, in <module> import datasets File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module> from .arrow_dataset import Dataset File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 65, in <module> from .arrow_reader import ArrowReader File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_reader.py", line 28, in <module> import pyarrow.parquet as pq File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/__init__.py", line 20, in <module> from .core import * File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/core.py", line 45, in <module> from pyarrow.fs import (LocalFileSystem, FileSystem, FileType, File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/fs.py", line 49, in <module> from pyarrow._gcsfs import GcsFileSystem # noqa File "pyarrow/_gcsfs.pyx", line 1, in init pyarrow._gcsfs ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject ### Steps to reproduce the bug `import datasets` ### Expected behavior Successful import ### Environment info Conda environment, MacOS python 3.9.12 datasets 2.12.0
37
Cannot import datasets - ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility ### Describe the bug When trying to import datasets, I get a pyarrow ValueError: Traceback (most recent call last): File "/Users/edward/test/test.py", line 1, in <module> import datasets File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module> from .arrow_dataset import Dataset File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 65, in <module> from .arrow_reader import ArrowReader File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_reader.py", line 28, in <module> import pyarrow.parquet as pq File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/__init__.py", line 20, in <module> from .core import * File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/core.py", line 45, in <module> from pyarrow.fs import (LocalFileSystem, FileSystem, FileType, File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/fs.py", line 49, in <module> from pyarrow._gcsfs import GcsFileSystem # noqa File "pyarrow/_gcsfs.pyx", line 1, in init pyarrow._gcsfs ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject ### Steps to reproduce the bug `import datasets` ### Expected behavior Successful import ### Environment info Conda environment, MacOS python 3.9.12 datasets 2.12.0 > 基于 [rapidsai/cudf#10187](https://github.com/rapidsai/cudf/issues/10187),这可能意味着您的安装与 不兼容。`pyarrow``datasets` > > 您能否在终端中执行以下命令并将输出粘贴到此处? > > ``` > conda list | grep arrow > ``` > > ``` > python -c "import pyarrow; print(pyarrow.__file__)" > ``` arrow-cpp 11.0.0 py310h7516544_0 pyarrow 12.0.1 pypi_0 pypi /root/miniconda3/lib/python3.10/site-packages/pyarrow/__init__.py
[ -0.5389391183853149, 0.41014090180397034, -0.09792473912239075, 0.2319422960281372, 0.14288535714149475, -0.13102033734321594, 0.21223437786102295, 0.2684710919857025, -0.408712774515152, 0.09050598740577698, -0.20407867431640625, 0.27507221698760986, -0.12025684118270874, 0.1409701108932495, -0.16671998798847198, 0.01760251820087433, 0.05824655294418335, 0.2816929221153259, -0.1661183387041092, 0.113141730427742, -0.10728545486927032, 0.16610445082187653, -0.21358206868171692, 0.11508075147867203, 0.011453785002231598, -0.10817255824804306, -0.14227774739265442, 0.24949845671653748, -0.43753454089164734, -0.7070934176445007, 0.3522906005382538, -0.086106076836586, 0.07033614069223404, 0.4895254969596863, -0.00011616970732575282, 0.18690964579582214, 0.2657691538333893, 0.06419306993484497, -0.253903865814209, -0.07424189150333405, 0.06377491354942322, -0.2764390707015991, 0.26972654461860657, -0.11235450953245163, 0.3193272650241852, -0.5484874248504639, 0.06671421974897385, 0.16740885376930237, 0.054839521646499634, 0.40047457814216614, 0.19530938565731049, 0.38214990496635437, 0.6554259061813354, 0.1227761059999466, 0.5305083990097046, 0.04909924045205116, 0.03578562289476395, 0.5898970365524292, 0.2579425871372223, 0.05691107362508774, 0.0021759532392024994, -0.20591427385807037, -0.1010093167424202, -0.048358254134655, 0.15855109691619873, -0.18132737278938293, -0.03536137938499451, -0.18852782249450684, -0.06856274604797363, -0.08543333411216736, 0.4250427186489105, -0.5830304026603699, -0.302016019821167, -0.09135070443153381, 0.10421205312013626, -0.45955967903137207, 0.28538691997528076, 0.21514496207237244, 0.1239168643951416, 0.22662369906902313, -0.08318190276622772, -0.12021125853061676, -0.3959175944328308, 0.18164576590061188, -0.32514679431915283, 0.24191302061080933, 0.029269661754369736, 0.19708991050720215, 0.00875172670930624, -0.18387901782989502, 0.42467594146728516, -0.02596220001578331, -0.23255464434623718, 0.08952406048774719, -0.22075620293617249, 0.081318199634552, 0.020974012091755867, 0.13495442271232605, -0.04143968224525452, 0.02640334889292717, -0.058164432644844055, -0.15183407068252563, -0.033698271960020065, 0.33083441853523254, 0.024396397173404694, 0.05486329272389412, -0.12570367753505707, 0.2684255838394165, 0.1664728820323944, 0.1868094801902771, -0.005677856504917145, -0.02999785915017128, -0.04185599088668823, -0.3846703767776489, 0.08216149359941483, 0.0356256403028965, 0.4344305098056793, -0.1588757187128067, -0.29218998551368713, -0.012626070529222488, -0.25384315848350525, 0.026433870196342468, -0.17737063765525818, 0.2993183434009552, -0.01885107159614563, 0.2504885196685791, 0.1386951059103012, 0.2536332607269287, -0.11470460891723633, -0.23161382973194122, -0.05686569958925247, 0.10283129662275314, -0.0738179013133049, -0.22125279903411865, 0.08629242330789566, -0.1755020022392273, 0.13045690953731537, 0.12832950055599213, 0.1933923065662384, 0.12288786470890045, -0.06554929167032242, -0.24240773916244507, -0.04746447876095772, 0.31247541308403015, -0.03729112073779106, 0.10041829198598862, 0.015014491975307465, -0.30412307381629944, -0.21219328045845032, 0.14690840244293213, -0.3801676332950592, -0.11307426542043686, -0.38429704308509827, 0.17333675920963287, -0.00567549467086792, -0.05924506485462189, -0.19764062762260437, -0.09340038895606995, 0.1950654685497284, -0.4064936637878418, -0.0562329925596714, -0.48926854133605957, 0.16215912997722626, -0.4678736925125122, -0.015019897371530533, 0.15141348540782928, -0.7889991998672485, 0.07376639544963837, 0.04906328022480011, 0.004440071061253548, 0.1919279396533966, 0.3100696802139282, -0.2902900278568268, -0.12284907698631287, -0.0004233941435813904, 0.1427394151687622, 0.2366839200258255, -0.21537001430988312, -0.6268244385719299, 0.0864512026309967, 0.03838047385215759, -0.24220477044582367, 0.1674947738647461, -0.17949894070625305, 0.19456103444099426, 0.09760883450508118, -0.10673335194587708, 0.1721334308385849, -0.07684064656496048, 0.04093795269727707, -0.19862762093544006, -0.5216740369796753, 0.2674814760684967, -0.03322679176926613, 0.10352544486522675, -0.39543211460113525, 0.35555097460746765, -0.3969314396381378, 0.29034629464149475, -0.1645258665084839, 0.057519592344760895, 0.33262306451797485, 0.3348727524280548, -0.11456172168254852, 0.021700289100408554, -0.2176801711320877, -0.2977602779865265, 0.1422601044178009, -0.381434828042984, -0.11011587828397751, -0.3259420096874237, -0.1059422641992569, -0.3133503198623657, 0.26993176341056824, 0.05359809473156929, -0.006133888382464647, 0.05970541015267372, 0.057409174740314484, -0.016452211886644363, 0.10308235138654709, -0.03366893529891968, 0.07832518219947815, -0.0958491861820221, 0.19671405851840973, -0.24218088388442993, 0.5291696190834045, -0.3428577184677124, -0.4746672213077545, 0.19328927993774414, -0.0023095812648534775, 0.0374557301402092, -0.06310087442398071, -0.14555492997169495, 0.4702662229537964, -0.028681166470050812, 0.3286389708518982, -0.1707378774881363, 0.084703728556633, 0.21563316881656647, -0.229253888130188, 0.32963529229164124, -0.028982695192098618, 0.08914411067962646, 0.20938627421855927, 0.13785672187805176, 0.16456446051597595, 0.16380859911441803, 0.09281909465789795, 0.12126252800226212, -0.22491805255413055, -0.030612699687480927, 0.13591116666793823, 0.1629302054643631, -0.009373307228088379, 0.04221060499548912, 0.1983906328678131, 0.12568755447864532, 0.1722821295261383, -0.2852168679237366, 0.08072225749492645, 0.42531582713127136, 0.0626024603843689, -0.008041251450777054, 0.1384713351726532, -0.2746993601322174, 0.050757043063640594, 0.36250460147857666, -0.14058038592338562, 0.29622507095336914, 0.3149271309375763, -0.1703774780035019, -0.029386475682258606, -0.0971117913722992, -0.052491623908281326, 0.18679046630859375, 0.13654297590255737, 0.2397942692041397, 0.07676659524440765, 0.623730480670929, 0.04727469012141228, -0.2200196385383606, -0.13672858476638794, 0.04518246650695801, 0.27634674310684204, -0.452684223651886, 0.308177649974823, -0.4269106388092041, -0.0024414435029029846, -0.23781991004943848, -0.154685840010643, -0.3824634552001953, -0.27317434549331665, -0.2290082722902298, 0.3882075548171997, 0.031330808997154236, 0.08750251680612564, -0.023035410791635513, -0.1944246143102646, 0.18350647389888763, -0.17203259468078613, 0.06762979924678802, -0.11229591071605682, -0.3621595501899719, 0.0946991890668869, 0.342587411403656, 0.12063385546207428, 0.19353339076042175, 0.03205987066030502, 0.03860313445329666, -0.05090917646884918, -0.47778546810150146, -0.1438167691230774, -0.025089098140597343, 0.19900289177894592, 0.1817106157541275, 0.11551493406295776, -0.07299236208200455, -0.46838411688804626, 0.057287078350782394, 0.08416453748941422, -0.3447721004486084, 0.1372157782316208, -0.34398332238197327, -0.1998528391122818, -0.0028321966528892517, -0.276289165019989, -0.4295882284641266, -0.3780532479286194, 0.1362106204032898, 0.3020915985107422, 0.23640713095664978, 0.3542707860469818, 0.3423806130886078, 0.01274484395980835, -0.0786948874592781, -0.10726942867040634, 0.23830220103263855, 0.028377175331115723, 0.28393781185150146, -0.07516976445913315, -0.257251501083374, -0.07669791579246521, -0.037464335560798645, 0.08720491826534271, 0.294569194316864, -0.4791855216026306, -0.014134753495454788, -0.3582625985145569, 0.5260703563690186, -0.08312098681926727, 0.14493517577648163, 0.22535274922847748, 0.15895995497703552, -0.004194937646389008, 0.003344491124153137, -0.1563226580619812, -0.26622116565704346, 0.2833780348300934, 0.07547761499881744, 0.055676694959402084, 0.3319579064846039, -0.19856581091880798, 0.6400830745697021, 0.023299410939216614, -0.2738661468029022, 0.4377114176750183, -0.2375326156616211, 0.45192140340805054, -0.10431645810604095, -0.3032712936401367, 0.06629733741283417, -0.10827210545539856, -0.07401157915592194, 0.044195711612701416, -0.22602307796478271, -0.3297971487045288, 0.12052588909864426, -0.18412691354751587, -0.23381878435611725, -0.14523108303546906, 0.09087691456079483, 0.14159071445465088, 0.3312854468822479, -0.08640037477016449, -0.2960985600948334, -0.2364920675754547, -0.21792711317539215, 0.025277383625507355, -0.08264269679784775, -0.22591671347618103, 0.038069967180490494, -0.035965826362371445, -0.13339830935001373, -0.34121182560920715, 0.30971473455429077, 0.17489559948444366, 0.2464342564344406, 0.1721387505531311, -0.0410853810608387, 0.11113014817237854, -0.21800363063812256, 0.32807719707489014, 0.09706304222345352, -0.182765394449234, 0.27574849128723145, 0.40072202682495117, -0.496793270111084, -0.23470546305179596, -0.19102361798286438, 0.27748310565948486, 0.24770592153072357, 0.18386921286582947, -0.3402397632598877, 0.15343794226646423, 0.16168956458568573, 0.5132279396057129, -0.044120822101831436, 0.16416697204113007, -0.27002739906311035, -0.10140333324670792, -0.4776964485645294, -0.10504379123449326, -0.01761382445693016, 0.33137673139572144, 0.005467850714921951, 0.06343299150466919, -0.14889757335186005, -0.24708475172519684, 0.0832427591085434, 0.28902047872543335, 0.3243051767349243, -0.07903829216957092, 0.11278222501277924, -0.31734713912010193, 0.0913165807723999, 0.5340574979782104, 0.7704090476036072, 0.20883658528327942, -0.34903720021247864, -0.016412770375609398, 0.05045154318213463, 0.32675692439079285, 0.11366061866283417, -0.19308175146579742, 0.18378815054893494, -0.11625105142593384, 0.10890750586986542, 0.12137383967638016, 0.04006081819534302, 0.24377843737602234, -0.07671591639518738, -0.2914526164531708, 0.08982376009225845, 0.41707974672317505, -0.03200620412826538, -0.013796605169773102, 0.18926988542079926, 0.4060444235801697, -0.1646333634853363, 0.3946790099143982, 0.03605928644537926, 0.8309652805328369, -0.04272161424160004, 0.0664454996585846, 0.5179725289344788, -0.40474075078964233, 0.16809165477752686, -0.02481294423341751, -0.0014977939426898956, -0.5320702791213989, 0.02998863160610199, 0.010089166462421417, -0.32545042037963867, 0.378400057554245, -0.024959616363048553, -0.2201615273952484, 0.13777568936347961, -0.01617369055747986, 0.21605737507343292, 0.007065225392580032, 0.16433557868003845, -0.0762438178062439, 0.12335334718227386, -0.3094923794269562, 0.09066323190927505, -0.1320367455482483, -0.20527583360671997, -0.05608992651104927, -0.08132266998291016, -0.27471923828125, -0.2721797823905945, -0.2812002897262573, -0.04469974339008331, -0.4894630014896393, 0.2627429664134979, 0.32856354117393494, -0.33071666955947876, 0.3076707124710083, 0.16620312631130219, -0.04406396299600601, 0.13957718014717102, -0.0796767994761467, 0.097402423620224, -0.013216350227594376, -0.056625720113515854, 0.12572379410266876, 0.13607007265090942, 0.10124372690916061, -0.051036760210990906, -0.24735097587108612, 0.3664361834526062, 0.06387249380350113, -0.17888739705085754, 0.14817728102207184, 0.12165239453315735, 0.2961480915546417, -0.3896706700325012, -0.059169575572013855, -0.42517295479774475, 0.09698713570833206, -0.15345673263072968, 0.05929594486951828, -0.1271677315235138, 0.26862481236457825, 0.20056328177452087, 0.013806306757032871, -0.1889253556728363, -0.2841084599494934, 0.4088476896286011, 0.03163333982229233, 0.268120139837265, 0.5743934512138367, 0.2638583779335022, -0.18598122894763947, -0.036853402853012085, 0.12482032179832458, 0.1295132040977478, -0.489487886428833, -0.0472915843129158, -0.09893018007278442, 0.1132626086473465, 0.06401893496513367, 0.03400582820177078, 0.283963680267334, 0.2301625907421112, -0.06152021512389183, -0.3313921093940735, -0.2537413239479065, 0.23526616394519806, 0.0836174413561821, -0.05974213778972626, 0.28060585260391235, 0.17075057327747345, -0.13414418697357178, -0.07644034922122955, -0.24748116731643677, 0.30566567182540894, -0.06656534224748611, 0.2226821929216385, 0.08635172247886658, -0.04553864151239395, -0.05687759071588516, -0.22526873648166656, 0.13118326663970947, 0.01636163704097271, 0.012625876814126968, -0.17638233304023743, -0.16661405563354492, 0.09999198466539383, -0.001013217493891716, -0.08072219789028168, -0.016165312379598618, -0.15215787291526794, -0.011200176551938057, -0.01796279475092888, 0.07604896277189255, -0.01460535079240799, -0.11940799653530121, -0.1400480568408966, 0.2809409499168396, -0.12060108780860901, -0.1210639476776123, 0.23246072232723236, -0.23627105355262756, 0.22578051686286926, 0.059537820518016815, 0.5264185070991516, -0.024768680334091187, 0.03063800185918808, -0.1317235678434372, 0.15129616856575012, -0.34175971150398254, -0.05293168127536774, 0.25683096051216125, -0.3094082772731781, -0.06632181257009506, 0.09374935925006866, 0.23149418830871582, 0.41054677963256836, -0.12172404676675797, -0.08593331277370453, 0.2554229199886322, 0.13186591863632202, -0.3775715231895447, -0.17314814031124115, 0.04951814189553261, -0.10026286542415619, -0.025594010949134827, 0.059920601546764374, 0.3110899329185486, -0.18170717358589172, 0.09042950719594955, 0.34185144305229187, 0.2442220151424408, 0.26974204182624817, -0.0024246424436569214, 0.44836151599884033, 0.012056268751621246, -0.20428091287612915, 0.4182865619659424, 0.1756482720375061, 0.31129884719848633, 0.26551252603530884, -0.21094004809856415, 0.16680176556110382, 0.049634188413619995, -0.19737444818019867, 0.09603322297334671, -0.42627519369125366, -0.19237294793128967, -0.0999845340847969, 0.31498318910598755, -0.061651088297367096, 0.46200695633888245, 0.45272618532180786, 0.27119389176368713, -0.07099601626396179, 0.02905261516571045, 0.3461710214614868, -0.00007067294791340828, 0.0676976889371872, -0.07238531112670898, -0.2340080291032791, -0.2650998830795288, -0.014262579381465912, -0.2551712691783905, -0.24806059896945953, 0.30818596482276917, 0.2364887148141861, -0.3372643291950226, -0.7492637038230896, 0.3052001893520355, 0.1087694764137268, 0.12708932161331177, -0.2866680324077606, 0.35383695363998413, 0.24741961061954498, -0.1135721281170845, -0.10147155821323395, 0.30838122963905334, 0.8915085792541504, 0.31771764159202576, -0.02600981295108795, 0.0024152323603630066, -0.004144560545682907, -0.15640640258789062, 0.04656856507062912, -0.1994176208972931, -0.19490215182304382, 0.4521815776824951, 0.2232360988855362, 0.17558464407920837, -0.14350566267967224, -0.19015607237815857, 0.08037736266851425, -0.002545885741710663, -0.268173485994339, 0.13124673068523407, -0.1365811973810196, -0.20019450783729553, 0.0013935090973973274, -0.0007405504584312439, -0.42817452549934387, -0.00899314135313034, 0.4281740188598633, 0.13380154967308044, 0.11360006779432297, -0.12113121151924133, 0.04415826499462128, 0.045718587934970856, 0.44777101278305054, 0.6064440011978149, 0.13685736060142517, -0.1345338374376297, -0.08647548407316208, -0.42366355657577515, 0.275939404964447, -0.332254558801651, -0.044852398335933685, 0.12691543996334076, 0.20620226860046387, 0.0542919784784317, 0.07830438017845154, 0.27757400274276733, 0.420621782541275, -0.17724910378456116, -0.05108058452606201, -0.332472562789917, -0.10067255795001984, 0.046692438423633575, -0.22204174101352692, -0.12957659363746643, -0.24664458632469177, 0.3911384344100952, -0.2919163107872009, 0.06642098724842072, -0.3800824284553528, -0.14073927700519562, 0.25868332386016846, -0.08691835403442383, 0.45785221457481384, 0.0009060781449079514, 0.41875797510147095, 0.03265461325645447, -0.17067331075668335, -0.3290652632713318, -0.3339603543281555, -0.28833654522895813, 0.3402409255504608, -0.05063445493578911, 0.4427412152290344, -0.18638867139816284, -0.3720743954181671, -0.10302574187517166, 0.2508411407470703, -0.09061776846647263, 0.15800976753234863, 0.19902543723583221, 0.03442266583442688, 0.0075860098004341125, 0.01790967583656311, -0.08486709743738174, -0.08275871723890305, 0.09513992816209793, 0.16722926497459412, -0.2761419415473938, -0.6448034048080444, 0.241926908493042, -0.2260374277830124, -0.20503024756908417, 0.04457248002290726, 0.05650459975004196, 0.17781129479408264, 0.026200050488114357, -0.4378465712070465, 0.234495609998703, 0.40572476387023926, -0.15454722940921783, -0.12775224447250366, 0.18590374290943146, 0.10264274477958679, 0.14742787182331085, -0.025282561779022217, 0.3295576870441437, -0.06774131953716278, -0.28767818212509155, -0.11397577822208405, -0.18642500042915344 ]
https://github.com/huggingface/datasets/issues/5923
Got the same problem with arrow-cpp 11.0.0 py310h1fc3239_0 pyarrow 12.0.1 pypi_0 pypi miniforge3/envs/mlp/lib/python3.10/site-packages/pyarrow/__init__.py Reverting back to pyarrow 11 solved the problem.
Cannot import datasets - ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility
### Describe the bug When trying to import datasets, I get a pyarrow ValueError: Traceback (most recent call last): File "/Users/edward/test/test.py", line 1, in <module> import datasets File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module> from .arrow_dataset import Dataset File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 65, in <module> from .arrow_reader import ArrowReader File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_reader.py", line 28, in <module> import pyarrow.parquet as pq File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/__init__.py", line 20, in <module> from .core import * File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/core.py", line 45, in <module> from pyarrow.fs import (LocalFileSystem, FileSystem, FileType, File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/fs.py", line 49, in <module> from pyarrow._gcsfs import GcsFileSystem # noqa File "pyarrow/_gcsfs.pyx", line 1, in init pyarrow._gcsfs ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject ### Steps to reproduce the bug `import datasets` ### Expected behavior Successful import ### Environment info Conda environment, MacOS python 3.9.12 datasets 2.12.0
21
Cannot import datasets - ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility ### Describe the bug When trying to import datasets, I get a pyarrow ValueError: Traceback (most recent call last): File "/Users/edward/test/test.py", line 1, in <module> import datasets File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module> from .arrow_dataset import Dataset File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 65, in <module> from .arrow_reader import ArrowReader File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_reader.py", line 28, in <module> import pyarrow.parquet as pq File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/__init__.py", line 20, in <module> from .core import * File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/core.py", line 45, in <module> from pyarrow.fs import (LocalFileSystem, FileSystem, FileType, File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/fs.py", line 49, in <module> from pyarrow._gcsfs import GcsFileSystem # noqa File "pyarrow/_gcsfs.pyx", line 1, in init pyarrow._gcsfs ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject ### Steps to reproduce the bug `import datasets` ### Expected behavior Successful import ### Environment info Conda environment, MacOS python 3.9.12 datasets 2.12.0 Got the same problem with arrow-cpp 11.0.0 py310h1fc3239_0 pyarrow 12.0.1 pypi_0 pypi miniforge3/envs/mlp/lib/python3.10/site-packages/pyarrow/__init__.py Reverting back to pyarrow 11 solved the problem.
[ -0.5389391183853149, 0.41014090180397034, -0.09792473912239075, 0.2319422960281372, 0.14288535714149475, -0.13102033734321594, 0.21223437786102295, 0.2684710919857025, -0.408712774515152, 0.09050598740577698, -0.20407867431640625, 0.27507221698760986, -0.12025684118270874, 0.1409701108932495, -0.16671998798847198, 0.01760251820087433, 0.05824655294418335, 0.2816929221153259, -0.1661183387041092, 0.113141730427742, -0.10728545486927032, 0.16610445082187653, -0.21358206868171692, 0.11508075147867203, 0.011453785002231598, -0.10817255824804306, -0.14227774739265442, 0.24949845671653748, -0.43753454089164734, -0.7070934176445007, 0.3522906005382538, -0.086106076836586, 0.07033614069223404, 0.4895254969596863, -0.00011616970732575282, 0.18690964579582214, 0.2657691538333893, 0.06419306993484497, -0.253903865814209, -0.07424189150333405, 0.06377491354942322, -0.2764390707015991, 0.26972654461860657, -0.11235450953245163, 0.3193272650241852, -0.5484874248504639, 0.06671421974897385, 0.16740885376930237, 0.054839521646499634, 0.40047457814216614, 0.19530938565731049, 0.38214990496635437, 0.6554259061813354, 0.1227761059999466, 0.5305083990097046, 0.04909924045205116, 0.03578562289476395, 0.5898970365524292, 0.2579425871372223, 0.05691107362508774, 0.0021759532392024994, -0.20591427385807037, -0.1010093167424202, -0.048358254134655, 0.15855109691619873, -0.18132737278938293, -0.03536137938499451, -0.18852782249450684, -0.06856274604797363, -0.08543333411216736, 0.4250427186489105, -0.5830304026603699, -0.302016019821167, -0.09135070443153381, 0.10421205312013626, -0.45955967903137207, 0.28538691997528076, 0.21514496207237244, 0.1239168643951416, 0.22662369906902313, -0.08318190276622772, -0.12021125853061676, -0.3959175944328308, 0.18164576590061188, -0.32514679431915283, 0.24191302061080933, 0.029269661754369736, 0.19708991050720215, 0.00875172670930624, -0.18387901782989502, 0.42467594146728516, -0.02596220001578331, -0.23255464434623718, 0.08952406048774719, -0.22075620293617249, 0.081318199634552, 0.020974012091755867, 0.13495442271232605, -0.04143968224525452, 0.02640334889292717, -0.058164432644844055, -0.15183407068252563, -0.033698271960020065, 0.33083441853523254, 0.024396397173404694, 0.05486329272389412, -0.12570367753505707, 0.2684255838394165, 0.1664728820323944, 0.1868094801902771, -0.005677856504917145, -0.02999785915017128, -0.04185599088668823, -0.3846703767776489, 0.08216149359941483, 0.0356256403028965, 0.4344305098056793, -0.1588757187128067, -0.29218998551368713, -0.012626070529222488, -0.25384315848350525, 0.026433870196342468, -0.17737063765525818, 0.2993183434009552, -0.01885107159614563, 0.2504885196685791, 0.1386951059103012, 0.2536332607269287, -0.11470460891723633, -0.23161382973194122, -0.05686569958925247, 0.10283129662275314, -0.0738179013133049, -0.22125279903411865, 0.08629242330789566, -0.1755020022392273, 0.13045690953731537, 0.12832950055599213, 0.1933923065662384, 0.12288786470890045, -0.06554929167032242, -0.24240773916244507, -0.04746447876095772, 0.31247541308403015, -0.03729112073779106, 0.10041829198598862, 0.015014491975307465, -0.30412307381629944, -0.21219328045845032, 0.14690840244293213, -0.3801676332950592, -0.11307426542043686, -0.38429704308509827, 0.17333675920963287, -0.00567549467086792, -0.05924506485462189, -0.19764062762260437, -0.09340038895606995, 0.1950654685497284, -0.4064936637878418, -0.0562329925596714, -0.48926854133605957, 0.16215912997722626, -0.4678736925125122, -0.015019897371530533, 0.15141348540782928, -0.7889991998672485, 0.07376639544963837, 0.04906328022480011, 0.004440071061253548, 0.1919279396533966, 0.3100696802139282, -0.2902900278568268, -0.12284907698631287, -0.0004233941435813904, 0.1427394151687622, 0.2366839200258255, -0.21537001430988312, -0.6268244385719299, 0.0864512026309967, 0.03838047385215759, -0.24220477044582367, 0.1674947738647461, -0.17949894070625305, 0.19456103444099426, 0.09760883450508118, -0.10673335194587708, 0.1721334308385849, -0.07684064656496048, 0.04093795269727707, -0.19862762093544006, -0.5216740369796753, 0.2674814760684967, -0.03322679176926613, 0.10352544486522675, -0.39543211460113525, 0.35555097460746765, -0.3969314396381378, 0.29034629464149475, -0.1645258665084839, 0.057519592344760895, 0.33262306451797485, 0.3348727524280548, -0.11456172168254852, 0.021700289100408554, -0.2176801711320877, -0.2977602779865265, 0.1422601044178009, -0.381434828042984, -0.11011587828397751, -0.3259420096874237, -0.1059422641992569, -0.3133503198623657, 0.26993176341056824, 0.05359809473156929, -0.006133888382464647, 0.05970541015267372, 0.057409174740314484, -0.016452211886644363, 0.10308235138654709, -0.03366893529891968, 0.07832518219947815, -0.0958491861820221, 0.19671405851840973, -0.24218088388442993, 0.5291696190834045, -0.3428577184677124, -0.4746672213077545, 0.19328927993774414, -0.0023095812648534775, 0.0374557301402092, -0.06310087442398071, -0.14555492997169495, 0.4702662229537964, -0.028681166470050812, 0.3286389708518982, -0.1707378774881363, 0.084703728556633, 0.21563316881656647, -0.229253888130188, 0.32963529229164124, -0.028982695192098618, 0.08914411067962646, 0.20938627421855927, 0.13785672187805176, 0.16456446051597595, 0.16380859911441803, 0.09281909465789795, 0.12126252800226212, -0.22491805255413055, -0.030612699687480927, 0.13591116666793823, 0.1629302054643631, -0.009373307228088379, 0.04221060499548912, 0.1983906328678131, 0.12568755447864532, 0.1722821295261383, -0.2852168679237366, 0.08072225749492645, 0.42531582713127136, 0.0626024603843689, -0.008041251450777054, 0.1384713351726532, -0.2746993601322174, 0.050757043063640594, 0.36250460147857666, -0.14058038592338562, 0.29622507095336914, 0.3149271309375763, -0.1703774780035019, -0.029386475682258606, -0.0971117913722992, -0.052491623908281326, 0.18679046630859375, 0.13654297590255737, 0.2397942692041397, 0.07676659524440765, 0.623730480670929, 0.04727469012141228, -0.2200196385383606, -0.13672858476638794, 0.04518246650695801, 0.27634674310684204, -0.452684223651886, 0.308177649974823, -0.4269106388092041, -0.0024414435029029846, -0.23781991004943848, -0.154685840010643, -0.3824634552001953, -0.27317434549331665, -0.2290082722902298, 0.3882075548171997, 0.031330808997154236, 0.08750251680612564, -0.023035410791635513, -0.1944246143102646, 0.18350647389888763, -0.17203259468078613, 0.06762979924678802, -0.11229591071605682, -0.3621595501899719, 0.0946991890668869, 0.342587411403656, 0.12063385546207428, 0.19353339076042175, 0.03205987066030502, 0.03860313445329666, -0.05090917646884918, -0.47778546810150146, -0.1438167691230774, -0.025089098140597343, 0.19900289177894592, 0.1817106157541275, 0.11551493406295776, -0.07299236208200455, -0.46838411688804626, 0.057287078350782394, 0.08416453748941422, -0.3447721004486084, 0.1372157782316208, -0.34398332238197327, -0.1998528391122818, -0.0028321966528892517, -0.276289165019989, -0.4295882284641266, -0.3780532479286194, 0.1362106204032898, 0.3020915985107422, 0.23640713095664978, 0.3542707860469818, 0.3423806130886078, 0.01274484395980835, -0.0786948874592781, -0.10726942867040634, 0.23830220103263855, 0.028377175331115723, 0.28393781185150146, -0.07516976445913315, -0.257251501083374, -0.07669791579246521, -0.037464335560798645, 0.08720491826534271, 0.294569194316864, -0.4791855216026306, -0.014134753495454788, -0.3582625985145569, 0.5260703563690186, -0.08312098681926727, 0.14493517577648163, 0.22535274922847748, 0.15895995497703552, -0.004194937646389008, 0.003344491124153137, -0.1563226580619812, -0.26622116565704346, 0.2833780348300934, 0.07547761499881744, 0.055676694959402084, 0.3319579064846039, -0.19856581091880798, 0.6400830745697021, 0.023299410939216614, -0.2738661468029022, 0.4377114176750183, -0.2375326156616211, 0.45192140340805054, -0.10431645810604095, -0.3032712936401367, 0.06629733741283417, -0.10827210545539856, -0.07401157915592194, 0.044195711612701416, -0.22602307796478271, -0.3297971487045288, 0.12052588909864426, -0.18412691354751587, -0.23381878435611725, -0.14523108303546906, 0.09087691456079483, 0.14159071445465088, 0.3312854468822479, -0.08640037477016449, -0.2960985600948334, -0.2364920675754547, -0.21792711317539215, 0.025277383625507355, -0.08264269679784775, -0.22591671347618103, 0.038069967180490494, -0.035965826362371445, -0.13339830935001373, -0.34121182560920715, 0.30971473455429077, 0.17489559948444366, 0.2464342564344406, 0.1721387505531311, -0.0410853810608387, 0.11113014817237854, -0.21800363063812256, 0.32807719707489014, 0.09706304222345352, -0.182765394449234, 0.27574849128723145, 0.40072202682495117, -0.496793270111084, -0.23470546305179596, -0.19102361798286438, 0.27748310565948486, 0.24770592153072357, 0.18386921286582947, -0.3402397632598877, 0.15343794226646423, 0.16168956458568573, 0.5132279396057129, -0.044120822101831436, 0.16416697204113007, -0.27002739906311035, -0.10140333324670792, -0.4776964485645294, -0.10504379123449326, -0.01761382445693016, 0.33137673139572144, 0.005467850714921951, 0.06343299150466919, -0.14889757335186005, -0.24708475172519684, 0.0832427591085434, 0.28902047872543335, 0.3243051767349243, -0.07903829216957092, 0.11278222501277924, -0.31734713912010193, 0.0913165807723999, 0.5340574979782104, 0.7704090476036072, 0.20883658528327942, -0.34903720021247864, -0.016412770375609398, 0.05045154318213463, 0.32675692439079285, 0.11366061866283417, -0.19308175146579742, 0.18378815054893494, -0.11625105142593384, 0.10890750586986542, 0.12137383967638016, 0.04006081819534302, 0.24377843737602234, -0.07671591639518738, -0.2914526164531708, 0.08982376009225845, 0.41707974672317505, -0.03200620412826538, -0.013796605169773102, 0.18926988542079926, 0.4060444235801697, -0.1646333634853363, 0.3946790099143982, 0.03605928644537926, 0.8309652805328369, -0.04272161424160004, 0.0664454996585846, 0.5179725289344788, -0.40474075078964233, 0.16809165477752686, -0.02481294423341751, -0.0014977939426898956, -0.5320702791213989, 0.02998863160610199, 0.010089166462421417, -0.32545042037963867, 0.378400057554245, -0.024959616363048553, -0.2201615273952484, 0.13777568936347961, -0.01617369055747986, 0.21605737507343292, 0.007065225392580032, 0.16433557868003845, -0.0762438178062439, 0.12335334718227386, -0.3094923794269562, 0.09066323190927505, -0.1320367455482483, -0.20527583360671997, -0.05608992651104927, -0.08132266998291016, -0.27471923828125, -0.2721797823905945, -0.2812002897262573, -0.04469974339008331, -0.4894630014896393, 0.2627429664134979, 0.32856354117393494, -0.33071666955947876, 0.3076707124710083, 0.16620312631130219, -0.04406396299600601, 0.13957718014717102, -0.0796767994761467, 0.097402423620224, -0.013216350227594376, -0.056625720113515854, 0.12572379410266876, 0.13607007265090942, 0.10124372690916061, -0.051036760210990906, -0.24735097587108612, 0.3664361834526062, 0.06387249380350113, -0.17888739705085754, 0.14817728102207184, 0.12165239453315735, 0.2961480915546417, -0.3896706700325012, -0.059169575572013855, -0.42517295479774475, 0.09698713570833206, -0.15345673263072968, 0.05929594486951828, -0.1271677315235138, 0.26862481236457825, 0.20056328177452087, 0.013806306757032871, -0.1889253556728363, -0.2841084599494934, 0.4088476896286011, 0.03163333982229233, 0.268120139837265, 0.5743934512138367, 0.2638583779335022, -0.18598122894763947, -0.036853402853012085, 0.12482032179832458, 0.1295132040977478, -0.489487886428833, -0.0472915843129158, -0.09893018007278442, 0.1132626086473465, 0.06401893496513367, 0.03400582820177078, 0.283963680267334, 0.2301625907421112, -0.06152021512389183, -0.3313921093940735, -0.2537413239479065, 0.23526616394519806, 0.0836174413561821, -0.05974213778972626, 0.28060585260391235, 0.17075057327747345, -0.13414418697357178, -0.07644034922122955, -0.24748116731643677, 0.30566567182540894, -0.06656534224748611, 0.2226821929216385, 0.08635172247886658, -0.04553864151239395, -0.05687759071588516, -0.22526873648166656, 0.13118326663970947, 0.01636163704097271, 0.012625876814126968, -0.17638233304023743, -0.16661405563354492, 0.09999198466539383, -0.001013217493891716, -0.08072219789028168, -0.016165312379598618, -0.15215787291526794, -0.011200176551938057, -0.01796279475092888, 0.07604896277189255, -0.01460535079240799, -0.11940799653530121, -0.1400480568408966, 0.2809409499168396, -0.12060108780860901, -0.1210639476776123, 0.23246072232723236, -0.23627105355262756, 0.22578051686286926, 0.059537820518016815, 0.5264185070991516, -0.024768680334091187, 0.03063800185918808, -0.1317235678434372, 0.15129616856575012, -0.34175971150398254, -0.05293168127536774, 0.25683096051216125, -0.3094082772731781, -0.06632181257009506, 0.09374935925006866, 0.23149418830871582, 0.41054677963256836, -0.12172404676675797, -0.08593331277370453, 0.2554229199886322, 0.13186591863632202, -0.3775715231895447, -0.17314814031124115, 0.04951814189553261, -0.10026286542415619, -0.025594010949134827, 0.059920601546764374, 0.3110899329185486, -0.18170717358589172, 0.09042950719594955, 0.34185144305229187, 0.2442220151424408, 0.26974204182624817, -0.0024246424436569214, 0.44836151599884033, 0.012056268751621246, -0.20428091287612915, 0.4182865619659424, 0.1756482720375061, 0.31129884719848633, 0.26551252603530884, -0.21094004809856415, 0.16680176556110382, 0.049634188413619995, -0.19737444818019867, 0.09603322297334671, -0.42627519369125366, -0.19237294793128967, -0.0999845340847969, 0.31498318910598755, -0.061651088297367096, 0.46200695633888245, 0.45272618532180786, 0.27119389176368713, -0.07099601626396179, 0.02905261516571045, 0.3461710214614868, -0.00007067294791340828, 0.0676976889371872, -0.07238531112670898, -0.2340080291032791, -0.2650998830795288, -0.014262579381465912, -0.2551712691783905, -0.24806059896945953, 0.30818596482276917, 0.2364887148141861, -0.3372643291950226, -0.7492637038230896, 0.3052001893520355, 0.1087694764137268, 0.12708932161331177, -0.2866680324077606, 0.35383695363998413, 0.24741961061954498, -0.1135721281170845, -0.10147155821323395, 0.30838122963905334, 0.8915085792541504, 0.31771764159202576, -0.02600981295108795, 0.0024152323603630066, -0.004144560545682907, -0.15640640258789062, 0.04656856507062912, -0.1994176208972931, -0.19490215182304382, 0.4521815776824951, 0.2232360988855362, 0.17558464407920837, -0.14350566267967224, -0.19015607237815857, 0.08037736266851425, -0.002545885741710663, -0.268173485994339, 0.13124673068523407, -0.1365811973810196, -0.20019450783729553, 0.0013935090973973274, -0.0007405504584312439, -0.42817452549934387, -0.00899314135313034, 0.4281740188598633, 0.13380154967308044, 0.11360006779432297, -0.12113121151924133, 0.04415826499462128, 0.045718587934970856, 0.44777101278305054, 0.6064440011978149, 0.13685736060142517, -0.1345338374376297, -0.08647548407316208, -0.42366355657577515, 0.275939404964447, -0.332254558801651, -0.044852398335933685, 0.12691543996334076, 0.20620226860046387, 0.0542919784784317, 0.07830438017845154, 0.27757400274276733, 0.420621782541275, -0.17724910378456116, -0.05108058452606201, -0.332472562789917, -0.10067255795001984, 0.046692438423633575, -0.22204174101352692, -0.12957659363746643, -0.24664458632469177, 0.3911384344100952, -0.2919163107872009, 0.06642098724842072, -0.3800824284553528, -0.14073927700519562, 0.25868332386016846, -0.08691835403442383, 0.45785221457481384, 0.0009060781449079514, 0.41875797510147095, 0.03265461325645447, -0.17067331075668335, -0.3290652632713318, -0.3339603543281555, -0.28833654522895813, 0.3402409255504608, -0.05063445493578911, 0.4427412152290344, -0.18638867139816284, -0.3720743954181671, -0.10302574187517166, 0.2508411407470703, -0.09061776846647263, 0.15800976753234863, 0.19902543723583221, 0.03442266583442688, 0.0075860098004341125, 0.01790967583656311, -0.08486709743738174, -0.08275871723890305, 0.09513992816209793, 0.16722926497459412, -0.2761419415473938, -0.6448034048080444, 0.241926908493042, -0.2260374277830124, -0.20503024756908417, 0.04457248002290726, 0.05650459975004196, 0.17781129479408264, 0.026200050488114357, -0.4378465712070465, 0.234495609998703, 0.40572476387023926, -0.15454722940921783, -0.12775224447250366, 0.18590374290943146, 0.10264274477958679, 0.14742787182331085, -0.025282561779022217, 0.3295576870441437, -0.06774131953716278, -0.28767818212509155, -0.11397577822208405, -0.18642500042915344 ]
https://github.com/huggingface/datasets/issues/5923
I got different. Solved with pip install pyarrow==12.0.1 pip install cchardet env: Python 3.9.16 transformers 4.32.1
Cannot import datasets - ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility
### Describe the bug When trying to import datasets, I get a pyarrow ValueError: Traceback (most recent call last): File "/Users/edward/test/test.py", line 1, in <module> import datasets File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module> from .arrow_dataset import Dataset File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 65, in <module> from .arrow_reader import ArrowReader File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_reader.py", line 28, in <module> import pyarrow.parquet as pq File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/__init__.py", line 20, in <module> from .core import * File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/core.py", line 45, in <module> from pyarrow.fs import (LocalFileSystem, FileSystem, FileType, File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/fs.py", line 49, in <module> from pyarrow._gcsfs import GcsFileSystem # noqa File "pyarrow/_gcsfs.pyx", line 1, in init pyarrow._gcsfs ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject ### Steps to reproduce the bug `import datasets` ### Expected behavior Successful import ### Environment info Conda environment, MacOS python 3.9.12 datasets 2.12.0
16
Cannot import datasets - ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility ### Describe the bug When trying to import datasets, I get a pyarrow ValueError: Traceback (most recent call last): File "/Users/edward/test/test.py", line 1, in <module> import datasets File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module> from .arrow_dataset import Dataset File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 65, in <module> from .arrow_reader import ArrowReader File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_reader.py", line 28, in <module> import pyarrow.parquet as pq File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/__init__.py", line 20, in <module> from .core import * File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/core.py", line 45, in <module> from pyarrow.fs import (LocalFileSystem, FileSystem, FileType, File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/fs.py", line 49, in <module> from pyarrow._gcsfs import GcsFileSystem # noqa File "pyarrow/_gcsfs.pyx", line 1, in init pyarrow._gcsfs ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject ### Steps to reproduce the bug `import datasets` ### Expected behavior Successful import ### Environment info Conda environment, MacOS python 3.9.12 datasets 2.12.0 I got different. Solved with pip install pyarrow==12.0.1 pip install cchardet env: Python 3.9.16 transformers 4.32.1
[ -0.5389391183853149, 0.41014090180397034, -0.09792473912239075, 0.2319422960281372, 0.14288535714149475, -0.13102033734321594, 0.21223437786102295, 0.2684710919857025, -0.408712774515152, 0.09050598740577698, -0.20407867431640625, 0.27507221698760986, -0.12025684118270874, 0.1409701108932495, -0.16671998798847198, 0.01760251820087433, 0.05824655294418335, 0.2816929221153259, -0.1661183387041092, 0.113141730427742, -0.10728545486927032, 0.16610445082187653, -0.21358206868171692, 0.11508075147867203, 0.011453785002231598, -0.10817255824804306, -0.14227774739265442, 0.24949845671653748, -0.43753454089164734, -0.7070934176445007, 0.3522906005382538, -0.086106076836586, 0.07033614069223404, 0.4895254969596863, -0.00011616970732575282, 0.18690964579582214, 0.2657691538333893, 0.06419306993484497, -0.253903865814209, -0.07424189150333405, 0.06377491354942322, -0.2764390707015991, 0.26972654461860657, -0.11235450953245163, 0.3193272650241852, -0.5484874248504639, 0.06671421974897385, 0.16740885376930237, 0.054839521646499634, 0.40047457814216614, 0.19530938565731049, 0.38214990496635437, 0.6554259061813354, 0.1227761059999466, 0.5305083990097046, 0.04909924045205116, 0.03578562289476395, 0.5898970365524292, 0.2579425871372223, 0.05691107362508774, 0.0021759532392024994, -0.20591427385807037, -0.1010093167424202, -0.048358254134655, 0.15855109691619873, -0.18132737278938293, -0.03536137938499451, -0.18852782249450684, -0.06856274604797363, -0.08543333411216736, 0.4250427186489105, -0.5830304026603699, -0.302016019821167, -0.09135070443153381, 0.10421205312013626, -0.45955967903137207, 0.28538691997528076, 0.21514496207237244, 0.1239168643951416, 0.22662369906902313, -0.08318190276622772, -0.12021125853061676, -0.3959175944328308, 0.18164576590061188, -0.32514679431915283, 0.24191302061080933, 0.029269661754369736, 0.19708991050720215, 0.00875172670930624, -0.18387901782989502, 0.42467594146728516, -0.02596220001578331, -0.23255464434623718, 0.08952406048774719, -0.22075620293617249, 0.081318199634552, 0.020974012091755867, 0.13495442271232605, -0.04143968224525452, 0.02640334889292717, -0.058164432644844055, -0.15183407068252563, -0.033698271960020065, 0.33083441853523254, 0.024396397173404694, 0.05486329272389412, -0.12570367753505707, 0.2684255838394165, 0.1664728820323944, 0.1868094801902771, -0.005677856504917145, -0.02999785915017128, -0.04185599088668823, -0.3846703767776489, 0.08216149359941483, 0.0356256403028965, 0.4344305098056793, -0.1588757187128067, -0.29218998551368713, -0.012626070529222488, -0.25384315848350525, 0.026433870196342468, -0.17737063765525818, 0.2993183434009552, -0.01885107159614563, 0.2504885196685791, 0.1386951059103012, 0.2536332607269287, -0.11470460891723633, -0.23161382973194122, -0.05686569958925247, 0.10283129662275314, -0.0738179013133049, -0.22125279903411865, 0.08629242330789566, -0.1755020022392273, 0.13045690953731537, 0.12832950055599213, 0.1933923065662384, 0.12288786470890045, -0.06554929167032242, -0.24240773916244507, -0.04746447876095772, 0.31247541308403015, -0.03729112073779106, 0.10041829198598862, 0.015014491975307465, -0.30412307381629944, -0.21219328045845032, 0.14690840244293213, -0.3801676332950592, -0.11307426542043686, -0.38429704308509827, 0.17333675920963287, -0.00567549467086792, -0.05924506485462189, -0.19764062762260437, -0.09340038895606995, 0.1950654685497284, -0.4064936637878418, -0.0562329925596714, -0.48926854133605957, 0.16215912997722626, -0.4678736925125122, -0.015019897371530533, 0.15141348540782928, -0.7889991998672485, 0.07376639544963837, 0.04906328022480011, 0.004440071061253548, 0.1919279396533966, 0.3100696802139282, -0.2902900278568268, -0.12284907698631287, -0.0004233941435813904, 0.1427394151687622, 0.2366839200258255, -0.21537001430988312, -0.6268244385719299, 0.0864512026309967, 0.03838047385215759, -0.24220477044582367, 0.1674947738647461, -0.17949894070625305, 0.19456103444099426, 0.09760883450508118, -0.10673335194587708, 0.1721334308385849, -0.07684064656496048, 0.04093795269727707, -0.19862762093544006, -0.5216740369796753, 0.2674814760684967, -0.03322679176926613, 0.10352544486522675, -0.39543211460113525, 0.35555097460746765, -0.3969314396381378, 0.29034629464149475, -0.1645258665084839, 0.057519592344760895, 0.33262306451797485, 0.3348727524280548, -0.11456172168254852, 0.021700289100408554, -0.2176801711320877, -0.2977602779865265, 0.1422601044178009, -0.381434828042984, -0.11011587828397751, -0.3259420096874237, -0.1059422641992569, -0.3133503198623657, 0.26993176341056824, 0.05359809473156929, -0.006133888382464647, 0.05970541015267372, 0.057409174740314484, -0.016452211886644363, 0.10308235138654709, -0.03366893529891968, 0.07832518219947815, -0.0958491861820221, 0.19671405851840973, -0.24218088388442993, 0.5291696190834045, -0.3428577184677124, -0.4746672213077545, 0.19328927993774414, -0.0023095812648534775, 0.0374557301402092, -0.06310087442398071, -0.14555492997169495, 0.4702662229537964, -0.028681166470050812, 0.3286389708518982, -0.1707378774881363, 0.084703728556633, 0.21563316881656647, -0.229253888130188, 0.32963529229164124, -0.028982695192098618, 0.08914411067962646, 0.20938627421855927, 0.13785672187805176, 0.16456446051597595, 0.16380859911441803, 0.09281909465789795, 0.12126252800226212, -0.22491805255413055, -0.030612699687480927, 0.13591116666793823, 0.1629302054643631, -0.009373307228088379, 0.04221060499548912, 0.1983906328678131, 0.12568755447864532, 0.1722821295261383, -0.2852168679237366, 0.08072225749492645, 0.42531582713127136, 0.0626024603843689, -0.008041251450777054, 0.1384713351726532, -0.2746993601322174, 0.050757043063640594, 0.36250460147857666, -0.14058038592338562, 0.29622507095336914, 0.3149271309375763, -0.1703774780035019, -0.029386475682258606, -0.0971117913722992, -0.052491623908281326, 0.18679046630859375, 0.13654297590255737, 0.2397942692041397, 0.07676659524440765, 0.623730480670929, 0.04727469012141228, -0.2200196385383606, -0.13672858476638794, 0.04518246650695801, 0.27634674310684204, -0.452684223651886, 0.308177649974823, -0.4269106388092041, -0.0024414435029029846, -0.23781991004943848, -0.154685840010643, -0.3824634552001953, -0.27317434549331665, -0.2290082722902298, 0.3882075548171997, 0.031330808997154236, 0.08750251680612564, -0.023035410791635513, -0.1944246143102646, 0.18350647389888763, -0.17203259468078613, 0.06762979924678802, -0.11229591071605682, -0.3621595501899719, 0.0946991890668869, 0.342587411403656, 0.12063385546207428, 0.19353339076042175, 0.03205987066030502, 0.03860313445329666, -0.05090917646884918, -0.47778546810150146, -0.1438167691230774, -0.025089098140597343, 0.19900289177894592, 0.1817106157541275, 0.11551493406295776, -0.07299236208200455, -0.46838411688804626, 0.057287078350782394, 0.08416453748941422, -0.3447721004486084, 0.1372157782316208, -0.34398332238197327, -0.1998528391122818, -0.0028321966528892517, -0.276289165019989, -0.4295882284641266, -0.3780532479286194, 0.1362106204032898, 0.3020915985107422, 0.23640713095664978, 0.3542707860469818, 0.3423806130886078, 0.01274484395980835, -0.0786948874592781, -0.10726942867040634, 0.23830220103263855, 0.028377175331115723, 0.28393781185150146, -0.07516976445913315, -0.257251501083374, -0.07669791579246521, -0.037464335560798645, 0.08720491826534271, 0.294569194316864, -0.4791855216026306, -0.014134753495454788, -0.3582625985145569, 0.5260703563690186, -0.08312098681926727, 0.14493517577648163, 0.22535274922847748, 0.15895995497703552, -0.004194937646389008, 0.003344491124153137, -0.1563226580619812, -0.26622116565704346, 0.2833780348300934, 0.07547761499881744, 0.055676694959402084, 0.3319579064846039, -0.19856581091880798, 0.6400830745697021, 0.023299410939216614, -0.2738661468029022, 0.4377114176750183, -0.2375326156616211, 0.45192140340805054, -0.10431645810604095, -0.3032712936401367, 0.06629733741283417, -0.10827210545539856, -0.07401157915592194, 0.044195711612701416, -0.22602307796478271, -0.3297971487045288, 0.12052588909864426, -0.18412691354751587, -0.23381878435611725, -0.14523108303546906, 0.09087691456079483, 0.14159071445465088, 0.3312854468822479, -0.08640037477016449, -0.2960985600948334, -0.2364920675754547, -0.21792711317539215, 0.025277383625507355, -0.08264269679784775, -0.22591671347618103, 0.038069967180490494, -0.035965826362371445, -0.13339830935001373, -0.34121182560920715, 0.30971473455429077, 0.17489559948444366, 0.2464342564344406, 0.1721387505531311, -0.0410853810608387, 0.11113014817237854, -0.21800363063812256, 0.32807719707489014, 0.09706304222345352, -0.182765394449234, 0.27574849128723145, 0.40072202682495117, -0.496793270111084, -0.23470546305179596, -0.19102361798286438, 0.27748310565948486, 0.24770592153072357, 0.18386921286582947, -0.3402397632598877, 0.15343794226646423, 0.16168956458568573, 0.5132279396057129, -0.044120822101831436, 0.16416697204113007, -0.27002739906311035, -0.10140333324670792, -0.4776964485645294, -0.10504379123449326, -0.01761382445693016, 0.33137673139572144, 0.005467850714921951, 0.06343299150466919, -0.14889757335186005, -0.24708475172519684, 0.0832427591085434, 0.28902047872543335, 0.3243051767349243, -0.07903829216957092, 0.11278222501277924, -0.31734713912010193, 0.0913165807723999, 0.5340574979782104, 0.7704090476036072, 0.20883658528327942, -0.34903720021247864, -0.016412770375609398, 0.05045154318213463, 0.32675692439079285, 0.11366061866283417, -0.19308175146579742, 0.18378815054893494, -0.11625105142593384, 0.10890750586986542, 0.12137383967638016, 0.04006081819534302, 0.24377843737602234, -0.07671591639518738, -0.2914526164531708, 0.08982376009225845, 0.41707974672317505, -0.03200620412826538, -0.013796605169773102, 0.18926988542079926, 0.4060444235801697, -0.1646333634853363, 0.3946790099143982, 0.03605928644537926, 0.8309652805328369, -0.04272161424160004, 0.0664454996585846, 0.5179725289344788, -0.40474075078964233, 0.16809165477752686, -0.02481294423341751, -0.0014977939426898956, -0.5320702791213989, 0.02998863160610199, 0.010089166462421417, -0.32545042037963867, 0.378400057554245, -0.024959616363048553, -0.2201615273952484, 0.13777568936347961, -0.01617369055747986, 0.21605737507343292, 0.007065225392580032, 0.16433557868003845, -0.0762438178062439, 0.12335334718227386, -0.3094923794269562, 0.09066323190927505, -0.1320367455482483, -0.20527583360671997, -0.05608992651104927, -0.08132266998291016, -0.27471923828125, -0.2721797823905945, -0.2812002897262573, -0.04469974339008331, -0.4894630014896393, 0.2627429664134979, 0.32856354117393494, -0.33071666955947876, 0.3076707124710083, 0.16620312631130219, -0.04406396299600601, 0.13957718014717102, -0.0796767994761467, 0.097402423620224, -0.013216350227594376, -0.056625720113515854, 0.12572379410266876, 0.13607007265090942, 0.10124372690916061, -0.051036760210990906, -0.24735097587108612, 0.3664361834526062, 0.06387249380350113, -0.17888739705085754, 0.14817728102207184, 0.12165239453315735, 0.2961480915546417, -0.3896706700325012, -0.059169575572013855, -0.42517295479774475, 0.09698713570833206, -0.15345673263072968, 0.05929594486951828, -0.1271677315235138, 0.26862481236457825, 0.20056328177452087, 0.013806306757032871, -0.1889253556728363, -0.2841084599494934, 0.4088476896286011, 0.03163333982229233, 0.268120139837265, 0.5743934512138367, 0.2638583779335022, -0.18598122894763947, -0.036853402853012085, 0.12482032179832458, 0.1295132040977478, -0.489487886428833, -0.0472915843129158, -0.09893018007278442, 0.1132626086473465, 0.06401893496513367, 0.03400582820177078, 0.283963680267334, 0.2301625907421112, -0.06152021512389183, -0.3313921093940735, -0.2537413239479065, 0.23526616394519806, 0.0836174413561821, -0.05974213778972626, 0.28060585260391235, 0.17075057327747345, -0.13414418697357178, -0.07644034922122955, -0.24748116731643677, 0.30566567182540894, -0.06656534224748611, 0.2226821929216385, 0.08635172247886658, -0.04553864151239395, -0.05687759071588516, -0.22526873648166656, 0.13118326663970947, 0.01636163704097271, 0.012625876814126968, -0.17638233304023743, -0.16661405563354492, 0.09999198466539383, -0.001013217493891716, -0.08072219789028168, -0.016165312379598618, -0.15215787291526794, -0.011200176551938057, -0.01796279475092888, 0.07604896277189255, -0.01460535079240799, -0.11940799653530121, -0.1400480568408966, 0.2809409499168396, -0.12060108780860901, -0.1210639476776123, 0.23246072232723236, -0.23627105355262756, 0.22578051686286926, 0.059537820518016815, 0.5264185070991516, -0.024768680334091187, 0.03063800185918808, -0.1317235678434372, 0.15129616856575012, -0.34175971150398254, -0.05293168127536774, 0.25683096051216125, -0.3094082772731781, -0.06632181257009506, 0.09374935925006866, 0.23149418830871582, 0.41054677963256836, -0.12172404676675797, -0.08593331277370453, 0.2554229199886322, 0.13186591863632202, -0.3775715231895447, -0.17314814031124115, 0.04951814189553261, -0.10026286542415619, -0.025594010949134827, 0.059920601546764374, 0.3110899329185486, -0.18170717358589172, 0.09042950719594955, 0.34185144305229187, 0.2442220151424408, 0.26974204182624817, -0.0024246424436569214, 0.44836151599884033, 0.012056268751621246, -0.20428091287612915, 0.4182865619659424, 0.1756482720375061, 0.31129884719848633, 0.26551252603530884, -0.21094004809856415, 0.16680176556110382, 0.049634188413619995, -0.19737444818019867, 0.09603322297334671, -0.42627519369125366, -0.19237294793128967, -0.0999845340847969, 0.31498318910598755, -0.061651088297367096, 0.46200695633888245, 0.45272618532180786, 0.27119389176368713, -0.07099601626396179, 0.02905261516571045, 0.3461710214614868, -0.00007067294791340828, 0.0676976889371872, -0.07238531112670898, -0.2340080291032791, -0.2650998830795288, -0.014262579381465912, -0.2551712691783905, -0.24806059896945953, 0.30818596482276917, 0.2364887148141861, -0.3372643291950226, -0.7492637038230896, 0.3052001893520355, 0.1087694764137268, 0.12708932161331177, -0.2866680324077606, 0.35383695363998413, 0.24741961061954498, -0.1135721281170845, -0.10147155821323395, 0.30838122963905334, 0.8915085792541504, 0.31771764159202576, -0.02600981295108795, 0.0024152323603630066, -0.004144560545682907, -0.15640640258789062, 0.04656856507062912, -0.1994176208972931, -0.19490215182304382, 0.4521815776824951, 0.2232360988855362, 0.17558464407920837, -0.14350566267967224, -0.19015607237815857, 0.08037736266851425, -0.002545885741710663, -0.268173485994339, 0.13124673068523407, -0.1365811973810196, -0.20019450783729553, 0.0013935090973973274, -0.0007405504584312439, -0.42817452549934387, -0.00899314135313034, 0.4281740188598633, 0.13380154967308044, 0.11360006779432297, -0.12113121151924133, 0.04415826499462128, 0.045718587934970856, 0.44777101278305054, 0.6064440011978149, 0.13685736060142517, -0.1345338374376297, -0.08647548407316208, -0.42366355657577515, 0.275939404964447, -0.332254558801651, -0.044852398335933685, 0.12691543996334076, 0.20620226860046387, 0.0542919784784317, 0.07830438017845154, 0.27757400274276733, 0.420621782541275, -0.17724910378456116, -0.05108058452606201, -0.332472562789917, -0.10067255795001984, 0.046692438423633575, -0.22204174101352692, -0.12957659363746643, -0.24664458632469177, 0.3911384344100952, -0.2919163107872009, 0.06642098724842072, -0.3800824284553528, -0.14073927700519562, 0.25868332386016846, -0.08691835403442383, 0.45785221457481384, 0.0009060781449079514, 0.41875797510147095, 0.03265461325645447, -0.17067331075668335, -0.3290652632713318, -0.3339603543281555, -0.28833654522895813, 0.3402409255504608, -0.05063445493578911, 0.4427412152290344, -0.18638867139816284, -0.3720743954181671, -0.10302574187517166, 0.2508411407470703, -0.09061776846647263, 0.15800976753234863, 0.19902543723583221, 0.03442266583442688, 0.0075860098004341125, 0.01790967583656311, -0.08486709743738174, -0.08275871723890305, 0.09513992816209793, 0.16722926497459412, -0.2761419415473938, -0.6448034048080444, 0.241926908493042, -0.2260374277830124, -0.20503024756908417, 0.04457248002290726, 0.05650459975004196, 0.17781129479408264, 0.026200050488114357, -0.4378465712070465, 0.234495609998703, 0.40572476387023926, -0.15454722940921783, -0.12775224447250366, 0.18590374290943146, 0.10264274477958679, 0.14742787182331085, -0.025282561779022217, 0.3295576870441437, -0.06774131953716278, -0.28767818212509155, -0.11397577822208405, -0.18642500042915344 ]
https://github.com/huggingface/datasets/issues/5923
> I got the same error, pyarrow 12.0.0 released May/2023 (https://pypi.org/project/pyarrow/) is not compatible, running `pip install pyarrow==11.0.0` to force install the previous version solved the problem. > > Do we need to update dependencies? This works for me as well
Cannot import datasets - ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility
### Describe the bug When trying to import datasets, I get a pyarrow ValueError: Traceback (most recent call last): File "/Users/edward/test/test.py", line 1, in <module> import datasets File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module> from .arrow_dataset import Dataset File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 65, in <module> from .arrow_reader import ArrowReader File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_reader.py", line 28, in <module> import pyarrow.parquet as pq File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/__init__.py", line 20, in <module> from .core import * File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/core.py", line 45, in <module> from pyarrow.fs import (LocalFileSystem, FileSystem, FileType, File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/fs.py", line 49, in <module> from pyarrow._gcsfs import GcsFileSystem # noqa File "pyarrow/_gcsfs.pyx", line 1, in init pyarrow._gcsfs ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject ### Steps to reproduce the bug `import datasets` ### Expected behavior Successful import ### Environment info Conda environment, MacOS python 3.9.12 datasets 2.12.0
41
Cannot import datasets - ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility ### Describe the bug When trying to import datasets, I get a pyarrow ValueError: Traceback (most recent call last): File "/Users/edward/test/test.py", line 1, in <module> import datasets File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module> from .arrow_dataset import Dataset File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 65, in <module> from .arrow_reader import ArrowReader File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_reader.py", line 28, in <module> import pyarrow.parquet as pq File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/__init__.py", line 20, in <module> from .core import * File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/core.py", line 45, in <module> from pyarrow.fs import (LocalFileSystem, FileSystem, FileType, File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/fs.py", line 49, in <module> from pyarrow._gcsfs import GcsFileSystem # noqa File "pyarrow/_gcsfs.pyx", line 1, in init pyarrow._gcsfs ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject ### Steps to reproduce the bug `import datasets` ### Expected behavior Successful import ### Environment info Conda environment, MacOS python 3.9.12 datasets 2.12.0 > I got the same error, pyarrow 12.0.0 released May/2023 (https://pypi.org/project/pyarrow/) is not compatible, running `pip install pyarrow==11.0.0` to force install the previous version solved the problem. > > Do we need to update dependencies? This works for me as well
[ -0.5389391183853149, 0.41014090180397034, -0.09792473912239075, 0.2319422960281372, 0.14288535714149475, -0.13102033734321594, 0.21223437786102295, 0.2684710919857025, -0.408712774515152, 0.09050598740577698, -0.20407867431640625, 0.27507221698760986, -0.12025684118270874, 0.1409701108932495, -0.16671998798847198, 0.01760251820087433, 0.05824655294418335, 0.2816929221153259, -0.1661183387041092, 0.113141730427742, -0.10728545486927032, 0.16610445082187653, -0.21358206868171692, 0.11508075147867203, 0.011453785002231598, -0.10817255824804306, -0.14227774739265442, 0.24949845671653748, -0.43753454089164734, -0.7070934176445007, 0.3522906005382538, -0.086106076836586, 0.07033614069223404, 0.4895254969596863, -0.00011616970732575282, 0.18690964579582214, 0.2657691538333893, 0.06419306993484497, -0.253903865814209, -0.07424189150333405, 0.06377491354942322, -0.2764390707015991, 0.26972654461860657, -0.11235450953245163, 0.3193272650241852, -0.5484874248504639, 0.06671421974897385, 0.16740885376930237, 0.054839521646499634, 0.40047457814216614, 0.19530938565731049, 0.38214990496635437, 0.6554259061813354, 0.1227761059999466, 0.5305083990097046, 0.04909924045205116, 0.03578562289476395, 0.5898970365524292, 0.2579425871372223, 0.05691107362508774, 0.0021759532392024994, -0.20591427385807037, -0.1010093167424202, -0.048358254134655, 0.15855109691619873, -0.18132737278938293, -0.03536137938499451, -0.18852782249450684, -0.06856274604797363, -0.08543333411216736, 0.4250427186489105, -0.5830304026603699, -0.302016019821167, -0.09135070443153381, 0.10421205312013626, -0.45955967903137207, 0.28538691997528076, 0.21514496207237244, 0.1239168643951416, 0.22662369906902313, -0.08318190276622772, -0.12021125853061676, -0.3959175944328308, 0.18164576590061188, -0.32514679431915283, 0.24191302061080933, 0.029269661754369736, 0.19708991050720215, 0.00875172670930624, -0.18387901782989502, 0.42467594146728516, -0.02596220001578331, -0.23255464434623718, 0.08952406048774719, -0.22075620293617249, 0.081318199634552, 0.020974012091755867, 0.13495442271232605, -0.04143968224525452, 0.02640334889292717, -0.058164432644844055, -0.15183407068252563, -0.033698271960020065, 0.33083441853523254, 0.024396397173404694, 0.05486329272389412, -0.12570367753505707, 0.2684255838394165, 0.1664728820323944, 0.1868094801902771, -0.005677856504917145, -0.02999785915017128, -0.04185599088668823, -0.3846703767776489, 0.08216149359941483, 0.0356256403028965, 0.4344305098056793, -0.1588757187128067, -0.29218998551368713, -0.012626070529222488, -0.25384315848350525, 0.026433870196342468, -0.17737063765525818, 0.2993183434009552, -0.01885107159614563, 0.2504885196685791, 0.1386951059103012, 0.2536332607269287, -0.11470460891723633, -0.23161382973194122, -0.05686569958925247, 0.10283129662275314, -0.0738179013133049, -0.22125279903411865, 0.08629242330789566, -0.1755020022392273, 0.13045690953731537, 0.12832950055599213, 0.1933923065662384, 0.12288786470890045, -0.06554929167032242, -0.24240773916244507, -0.04746447876095772, 0.31247541308403015, -0.03729112073779106, 0.10041829198598862, 0.015014491975307465, -0.30412307381629944, -0.21219328045845032, 0.14690840244293213, -0.3801676332950592, -0.11307426542043686, -0.38429704308509827, 0.17333675920963287, -0.00567549467086792, -0.05924506485462189, -0.19764062762260437, -0.09340038895606995, 0.1950654685497284, -0.4064936637878418, -0.0562329925596714, -0.48926854133605957, 0.16215912997722626, -0.4678736925125122, -0.015019897371530533, 0.15141348540782928, -0.7889991998672485, 0.07376639544963837, 0.04906328022480011, 0.004440071061253548, 0.1919279396533966, 0.3100696802139282, -0.2902900278568268, -0.12284907698631287, -0.0004233941435813904, 0.1427394151687622, 0.2366839200258255, -0.21537001430988312, -0.6268244385719299, 0.0864512026309967, 0.03838047385215759, -0.24220477044582367, 0.1674947738647461, -0.17949894070625305, 0.19456103444099426, 0.09760883450508118, -0.10673335194587708, 0.1721334308385849, -0.07684064656496048, 0.04093795269727707, -0.19862762093544006, -0.5216740369796753, 0.2674814760684967, -0.03322679176926613, 0.10352544486522675, -0.39543211460113525, 0.35555097460746765, -0.3969314396381378, 0.29034629464149475, -0.1645258665084839, 0.057519592344760895, 0.33262306451797485, 0.3348727524280548, -0.11456172168254852, 0.021700289100408554, -0.2176801711320877, -0.2977602779865265, 0.1422601044178009, -0.381434828042984, -0.11011587828397751, -0.3259420096874237, -0.1059422641992569, -0.3133503198623657, 0.26993176341056824, 0.05359809473156929, -0.006133888382464647, 0.05970541015267372, 0.057409174740314484, -0.016452211886644363, 0.10308235138654709, -0.03366893529891968, 0.07832518219947815, -0.0958491861820221, 0.19671405851840973, -0.24218088388442993, 0.5291696190834045, -0.3428577184677124, -0.4746672213077545, 0.19328927993774414, -0.0023095812648534775, 0.0374557301402092, -0.06310087442398071, -0.14555492997169495, 0.4702662229537964, -0.028681166470050812, 0.3286389708518982, -0.1707378774881363, 0.084703728556633, 0.21563316881656647, -0.229253888130188, 0.32963529229164124, -0.028982695192098618, 0.08914411067962646, 0.20938627421855927, 0.13785672187805176, 0.16456446051597595, 0.16380859911441803, 0.09281909465789795, 0.12126252800226212, -0.22491805255413055, -0.030612699687480927, 0.13591116666793823, 0.1629302054643631, -0.009373307228088379, 0.04221060499548912, 0.1983906328678131, 0.12568755447864532, 0.1722821295261383, -0.2852168679237366, 0.08072225749492645, 0.42531582713127136, 0.0626024603843689, -0.008041251450777054, 0.1384713351726532, -0.2746993601322174, 0.050757043063640594, 0.36250460147857666, -0.14058038592338562, 0.29622507095336914, 0.3149271309375763, -0.1703774780035019, -0.029386475682258606, -0.0971117913722992, -0.052491623908281326, 0.18679046630859375, 0.13654297590255737, 0.2397942692041397, 0.07676659524440765, 0.623730480670929, 0.04727469012141228, -0.2200196385383606, -0.13672858476638794, 0.04518246650695801, 0.27634674310684204, -0.452684223651886, 0.308177649974823, -0.4269106388092041, -0.0024414435029029846, -0.23781991004943848, -0.154685840010643, -0.3824634552001953, -0.27317434549331665, -0.2290082722902298, 0.3882075548171997, 0.031330808997154236, 0.08750251680612564, -0.023035410791635513, -0.1944246143102646, 0.18350647389888763, -0.17203259468078613, 0.06762979924678802, -0.11229591071605682, -0.3621595501899719, 0.0946991890668869, 0.342587411403656, 0.12063385546207428, 0.19353339076042175, 0.03205987066030502, 0.03860313445329666, -0.05090917646884918, -0.47778546810150146, -0.1438167691230774, -0.025089098140597343, 0.19900289177894592, 0.1817106157541275, 0.11551493406295776, -0.07299236208200455, -0.46838411688804626, 0.057287078350782394, 0.08416453748941422, -0.3447721004486084, 0.1372157782316208, -0.34398332238197327, -0.1998528391122818, -0.0028321966528892517, -0.276289165019989, -0.4295882284641266, -0.3780532479286194, 0.1362106204032898, 0.3020915985107422, 0.23640713095664978, 0.3542707860469818, 0.3423806130886078, 0.01274484395980835, -0.0786948874592781, -0.10726942867040634, 0.23830220103263855, 0.028377175331115723, 0.28393781185150146, -0.07516976445913315, -0.257251501083374, -0.07669791579246521, -0.037464335560798645, 0.08720491826534271, 0.294569194316864, -0.4791855216026306, -0.014134753495454788, -0.3582625985145569, 0.5260703563690186, -0.08312098681926727, 0.14493517577648163, 0.22535274922847748, 0.15895995497703552, -0.004194937646389008, 0.003344491124153137, -0.1563226580619812, -0.26622116565704346, 0.2833780348300934, 0.07547761499881744, 0.055676694959402084, 0.3319579064846039, -0.19856581091880798, 0.6400830745697021, 0.023299410939216614, -0.2738661468029022, 0.4377114176750183, -0.2375326156616211, 0.45192140340805054, -0.10431645810604095, -0.3032712936401367, 0.06629733741283417, -0.10827210545539856, -0.07401157915592194, 0.044195711612701416, -0.22602307796478271, -0.3297971487045288, 0.12052588909864426, -0.18412691354751587, -0.23381878435611725, -0.14523108303546906, 0.09087691456079483, 0.14159071445465088, 0.3312854468822479, -0.08640037477016449, -0.2960985600948334, -0.2364920675754547, -0.21792711317539215, 0.025277383625507355, -0.08264269679784775, -0.22591671347618103, 0.038069967180490494, -0.035965826362371445, -0.13339830935001373, -0.34121182560920715, 0.30971473455429077, 0.17489559948444366, 0.2464342564344406, 0.1721387505531311, -0.0410853810608387, 0.11113014817237854, -0.21800363063812256, 0.32807719707489014, 0.09706304222345352, -0.182765394449234, 0.27574849128723145, 0.40072202682495117, -0.496793270111084, -0.23470546305179596, -0.19102361798286438, 0.27748310565948486, 0.24770592153072357, 0.18386921286582947, -0.3402397632598877, 0.15343794226646423, 0.16168956458568573, 0.5132279396057129, -0.044120822101831436, 0.16416697204113007, -0.27002739906311035, -0.10140333324670792, -0.4776964485645294, -0.10504379123449326, -0.01761382445693016, 0.33137673139572144, 0.005467850714921951, 0.06343299150466919, -0.14889757335186005, -0.24708475172519684, 0.0832427591085434, 0.28902047872543335, 0.3243051767349243, -0.07903829216957092, 0.11278222501277924, -0.31734713912010193, 0.0913165807723999, 0.5340574979782104, 0.7704090476036072, 0.20883658528327942, -0.34903720021247864, -0.016412770375609398, 0.05045154318213463, 0.32675692439079285, 0.11366061866283417, -0.19308175146579742, 0.18378815054893494, -0.11625105142593384, 0.10890750586986542, 0.12137383967638016, 0.04006081819534302, 0.24377843737602234, -0.07671591639518738, -0.2914526164531708, 0.08982376009225845, 0.41707974672317505, -0.03200620412826538, -0.013796605169773102, 0.18926988542079926, 0.4060444235801697, -0.1646333634853363, 0.3946790099143982, 0.03605928644537926, 0.8309652805328369, -0.04272161424160004, 0.0664454996585846, 0.5179725289344788, -0.40474075078964233, 0.16809165477752686, -0.02481294423341751, -0.0014977939426898956, -0.5320702791213989, 0.02998863160610199, 0.010089166462421417, -0.32545042037963867, 0.378400057554245, -0.024959616363048553, -0.2201615273952484, 0.13777568936347961, -0.01617369055747986, 0.21605737507343292, 0.007065225392580032, 0.16433557868003845, -0.0762438178062439, 0.12335334718227386, -0.3094923794269562, 0.09066323190927505, -0.1320367455482483, -0.20527583360671997, -0.05608992651104927, -0.08132266998291016, -0.27471923828125, -0.2721797823905945, -0.2812002897262573, -0.04469974339008331, -0.4894630014896393, 0.2627429664134979, 0.32856354117393494, -0.33071666955947876, 0.3076707124710083, 0.16620312631130219, -0.04406396299600601, 0.13957718014717102, -0.0796767994761467, 0.097402423620224, -0.013216350227594376, -0.056625720113515854, 0.12572379410266876, 0.13607007265090942, 0.10124372690916061, -0.051036760210990906, -0.24735097587108612, 0.3664361834526062, 0.06387249380350113, -0.17888739705085754, 0.14817728102207184, 0.12165239453315735, 0.2961480915546417, -0.3896706700325012, -0.059169575572013855, -0.42517295479774475, 0.09698713570833206, -0.15345673263072968, 0.05929594486951828, -0.1271677315235138, 0.26862481236457825, 0.20056328177452087, 0.013806306757032871, -0.1889253556728363, -0.2841084599494934, 0.4088476896286011, 0.03163333982229233, 0.268120139837265, 0.5743934512138367, 0.2638583779335022, -0.18598122894763947, -0.036853402853012085, 0.12482032179832458, 0.1295132040977478, -0.489487886428833, -0.0472915843129158, -0.09893018007278442, 0.1132626086473465, 0.06401893496513367, 0.03400582820177078, 0.283963680267334, 0.2301625907421112, -0.06152021512389183, -0.3313921093940735, -0.2537413239479065, 0.23526616394519806, 0.0836174413561821, -0.05974213778972626, 0.28060585260391235, 0.17075057327747345, -0.13414418697357178, -0.07644034922122955, -0.24748116731643677, 0.30566567182540894, -0.06656534224748611, 0.2226821929216385, 0.08635172247886658, -0.04553864151239395, -0.05687759071588516, -0.22526873648166656, 0.13118326663970947, 0.01636163704097271, 0.012625876814126968, -0.17638233304023743, -0.16661405563354492, 0.09999198466539383, -0.001013217493891716, -0.08072219789028168, -0.016165312379598618, -0.15215787291526794, -0.011200176551938057, -0.01796279475092888, 0.07604896277189255, -0.01460535079240799, -0.11940799653530121, -0.1400480568408966, 0.2809409499168396, -0.12060108780860901, -0.1210639476776123, 0.23246072232723236, -0.23627105355262756, 0.22578051686286926, 0.059537820518016815, 0.5264185070991516, -0.024768680334091187, 0.03063800185918808, -0.1317235678434372, 0.15129616856575012, -0.34175971150398254, -0.05293168127536774, 0.25683096051216125, -0.3094082772731781, -0.06632181257009506, 0.09374935925006866, 0.23149418830871582, 0.41054677963256836, -0.12172404676675797, -0.08593331277370453, 0.2554229199886322, 0.13186591863632202, -0.3775715231895447, -0.17314814031124115, 0.04951814189553261, -0.10026286542415619, -0.025594010949134827, 0.059920601546764374, 0.3110899329185486, -0.18170717358589172, 0.09042950719594955, 0.34185144305229187, 0.2442220151424408, 0.26974204182624817, -0.0024246424436569214, 0.44836151599884033, 0.012056268751621246, -0.20428091287612915, 0.4182865619659424, 0.1756482720375061, 0.31129884719848633, 0.26551252603530884, -0.21094004809856415, 0.16680176556110382, 0.049634188413619995, -0.19737444818019867, 0.09603322297334671, -0.42627519369125366, -0.19237294793128967, -0.0999845340847969, 0.31498318910598755, -0.061651088297367096, 0.46200695633888245, 0.45272618532180786, 0.27119389176368713, -0.07099601626396179, 0.02905261516571045, 0.3461710214614868, -0.00007067294791340828, 0.0676976889371872, -0.07238531112670898, -0.2340080291032791, -0.2650998830795288, -0.014262579381465912, -0.2551712691783905, -0.24806059896945953, 0.30818596482276917, 0.2364887148141861, -0.3372643291950226, -0.7492637038230896, 0.3052001893520355, 0.1087694764137268, 0.12708932161331177, -0.2866680324077606, 0.35383695363998413, 0.24741961061954498, -0.1135721281170845, -0.10147155821323395, 0.30838122963905334, 0.8915085792541504, 0.31771764159202576, -0.02600981295108795, 0.0024152323603630066, -0.004144560545682907, -0.15640640258789062, 0.04656856507062912, -0.1994176208972931, -0.19490215182304382, 0.4521815776824951, 0.2232360988855362, 0.17558464407920837, -0.14350566267967224, -0.19015607237815857, 0.08037736266851425, -0.002545885741710663, -0.268173485994339, 0.13124673068523407, -0.1365811973810196, -0.20019450783729553, 0.0013935090973973274, -0.0007405504584312439, -0.42817452549934387, -0.00899314135313034, 0.4281740188598633, 0.13380154967308044, 0.11360006779432297, -0.12113121151924133, 0.04415826499462128, 0.045718587934970856, 0.44777101278305054, 0.6064440011978149, 0.13685736060142517, -0.1345338374376297, -0.08647548407316208, -0.42366355657577515, 0.275939404964447, -0.332254558801651, -0.044852398335933685, 0.12691543996334076, 0.20620226860046387, 0.0542919784784317, 0.07830438017845154, 0.27757400274276733, 0.420621782541275, -0.17724910378456116, -0.05108058452606201, -0.332472562789917, -0.10067255795001984, 0.046692438423633575, -0.22204174101352692, -0.12957659363746643, -0.24664458632469177, 0.3911384344100952, -0.2919163107872009, 0.06642098724842072, -0.3800824284553528, -0.14073927700519562, 0.25868332386016846, -0.08691835403442383, 0.45785221457481384, 0.0009060781449079514, 0.41875797510147095, 0.03265461325645447, -0.17067331075668335, -0.3290652632713318, -0.3339603543281555, -0.28833654522895813, 0.3402409255504608, -0.05063445493578911, 0.4427412152290344, -0.18638867139816284, -0.3720743954181671, -0.10302574187517166, 0.2508411407470703, -0.09061776846647263, 0.15800976753234863, 0.19902543723583221, 0.03442266583442688, 0.0075860098004341125, 0.01790967583656311, -0.08486709743738174, -0.08275871723890305, 0.09513992816209793, 0.16722926497459412, -0.2761419415473938, -0.6448034048080444, 0.241926908493042, -0.2260374277830124, -0.20503024756908417, 0.04457248002290726, 0.05650459975004196, 0.17781129479408264, 0.026200050488114357, -0.4378465712070465, 0.234495609998703, 0.40572476387023926, -0.15454722940921783, -0.12775224447250366, 0.18590374290943146, 0.10264274477958679, 0.14742787182331085, -0.025282561779022217, 0.3295576870441437, -0.06774131953716278, -0.28767818212509155, -0.11397577822208405, -0.18642500042915344 ]
https://github.com/huggingface/datasets/issues/5923
> I got different. Solved with pip install pyarrow==12.0.1 pip install cchardet > > env: Python 3.9.16 transformers 4.32.1 I guess it also depends on the Python version. I got Python 3.11.5 and pyarrow==12.0.0. It works!
Cannot import datasets - ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility
### Describe the bug When trying to import datasets, I get a pyarrow ValueError: Traceback (most recent call last): File "/Users/edward/test/test.py", line 1, in <module> import datasets File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module> from .arrow_dataset import Dataset File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 65, in <module> from .arrow_reader import ArrowReader File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_reader.py", line 28, in <module> import pyarrow.parquet as pq File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/__init__.py", line 20, in <module> from .core import * File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/core.py", line 45, in <module> from pyarrow.fs import (LocalFileSystem, FileSystem, FileType, File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/fs.py", line 49, in <module> from pyarrow._gcsfs import GcsFileSystem # noqa File "pyarrow/_gcsfs.pyx", line 1, in init pyarrow._gcsfs ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject ### Steps to reproduce the bug `import datasets` ### Expected behavior Successful import ### Environment info Conda environment, MacOS python 3.9.12 datasets 2.12.0
36
Cannot import datasets - ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility ### Describe the bug When trying to import datasets, I get a pyarrow ValueError: Traceback (most recent call last): File "/Users/edward/test/test.py", line 1, in <module> import datasets File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module> from .arrow_dataset import Dataset File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 65, in <module> from .arrow_reader import ArrowReader File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_reader.py", line 28, in <module> import pyarrow.parquet as pq File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/__init__.py", line 20, in <module> from .core import * File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/core.py", line 45, in <module> from pyarrow.fs import (LocalFileSystem, FileSystem, FileType, File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/fs.py", line 49, in <module> from pyarrow._gcsfs import GcsFileSystem # noqa File "pyarrow/_gcsfs.pyx", line 1, in init pyarrow._gcsfs ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject ### Steps to reproduce the bug `import datasets` ### Expected behavior Successful import ### Environment info Conda environment, MacOS python 3.9.12 datasets 2.12.0 > I got different. Solved with pip install pyarrow==12.0.1 pip install cchardet > > env: Python 3.9.16 transformers 4.32.1 I guess it also depends on the Python version. I got Python 3.11.5 and pyarrow==12.0.0. It works!
[ -0.5389391183853149, 0.41014090180397034, -0.09792473912239075, 0.2319422960281372, 0.14288535714149475, -0.13102033734321594, 0.21223437786102295, 0.2684710919857025, -0.408712774515152, 0.09050598740577698, -0.20407867431640625, 0.27507221698760986, -0.12025684118270874, 0.1409701108932495, -0.16671998798847198, 0.01760251820087433, 0.05824655294418335, 0.2816929221153259, -0.1661183387041092, 0.113141730427742, -0.10728545486927032, 0.16610445082187653, -0.21358206868171692, 0.11508075147867203, 0.011453785002231598, -0.10817255824804306, -0.14227774739265442, 0.24949845671653748, -0.43753454089164734, -0.7070934176445007, 0.3522906005382538, -0.086106076836586, 0.07033614069223404, 0.4895254969596863, -0.00011616970732575282, 0.18690964579582214, 0.2657691538333893, 0.06419306993484497, -0.253903865814209, -0.07424189150333405, 0.06377491354942322, -0.2764390707015991, 0.26972654461860657, -0.11235450953245163, 0.3193272650241852, -0.5484874248504639, 0.06671421974897385, 0.16740885376930237, 0.054839521646499634, 0.40047457814216614, 0.19530938565731049, 0.38214990496635437, 0.6554259061813354, 0.1227761059999466, 0.5305083990097046, 0.04909924045205116, 0.03578562289476395, 0.5898970365524292, 0.2579425871372223, 0.05691107362508774, 0.0021759532392024994, -0.20591427385807037, -0.1010093167424202, -0.048358254134655, 0.15855109691619873, -0.18132737278938293, -0.03536137938499451, -0.18852782249450684, -0.06856274604797363, -0.08543333411216736, 0.4250427186489105, -0.5830304026603699, -0.302016019821167, -0.09135070443153381, 0.10421205312013626, -0.45955967903137207, 0.28538691997528076, 0.21514496207237244, 0.1239168643951416, 0.22662369906902313, -0.08318190276622772, -0.12021125853061676, -0.3959175944328308, 0.18164576590061188, -0.32514679431915283, 0.24191302061080933, 0.029269661754369736, 0.19708991050720215, 0.00875172670930624, -0.18387901782989502, 0.42467594146728516, -0.02596220001578331, -0.23255464434623718, 0.08952406048774719, -0.22075620293617249, 0.081318199634552, 0.020974012091755867, 0.13495442271232605, -0.04143968224525452, 0.02640334889292717, -0.058164432644844055, -0.15183407068252563, -0.033698271960020065, 0.33083441853523254, 0.024396397173404694, 0.05486329272389412, -0.12570367753505707, 0.2684255838394165, 0.1664728820323944, 0.1868094801902771, -0.005677856504917145, -0.02999785915017128, -0.04185599088668823, -0.3846703767776489, 0.08216149359941483, 0.0356256403028965, 0.4344305098056793, -0.1588757187128067, -0.29218998551368713, -0.012626070529222488, -0.25384315848350525, 0.026433870196342468, -0.17737063765525818, 0.2993183434009552, -0.01885107159614563, 0.2504885196685791, 0.1386951059103012, 0.2536332607269287, -0.11470460891723633, -0.23161382973194122, -0.05686569958925247, 0.10283129662275314, -0.0738179013133049, -0.22125279903411865, 0.08629242330789566, -0.1755020022392273, 0.13045690953731537, 0.12832950055599213, 0.1933923065662384, 0.12288786470890045, -0.06554929167032242, -0.24240773916244507, -0.04746447876095772, 0.31247541308403015, -0.03729112073779106, 0.10041829198598862, 0.015014491975307465, -0.30412307381629944, -0.21219328045845032, 0.14690840244293213, -0.3801676332950592, -0.11307426542043686, -0.38429704308509827, 0.17333675920963287, -0.00567549467086792, -0.05924506485462189, -0.19764062762260437, -0.09340038895606995, 0.1950654685497284, -0.4064936637878418, -0.0562329925596714, -0.48926854133605957, 0.16215912997722626, -0.4678736925125122, -0.015019897371530533, 0.15141348540782928, -0.7889991998672485, 0.07376639544963837, 0.04906328022480011, 0.004440071061253548, 0.1919279396533966, 0.3100696802139282, -0.2902900278568268, -0.12284907698631287, -0.0004233941435813904, 0.1427394151687622, 0.2366839200258255, -0.21537001430988312, -0.6268244385719299, 0.0864512026309967, 0.03838047385215759, -0.24220477044582367, 0.1674947738647461, -0.17949894070625305, 0.19456103444099426, 0.09760883450508118, -0.10673335194587708, 0.1721334308385849, -0.07684064656496048, 0.04093795269727707, -0.19862762093544006, -0.5216740369796753, 0.2674814760684967, -0.03322679176926613, 0.10352544486522675, -0.39543211460113525, 0.35555097460746765, -0.3969314396381378, 0.29034629464149475, -0.1645258665084839, 0.057519592344760895, 0.33262306451797485, 0.3348727524280548, -0.11456172168254852, 0.021700289100408554, -0.2176801711320877, -0.2977602779865265, 0.1422601044178009, -0.381434828042984, -0.11011587828397751, -0.3259420096874237, -0.1059422641992569, -0.3133503198623657, 0.26993176341056824, 0.05359809473156929, -0.006133888382464647, 0.05970541015267372, 0.057409174740314484, -0.016452211886644363, 0.10308235138654709, -0.03366893529891968, 0.07832518219947815, -0.0958491861820221, 0.19671405851840973, -0.24218088388442993, 0.5291696190834045, -0.3428577184677124, -0.4746672213077545, 0.19328927993774414, -0.0023095812648534775, 0.0374557301402092, -0.06310087442398071, -0.14555492997169495, 0.4702662229537964, -0.028681166470050812, 0.3286389708518982, -0.1707378774881363, 0.084703728556633, 0.21563316881656647, -0.229253888130188, 0.32963529229164124, -0.028982695192098618, 0.08914411067962646, 0.20938627421855927, 0.13785672187805176, 0.16456446051597595, 0.16380859911441803, 0.09281909465789795, 0.12126252800226212, -0.22491805255413055, -0.030612699687480927, 0.13591116666793823, 0.1629302054643631, -0.009373307228088379, 0.04221060499548912, 0.1983906328678131, 0.12568755447864532, 0.1722821295261383, -0.2852168679237366, 0.08072225749492645, 0.42531582713127136, 0.0626024603843689, -0.008041251450777054, 0.1384713351726532, -0.2746993601322174, 0.050757043063640594, 0.36250460147857666, -0.14058038592338562, 0.29622507095336914, 0.3149271309375763, -0.1703774780035019, -0.029386475682258606, -0.0971117913722992, -0.052491623908281326, 0.18679046630859375, 0.13654297590255737, 0.2397942692041397, 0.07676659524440765, 0.623730480670929, 0.04727469012141228, -0.2200196385383606, -0.13672858476638794, 0.04518246650695801, 0.27634674310684204, -0.452684223651886, 0.308177649974823, -0.4269106388092041, -0.0024414435029029846, -0.23781991004943848, -0.154685840010643, -0.3824634552001953, -0.27317434549331665, -0.2290082722902298, 0.3882075548171997, 0.031330808997154236, 0.08750251680612564, -0.023035410791635513, -0.1944246143102646, 0.18350647389888763, -0.17203259468078613, 0.06762979924678802, -0.11229591071605682, -0.3621595501899719, 0.0946991890668869, 0.342587411403656, 0.12063385546207428, 0.19353339076042175, 0.03205987066030502, 0.03860313445329666, -0.05090917646884918, -0.47778546810150146, -0.1438167691230774, -0.025089098140597343, 0.19900289177894592, 0.1817106157541275, 0.11551493406295776, -0.07299236208200455, -0.46838411688804626, 0.057287078350782394, 0.08416453748941422, -0.3447721004486084, 0.1372157782316208, -0.34398332238197327, -0.1998528391122818, -0.0028321966528892517, -0.276289165019989, -0.4295882284641266, -0.3780532479286194, 0.1362106204032898, 0.3020915985107422, 0.23640713095664978, 0.3542707860469818, 0.3423806130886078, 0.01274484395980835, -0.0786948874592781, -0.10726942867040634, 0.23830220103263855, 0.028377175331115723, 0.28393781185150146, -0.07516976445913315, -0.257251501083374, -0.07669791579246521, -0.037464335560798645, 0.08720491826534271, 0.294569194316864, -0.4791855216026306, -0.014134753495454788, -0.3582625985145569, 0.5260703563690186, -0.08312098681926727, 0.14493517577648163, 0.22535274922847748, 0.15895995497703552, -0.004194937646389008, 0.003344491124153137, -0.1563226580619812, -0.26622116565704346, 0.2833780348300934, 0.07547761499881744, 0.055676694959402084, 0.3319579064846039, -0.19856581091880798, 0.6400830745697021, 0.023299410939216614, -0.2738661468029022, 0.4377114176750183, -0.2375326156616211, 0.45192140340805054, -0.10431645810604095, -0.3032712936401367, 0.06629733741283417, -0.10827210545539856, -0.07401157915592194, 0.044195711612701416, -0.22602307796478271, -0.3297971487045288, 0.12052588909864426, -0.18412691354751587, -0.23381878435611725, -0.14523108303546906, 0.09087691456079483, 0.14159071445465088, 0.3312854468822479, -0.08640037477016449, -0.2960985600948334, -0.2364920675754547, -0.21792711317539215, 0.025277383625507355, -0.08264269679784775, -0.22591671347618103, 0.038069967180490494, -0.035965826362371445, -0.13339830935001373, -0.34121182560920715, 0.30971473455429077, 0.17489559948444366, 0.2464342564344406, 0.1721387505531311, -0.0410853810608387, 0.11113014817237854, -0.21800363063812256, 0.32807719707489014, 0.09706304222345352, -0.182765394449234, 0.27574849128723145, 0.40072202682495117, -0.496793270111084, -0.23470546305179596, -0.19102361798286438, 0.27748310565948486, 0.24770592153072357, 0.18386921286582947, -0.3402397632598877, 0.15343794226646423, 0.16168956458568573, 0.5132279396057129, -0.044120822101831436, 0.16416697204113007, -0.27002739906311035, -0.10140333324670792, -0.4776964485645294, -0.10504379123449326, -0.01761382445693016, 0.33137673139572144, 0.005467850714921951, 0.06343299150466919, -0.14889757335186005, -0.24708475172519684, 0.0832427591085434, 0.28902047872543335, 0.3243051767349243, -0.07903829216957092, 0.11278222501277924, -0.31734713912010193, 0.0913165807723999, 0.5340574979782104, 0.7704090476036072, 0.20883658528327942, -0.34903720021247864, -0.016412770375609398, 0.05045154318213463, 0.32675692439079285, 0.11366061866283417, -0.19308175146579742, 0.18378815054893494, -0.11625105142593384, 0.10890750586986542, 0.12137383967638016, 0.04006081819534302, 0.24377843737602234, -0.07671591639518738, -0.2914526164531708, 0.08982376009225845, 0.41707974672317505, -0.03200620412826538, -0.013796605169773102, 0.18926988542079926, 0.4060444235801697, -0.1646333634853363, 0.3946790099143982, 0.03605928644537926, 0.8309652805328369, -0.04272161424160004, 0.0664454996585846, 0.5179725289344788, -0.40474075078964233, 0.16809165477752686, -0.02481294423341751, -0.0014977939426898956, -0.5320702791213989, 0.02998863160610199, 0.010089166462421417, -0.32545042037963867, 0.378400057554245, -0.024959616363048553, -0.2201615273952484, 0.13777568936347961, -0.01617369055747986, 0.21605737507343292, 0.007065225392580032, 0.16433557868003845, -0.0762438178062439, 0.12335334718227386, -0.3094923794269562, 0.09066323190927505, -0.1320367455482483, -0.20527583360671997, -0.05608992651104927, -0.08132266998291016, -0.27471923828125, -0.2721797823905945, -0.2812002897262573, -0.04469974339008331, -0.4894630014896393, 0.2627429664134979, 0.32856354117393494, -0.33071666955947876, 0.3076707124710083, 0.16620312631130219, -0.04406396299600601, 0.13957718014717102, -0.0796767994761467, 0.097402423620224, -0.013216350227594376, -0.056625720113515854, 0.12572379410266876, 0.13607007265090942, 0.10124372690916061, -0.051036760210990906, -0.24735097587108612, 0.3664361834526062, 0.06387249380350113, -0.17888739705085754, 0.14817728102207184, 0.12165239453315735, 0.2961480915546417, -0.3896706700325012, -0.059169575572013855, -0.42517295479774475, 0.09698713570833206, -0.15345673263072968, 0.05929594486951828, -0.1271677315235138, 0.26862481236457825, 0.20056328177452087, 0.013806306757032871, -0.1889253556728363, -0.2841084599494934, 0.4088476896286011, 0.03163333982229233, 0.268120139837265, 0.5743934512138367, 0.2638583779335022, -0.18598122894763947, -0.036853402853012085, 0.12482032179832458, 0.1295132040977478, -0.489487886428833, -0.0472915843129158, -0.09893018007278442, 0.1132626086473465, 0.06401893496513367, 0.03400582820177078, 0.283963680267334, 0.2301625907421112, -0.06152021512389183, -0.3313921093940735, -0.2537413239479065, 0.23526616394519806, 0.0836174413561821, -0.05974213778972626, 0.28060585260391235, 0.17075057327747345, -0.13414418697357178, -0.07644034922122955, -0.24748116731643677, 0.30566567182540894, -0.06656534224748611, 0.2226821929216385, 0.08635172247886658, -0.04553864151239395, -0.05687759071588516, -0.22526873648166656, 0.13118326663970947, 0.01636163704097271, 0.012625876814126968, -0.17638233304023743, -0.16661405563354492, 0.09999198466539383, -0.001013217493891716, -0.08072219789028168, -0.016165312379598618, -0.15215787291526794, -0.011200176551938057, -0.01796279475092888, 0.07604896277189255, -0.01460535079240799, -0.11940799653530121, -0.1400480568408966, 0.2809409499168396, -0.12060108780860901, -0.1210639476776123, 0.23246072232723236, -0.23627105355262756, 0.22578051686286926, 0.059537820518016815, 0.5264185070991516, -0.024768680334091187, 0.03063800185918808, -0.1317235678434372, 0.15129616856575012, -0.34175971150398254, -0.05293168127536774, 0.25683096051216125, -0.3094082772731781, -0.06632181257009506, 0.09374935925006866, 0.23149418830871582, 0.41054677963256836, -0.12172404676675797, -0.08593331277370453, 0.2554229199886322, 0.13186591863632202, -0.3775715231895447, -0.17314814031124115, 0.04951814189553261, -0.10026286542415619, -0.025594010949134827, 0.059920601546764374, 0.3110899329185486, -0.18170717358589172, 0.09042950719594955, 0.34185144305229187, 0.2442220151424408, 0.26974204182624817, -0.0024246424436569214, 0.44836151599884033, 0.012056268751621246, -0.20428091287612915, 0.4182865619659424, 0.1756482720375061, 0.31129884719848633, 0.26551252603530884, -0.21094004809856415, 0.16680176556110382, 0.049634188413619995, -0.19737444818019867, 0.09603322297334671, -0.42627519369125366, -0.19237294793128967, -0.0999845340847969, 0.31498318910598755, -0.061651088297367096, 0.46200695633888245, 0.45272618532180786, 0.27119389176368713, -0.07099601626396179, 0.02905261516571045, 0.3461710214614868, -0.00007067294791340828, 0.0676976889371872, -0.07238531112670898, -0.2340080291032791, -0.2650998830795288, -0.014262579381465912, -0.2551712691783905, -0.24806059896945953, 0.30818596482276917, 0.2364887148141861, -0.3372643291950226, -0.7492637038230896, 0.3052001893520355, 0.1087694764137268, 0.12708932161331177, -0.2866680324077606, 0.35383695363998413, 0.24741961061954498, -0.1135721281170845, -0.10147155821323395, 0.30838122963905334, 0.8915085792541504, 0.31771764159202576, -0.02600981295108795, 0.0024152323603630066, -0.004144560545682907, -0.15640640258789062, 0.04656856507062912, -0.1994176208972931, -0.19490215182304382, 0.4521815776824951, 0.2232360988855362, 0.17558464407920837, -0.14350566267967224, -0.19015607237815857, 0.08037736266851425, -0.002545885741710663, -0.268173485994339, 0.13124673068523407, -0.1365811973810196, -0.20019450783729553, 0.0013935090973973274, -0.0007405504584312439, -0.42817452549934387, -0.00899314135313034, 0.4281740188598633, 0.13380154967308044, 0.11360006779432297, -0.12113121151924133, 0.04415826499462128, 0.045718587934970856, 0.44777101278305054, 0.6064440011978149, 0.13685736060142517, -0.1345338374376297, -0.08647548407316208, -0.42366355657577515, 0.275939404964447, -0.332254558801651, -0.044852398335933685, 0.12691543996334076, 0.20620226860046387, 0.0542919784784317, 0.07830438017845154, 0.27757400274276733, 0.420621782541275, -0.17724910378456116, -0.05108058452606201, -0.332472562789917, -0.10067255795001984, 0.046692438423633575, -0.22204174101352692, -0.12957659363746643, -0.24664458632469177, 0.3911384344100952, -0.2919163107872009, 0.06642098724842072, -0.3800824284553528, -0.14073927700519562, 0.25868332386016846, -0.08691835403442383, 0.45785221457481384, 0.0009060781449079514, 0.41875797510147095, 0.03265461325645447, -0.17067331075668335, -0.3290652632713318, -0.3339603543281555, -0.28833654522895813, 0.3402409255504608, -0.05063445493578911, 0.4427412152290344, -0.18638867139816284, -0.3720743954181671, -0.10302574187517166, 0.2508411407470703, -0.09061776846647263, 0.15800976753234863, 0.19902543723583221, 0.03442266583442688, 0.0075860098004341125, 0.01790967583656311, -0.08486709743738174, -0.08275871723890305, 0.09513992816209793, 0.16722926497459412, -0.2761419415473938, -0.6448034048080444, 0.241926908493042, -0.2260374277830124, -0.20503024756908417, 0.04457248002290726, 0.05650459975004196, 0.17781129479408264, 0.026200050488114357, -0.4378465712070465, 0.234495609998703, 0.40572476387023926, -0.15454722940921783, -0.12775224447250366, 0.18590374290943146, 0.10264274477958679, 0.14742787182331085, -0.025282561779022217, 0.3295576870441437, -0.06774131953716278, -0.28767818212509155, -0.11397577822208405, -0.18642500042915344 ]
https://github.com/huggingface/datasets/issues/5923
Hi, if this helps anyone, pip install pyarrow==11.0.0 did not work for me (I'm using Colab) but this worked: !pip install --extra-index-url=https://pypi.nvidia.com cudf-cu11
Cannot import datasets - ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility
### Describe the bug When trying to import datasets, I get a pyarrow ValueError: Traceback (most recent call last): File "/Users/edward/test/test.py", line 1, in <module> import datasets File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module> from .arrow_dataset import Dataset File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 65, in <module> from .arrow_reader import ArrowReader File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_reader.py", line 28, in <module> import pyarrow.parquet as pq File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/__init__.py", line 20, in <module> from .core import * File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/core.py", line 45, in <module> from pyarrow.fs import (LocalFileSystem, FileSystem, FileType, File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/fs.py", line 49, in <module> from pyarrow._gcsfs import GcsFileSystem # noqa File "pyarrow/_gcsfs.pyx", line 1, in init pyarrow._gcsfs ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject ### Steps to reproduce the bug `import datasets` ### Expected behavior Successful import ### Environment info Conda environment, MacOS python 3.9.12 datasets 2.12.0
23
Cannot import datasets - ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility ### Describe the bug When trying to import datasets, I get a pyarrow ValueError: Traceback (most recent call last): File "/Users/edward/test/test.py", line 1, in <module> import datasets File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/__init__.py", line 43, in <module> from .arrow_dataset import Dataset File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 65, in <module> from .arrow_reader import ArrowReader File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/datasets/arrow_reader.py", line 28, in <module> import pyarrow.parquet as pq File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/__init__.py", line 20, in <module> from .core import * File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/parquet/core.py", line 45, in <module> from pyarrow.fs import (LocalFileSystem, FileSystem, FileType, File "/Users/edward/opt/anaconda3/envs/cs235/lib/python3.9/site-packages/pyarrow/fs.py", line 49, in <module> from pyarrow._gcsfs import GcsFileSystem # noqa File "pyarrow/_gcsfs.pyx", line 1, in init pyarrow._gcsfs ValueError: pyarrow.lib.IpcWriteOptions size changed, may indicate binary incompatibility. Expected 88 from C header, got 72 from PyObject ### Steps to reproduce the bug `import datasets` ### Expected behavior Successful import ### Environment info Conda environment, MacOS python 3.9.12 datasets 2.12.0 Hi, if this helps anyone, pip install pyarrow==11.0.0 did not work for me (I'm using Colab) but this worked: !pip install --extra-index-url=https://pypi.nvidia.com cudf-cu11
[ -0.5389391183853149, 0.41014090180397034, -0.09792473912239075, 0.2319422960281372, 0.14288535714149475, -0.13102033734321594, 0.21223437786102295, 0.2684710919857025, -0.408712774515152, 0.09050598740577698, -0.20407867431640625, 0.27507221698760986, -0.12025684118270874, 0.1409701108932495, -0.16671998798847198, 0.01760251820087433, 0.05824655294418335, 0.2816929221153259, -0.1661183387041092, 0.113141730427742, -0.10728545486927032, 0.16610445082187653, -0.21358206868171692, 0.11508075147867203, 0.011453785002231598, -0.10817255824804306, -0.14227774739265442, 0.24949845671653748, -0.43753454089164734, -0.7070934176445007, 0.3522906005382538, -0.086106076836586, 0.07033614069223404, 0.4895254969596863, -0.00011616970732575282, 0.18690964579582214, 0.2657691538333893, 0.06419306993484497, -0.253903865814209, -0.07424189150333405, 0.06377491354942322, -0.2764390707015991, 0.26972654461860657, -0.11235450953245163, 0.3193272650241852, -0.5484874248504639, 0.06671421974897385, 0.16740885376930237, 0.054839521646499634, 0.40047457814216614, 0.19530938565731049, 0.38214990496635437, 0.6554259061813354, 0.1227761059999466, 0.5305083990097046, 0.04909924045205116, 0.03578562289476395, 0.5898970365524292, 0.2579425871372223, 0.05691107362508774, 0.0021759532392024994, -0.20591427385807037, -0.1010093167424202, -0.048358254134655, 0.15855109691619873, -0.18132737278938293, -0.03536137938499451, -0.18852782249450684, -0.06856274604797363, -0.08543333411216736, 0.4250427186489105, -0.5830304026603699, -0.302016019821167, -0.09135070443153381, 0.10421205312013626, -0.45955967903137207, 0.28538691997528076, 0.21514496207237244, 0.1239168643951416, 0.22662369906902313, -0.08318190276622772, -0.12021125853061676, -0.3959175944328308, 0.18164576590061188, -0.32514679431915283, 0.24191302061080933, 0.029269661754369736, 0.19708991050720215, 0.00875172670930624, -0.18387901782989502, 0.42467594146728516, -0.02596220001578331, -0.23255464434623718, 0.08952406048774719, -0.22075620293617249, 0.081318199634552, 0.020974012091755867, 0.13495442271232605, -0.04143968224525452, 0.02640334889292717, -0.058164432644844055, -0.15183407068252563, -0.033698271960020065, 0.33083441853523254, 0.024396397173404694, 0.05486329272389412, -0.12570367753505707, 0.2684255838394165, 0.1664728820323944, 0.1868094801902771, -0.005677856504917145, -0.02999785915017128, -0.04185599088668823, -0.3846703767776489, 0.08216149359941483, 0.0356256403028965, 0.4344305098056793, -0.1588757187128067, -0.29218998551368713, -0.012626070529222488, -0.25384315848350525, 0.026433870196342468, -0.17737063765525818, 0.2993183434009552, -0.01885107159614563, 0.2504885196685791, 0.1386951059103012, 0.2536332607269287, -0.11470460891723633, -0.23161382973194122, -0.05686569958925247, 0.10283129662275314, -0.0738179013133049, -0.22125279903411865, 0.08629242330789566, -0.1755020022392273, 0.13045690953731537, 0.12832950055599213, 0.1933923065662384, 0.12288786470890045, -0.06554929167032242, -0.24240773916244507, -0.04746447876095772, 0.31247541308403015, -0.03729112073779106, 0.10041829198598862, 0.015014491975307465, -0.30412307381629944, -0.21219328045845032, 0.14690840244293213, -0.3801676332950592, -0.11307426542043686, -0.38429704308509827, 0.17333675920963287, -0.00567549467086792, -0.05924506485462189, -0.19764062762260437, -0.09340038895606995, 0.1950654685497284, -0.4064936637878418, -0.0562329925596714, -0.48926854133605957, 0.16215912997722626, -0.4678736925125122, -0.015019897371530533, 0.15141348540782928, -0.7889991998672485, 0.07376639544963837, 0.04906328022480011, 0.004440071061253548, 0.1919279396533966, 0.3100696802139282, -0.2902900278568268, -0.12284907698631287, -0.0004233941435813904, 0.1427394151687622, 0.2366839200258255, -0.21537001430988312, -0.6268244385719299, 0.0864512026309967, 0.03838047385215759, -0.24220477044582367, 0.1674947738647461, -0.17949894070625305, 0.19456103444099426, 0.09760883450508118, -0.10673335194587708, 0.1721334308385849, -0.07684064656496048, 0.04093795269727707, -0.19862762093544006, -0.5216740369796753, 0.2674814760684967, -0.03322679176926613, 0.10352544486522675, -0.39543211460113525, 0.35555097460746765, -0.3969314396381378, 0.29034629464149475, -0.1645258665084839, 0.057519592344760895, 0.33262306451797485, 0.3348727524280548, -0.11456172168254852, 0.021700289100408554, -0.2176801711320877, -0.2977602779865265, 0.1422601044178009, -0.381434828042984, -0.11011587828397751, -0.3259420096874237, -0.1059422641992569, -0.3133503198623657, 0.26993176341056824, 0.05359809473156929, -0.006133888382464647, 0.05970541015267372, 0.057409174740314484, -0.016452211886644363, 0.10308235138654709, -0.03366893529891968, 0.07832518219947815, -0.0958491861820221, 0.19671405851840973, -0.24218088388442993, 0.5291696190834045, -0.3428577184677124, -0.4746672213077545, 0.19328927993774414, -0.0023095812648534775, 0.0374557301402092, -0.06310087442398071, -0.14555492997169495, 0.4702662229537964, -0.028681166470050812, 0.3286389708518982, -0.1707378774881363, 0.084703728556633, 0.21563316881656647, -0.229253888130188, 0.32963529229164124, -0.028982695192098618, 0.08914411067962646, 0.20938627421855927, 0.13785672187805176, 0.16456446051597595, 0.16380859911441803, 0.09281909465789795, 0.12126252800226212, -0.22491805255413055, -0.030612699687480927, 0.13591116666793823, 0.1629302054643631, -0.009373307228088379, 0.04221060499548912, 0.1983906328678131, 0.12568755447864532, 0.1722821295261383, -0.2852168679237366, 0.08072225749492645, 0.42531582713127136, 0.0626024603843689, -0.008041251450777054, 0.1384713351726532, -0.2746993601322174, 0.050757043063640594, 0.36250460147857666, -0.14058038592338562, 0.29622507095336914, 0.3149271309375763, -0.1703774780035019, -0.029386475682258606, -0.0971117913722992, -0.052491623908281326, 0.18679046630859375, 0.13654297590255737, 0.2397942692041397, 0.07676659524440765, 0.623730480670929, 0.04727469012141228, -0.2200196385383606, -0.13672858476638794, 0.04518246650695801, 0.27634674310684204, -0.452684223651886, 0.308177649974823, -0.4269106388092041, -0.0024414435029029846, -0.23781991004943848, -0.154685840010643, -0.3824634552001953, -0.27317434549331665, -0.2290082722902298, 0.3882075548171997, 0.031330808997154236, 0.08750251680612564, -0.023035410791635513, -0.1944246143102646, 0.18350647389888763, -0.17203259468078613, 0.06762979924678802, -0.11229591071605682, -0.3621595501899719, 0.0946991890668869, 0.342587411403656, 0.12063385546207428, 0.19353339076042175, 0.03205987066030502, 0.03860313445329666, -0.05090917646884918, -0.47778546810150146, -0.1438167691230774, -0.025089098140597343, 0.19900289177894592, 0.1817106157541275, 0.11551493406295776, -0.07299236208200455, -0.46838411688804626, 0.057287078350782394, 0.08416453748941422, -0.3447721004486084, 0.1372157782316208, -0.34398332238197327, -0.1998528391122818, -0.0028321966528892517, -0.276289165019989, -0.4295882284641266, -0.3780532479286194, 0.1362106204032898, 0.3020915985107422, 0.23640713095664978, 0.3542707860469818, 0.3423806130886078, 0.01274484395980835, -0.0786948874592781, -0.10726942867040634, 0.23830220103263855, 0.028377175331115723, 0.28393781185150146, -0.07516976445913315, -0.257251501083374, -0.07669791579246521, -0.037464335560798645, 0.08720491826534271, 0.294569194316864, -0.4791855216026306, -0.014134753495454788, -0.3582625985145569, 0.5260703563690186, -0.08312098681926727, 0.14493517577648163, 0.22535274922847748, 0.15895995497703552, -0.004194937646389008, 0.003344491124153137, -0.1563226580619812, -0.26622116565704346, 0.2833780348300934, 0.07547761499881744, 0.055676694959402084, 0.3319579064846039, -0.19856581091880798, 0.6400830745697021, 0.023299410939216614, -0.2738661468029022, 0.4377114176750183, -0.2375326156616211, 0.45192140340805054, -0.10431645810604095, -0.3032712936401367, 0.06629733741283417, -0.10827210545539856, -0.07401157915592194, 0.044195711612701416, -0.22602307796478271, -0.3297971487045288, 0.12052588909864426, -0.18412691354751587, -0.23381878435611725, -0.14523108303546906, 0.09087691456079483, 0.14159071445465088, 0.3312854468822479, -0.08640037477016449, -0.2960985600948334, -0.2364920675754547, -0.21792711317539215, 0.025277383625507355, -0.08264269679784775, -0.22591671347618103, 0.038069967180490494, -0.035965826362371445, -0.13339830935001373, -0.34121182560920715, 0.30971473455429077, 0.17489559948444366, 0.2464342564344406, 0.1721387505531311, -0.0410853810608387, 0.11113014817237854, -0.21800363063812256, 0.32807719707489014, 0.09706304222345352, -0.182765394449234, 0.27574849128723145, 0.40072202682495117, -0.496793270111084, -0.23470546305179596, -0.19102361798286438, 0.27748310565948486, 0.24770592153072357, 0.18386921286582947, -0.3402397632598877, 0.15343794226646423, 0.16168956458568573, 0.5132279396057129, -0.044120822101831436, 0.16416697204113007, -0.27002739906311035, -0.10140333324670792, -0.4776964485645294, -0.10504379123449326, -0.01761382445693016, 0.33137673139572144, 0.005467850714921951, 0.06343299150466919, -0.14889757335186005, -0.24708475172519684, 0.0832427591085434, 0.28902047872543335, 0.3243051767349243, -0.07903829216957092, 0.11278222501277924, -0.31734713912010193, 0.0913165807723999, 0.5340574979782104, 0.7704090476036072, 0.20883658528327942, -0.34903720021247864, -0.016412770375609398, 0.05045154318213463, 0.32675692439079285, 0.11366061866283417, -0.19308175146579742, 0.18378815054893494, -0.11625105142593384, 0.10890750586986542, 0.12137383967638016, 0.04006081819534302, 0.24377843737602234, -0.07671591639518738, -0.2914526164531708, 0.08982376009225845, 0.41707974672317505, -0.03200620412826538, -0.013796605169773102, 0.18926988542079926, 0.4060444235801697, -0.1646333634853363, 0.3946790099143982, 0.03605928644537926, 0.8309652805328369, -0.04272161424160004, 0.0664454996585846, 0.5179725289344788, -0.40474075078964233, 0.16809165477752686, -0.02481294423341751, -0.0014977939426898956, -0.5320702791213989, 0.02998863160610199, 0.010089166462421417, -0.32545042037963867, 0.378400057554245, -0.024959616363048553, -0.2201615273952484, 0.13777568936347961, -0.01617369055747986, 0.21605737507343292, 0.007065225392580032, 0.16433557868003845, -0.0762438178062439, 0.12335334718227386, -0.3094923794269562, 0.09066323190927505, -0.1320367455482483, -0.20527583360671997, -0.05608992651104927, -0.08132266998291016, -0.27471923828125, -0.2721797823905945, -0.2812002897262573, -0.04469974339008331, -0.4894630014896393, 0.2627429664134979, 0.32856354117393494, -0.33071666955947876, 0.3076707124710083, 0.16620312631130219, -0.04406396299600601, 0.13957718014717102, -0.0796767994761467, 0.097402423620224, -0.013216350227594376, -0.056625720113515854, 0.12572379410266876, 0.13607007265090942, 0.10124372690916061, -0.051036760210990906, -0.24735097587108612, 0.3664361834526062, 0.06387249380350113, -0.17888739705085754, 0.14817728102207184, 0.12165239453315735, 0.2961480915546417, -0.3896706700325012, -0.059169575572013855, -0.42517295479774475, 0.09698713570833206, -0.15345673263072968, 0.05929594486951828, -0.1271677315235138, 0.26862481236457825, 0.20056328177452087, 0.013806306757032871, -0.1889253556728363, -0.2841084599494934, 0.4088476896286011, 0.03163333982229233, 0.268120139837265, 0.5743934512138367, 0.2638583779335022, -0.18598122894763947, -0.036853402853012085, 0.12482032179832458, 0.1295132040977478, -0.489487886428833, -0.0472915843129158, -0.09893018007278442, 0.1132626086473465, 0.06401893496513367, 0.03400582820177078, 0.283963680267334, 0.2301625907421112, -0.06152021512389183, -0.3313921093940735, -0.2537413239479065, 0.23526616394519806, 0.0836174413561821, -0.05974213778972626, 0.28060585260391235, 0.17075057327747345, -0.13414418697357178, -0.07644034922122955, -0.24748116731643677, 0.30566567182540894, -0.06656534224748611, 0.2226821929216385, 0.08635172247886658, -0.04553864151239395, -0.05687759071588516, -0.22526873648166656, 0.13118326663970947, 0.01636163704097271, 0.012625876814126968, -0.17638233304023743, -0.16661405563354492, 0.09999198466539383, -0.001013217493891716, -0.08072219789028168, -0.016165312379598618, -0.15215787291526794, -0.011200176551938057, -0.01796279475092888, 0.07604896277189255, -0.01460535079240799, -0.11940799653530121, -0.1400480568408966, 0.2809409499168396, -0.12060108780860901, -0.1210639476776123, 0.23246072232723236, -0.23627105355262756, 0.22578051686286926, 0.059537820518016815, 0.5264185070991516, -0.024768680334091187, 0.03063800185918808, -0.1317235678434372, 0.15129616856575012, -0.34175971150398254, -0.05293168127536774, 0.25683096051216125, -0.3094082772731781, -0.06632181257009506, 0.09374935925006866, 0.23149418830871582, 0.41054677963256836, -0.12172404676675797, -0.08593331277370453, 0.2554229199886322, 0.13186591863632202, -0.3775715231895447, -0.17314814031124115, 0.04951814189553261, -0.10026286542415619, -0.025594010949134827, 0.059920601546764374, 0.3110899329185486, -0.18170717358589172, 0.09042950719594955, 0.34185144305229187, 0.2442220151424408, 0.26974204182624817, -0.0024246424436569214, 0.44836151599884033, 0.012056268751621246, -0.20428091287612915, 0.4182865619659424, 0.1756482720375061, 0.31129884719848633, 0.26551252603530884, -0.21094004809856415, 0.16680176556110382, 0.049634188413619995, -0.19737444818019867, 0.09603322297334671, -0.42627519369125366, -0.19237294793128967, -0.0999845340847969, 0.31498318910598755, -0.061651088297367096, 0.46200695633888245, 0.45272618532180786, 0.27119389176368713, -0.07099601626396179, 0.02905261516571045, 0.3461710214614868, -0.00007067294791340828, 0.0676976889371872, -0.07238531112670898, -0.2340080291032791, -0.2650998830795288, -0.014262579381465912, -0.2551712691783905, -0.24806059896945953, 0.30818596482276917, 0.2364887148141861, -0.3372643291950226, -0.7492637038230896, 0.3052001893520355, 0.1087694764137268, 0.12708932161331177, -0.2866680324077606, 0.35383695363998413, 0.24741961061954498, -0.1135721281170845, -0.10147155821323395, 0.30838122963905334, 0.8915085792541504, 0.31771764159202576, -0.02600981295108795, 0.0024152323603630066, -0.004144560545682907, -0.15640640258789062, 0.04656856507062912, -0.1994176208972931, -0.19490215182304382, 0.4521815776824951, 0.2232360988855362, 0.17558464407920837, -0.14350566267967224, -0.19015607237815857, 0.08037736266851425, -0.002545885741710663, -0.268173485994339, 0.13124673068523407, -0.1365811973810196, -0.20019450783729553, 0.0013935090973973274, -0.0007405504584312439, -0.42817452549934387, -0.00899314135313034, 0.4281740188598633, 0.13380154967308044, 0.11360006779432297, -0.12113121151924133, 0.04415826499462128, 0.045718587934970856, 0.44777101278305054, 0.6064440011978149, 0.13685736060142517, -0.1345338374376297, -0.08647548407316208, -0.42366355657577515, 0.275939404964447, -0.332254558801651, -0.044852398335933685, 0.12691543996334076, 0.20620226860046387, 0.0542919784784317, 0.07830438017845154, 0.27757400274276733, 0.420621782541275, -0.17724910378456116, -0.05108058452606201, -0.332472562789917, -0.10067255795001984, 0.046692438423633575, -0.22204174101352692, -0.12957659363746643, -0.24664458632469177, 0.3911384344100952, -0.2919163107872009, 0.06642098724842072, -0.3800824284553528, -0.14073927700519562, 0.25868332386016846, -0.08691835403442383, 0.45785221457481384, 0.0009060781449079514, 0.41875797510147095, 0.03265461325645447, -0.17067331075668335, -0.3290652632713318, -0.3339603543281555, -0.28833654522895813, 0.3402409255504608, -0.05063445493578911, 0.4427412152290344, -0.18638867139816284, -0.3720743954181671, -0.10302574187517166, 0.2508411407470703, -0.09061776846647263, 0.15800976753234863, 0.19902543723583221, 0.03442266583442688, 0.0075860098004341125, 0.01790967583656311, -0.08486709743738174, -0.08275871723890305, 0.09513992816209793, 0.16722926497459412, -0.2761419415473938, -0.6448034048080444, 0.241926908493042, -0.2260374277830124, -0.20503024756908417, 0.04457248002290726, 0.05650459975004196, 0.17781129479408264, 0.026200050488114357, -0.4378465712070465, 0.234495609998703, 0.40572476387023926, -0.15454722940921783, -0.12775224447250366, 0.18590374290943146, 0.10264274477958679, 0.14742787182331085, -0.025282561779022217, 0.3295576870441437, -0.06774131953716278, -0.28767818212509155, -0.11397577822208405, -0.18642500042915344 ]
https://github.com/huggingface/datasets/issues/5922
As already replied by @lhoestq (private channel): > `.train_test_split` (as well as `.shard`, `.select`) doesn't create a new arrow table to save time and disk space. Instead, it uses an indices mapping on top of the table that locate which examples are part of train or test.
Length of table does not accurately reflect the split
### Describe the bug I load a Huggingface Dataset and do `train_test_split`. I'm expecting the underlying table for the dataset to also be split, but it's not. ### Steps to reproduce the bug ![image](https://github.com/huggingface/datasets/assets/8068268/83e5768f-8b4c-422a-945c-832a7585afff) ### Expected behavior The expected behavior is when `len(hf_dataset["train"].data)` should match the length of the train split, and not be the entire unsplit dataset. ### Environment info datasets 2.10.1 python 3.10.11
47
Length of table does not accurately reflect the split ### Describe the bug I load a Huggingface Dataset and do `train_test_split`. I'm expecting the underlying table for the dataset to also be split, but it's not. ### Steps to reproduce the bug ![image](https://github.com/huggingface/datasets/assets/8068268/83e5768f-8b4c-422a-945c-832a7585afff) ### Expected behavior The expected behavior is when `len(hf_dataset["train"].data)` should match the length of the train split, and not be the entire unsplit dataset. ### Environment info datasets 2.10.1 python 3.10.11 As already replied by @lhoestq (private channel): > `.train_test_split` (as well as `.shard`, `.select`) doesn't create a new arrow table to save time and disk space. Instead, it uses an indices mapping on top of the table that locate which examples are part of train or test.
[ -0.21446944773197174, -0.5159009695053101, 0.016105465590953827, 0.4708857834339142, -0.03249255567789078, 0.1338270753622055, 0.3050536513328552, 0.27254173159599304, -0.10356926172971725, 0.10053576529026031, 0.009945657104253769, 0.15640954673290253, 0.07740501314401627, 0.39739906787872314, 0.19836169481277466, -0.25544190406799316, 0.3000759184360504, 0.0690169632434845, -0.11418473720550537, 0.07275360077619553, -0.1563134491443634, 0.2740643620491028, -0.4757465124130249, -0.015228964388370514, -0.45987898111343384, 0.1140308529138565, -0.35241568088531494, -0.10439914464950562, -0.09206148982048035, 0.15135839581489563, 0.2891450524330139, -0.3137127161026001, -0.018534712493419647, 0.42476266622543335, -0.00012852078361902386, -0.08694995939731598, -0.06845225393772125, -0.07640423625707626, -0.05925309285521507, -0.1453692764043808, -0.19847187399864197, -0.017110485583543777, 0.19962653517723083, -0.09333944320678711, -0.2256891131401062, 0.33623290061950684, -0.3478081226348877, 0.08714260160923004, 0.15469340980052948, 0.031379617750644684, 0.11788180470466614, 0.4104878902435303, -0.1625310182571411, -0.24199070036411285, 0.3819718062877655, 0.33320242166519165, -0.21267130970954895, 0.10265293717384338, -0.33683475852012634, -0.008138485252857208, -0.17985984683036804, 0.25358933210372925, 0.3806089162826538, 0.10207771509885788, 0.14599831402301788, 0.19193169474601746, -0.41149744391441345, 0.19178801774978638, 0.23468774557113647, 0.45650675892829895, -0.061558984220027924, -0.292104572057724, -0.08564268797636032, -0.4689819812774658, 0.07818098366260529, -0.41586679220199585, 0.197675421833992, 0.20348593592643738, 0.21853208541870117, 0.22819910943508148, -0.45149651169776917, 0.15138302743434906, -0.0946565717458725, -0.09932126104831696, -0.2444409281015396, 0.036297015845775604, -0.22774232923984528, 0.27780798077583313, 0.03792550787329674, 0.09216340631246567, -0.15170276165008545, 0.013998229056596756, -0.13065072894096375, 0.07951784878969193, -0.23430480062961578, 0.04105512797832489, -0.05375984311103821, 0.3033633530139923, 0.4901053011417389, 0.2864285707473755, -0.071737140417099, -0.03141029179096222, 0.04918055608868599, -0.2334205061197281, 0.3314012885093689, 0.22105994820594788, 0.057776615023612976, 0.2835499942302704, -0.15206030011177063, 0.4811607003211975, -0.23311270773410797, -0.09491262584924698, 0.2361893653869629, -0.03912357613444328, -0.01998850703239441, -0.21566689014434814, 0.04175663739442825, -0.11460719257593155, -0.2898441255092621, 0.3328119218349457, -0.005780145525932312, -0.010149054229259491, 0.14896851778030396, 0.37828943133354187, -0.08135998994112015, -0.1345035582780838, -0.11548872292041779, 0.13040757179260254, -0.39416059851646423, -0.19316676259040833, -0.31827935576438904, -0.23247012495994568, -0.28479182720184326, 0.09207040071487427, -0.031339071691036224, -0.20212016999721527, 0.26578041911125183, -0.035249702632427216, 0.36500856280326843, -0.2917618751525879, -0.6079970598220825, -0.2592261731624603, 0.3409883677959442, 0.2181435525417328, -0.09674972295761108, -0.06125246733427048, 0.09912814199924469, -0.10199166089296341, -0.1833435744047165, 0.0795942097902298, -0.23662824928760529, -0.17266438901424408, 0.020808475092053413, 0.009310753084719181, -0.23858843743801117, 0.32693004608154297, -0.2758748531341553, 0.363844633102417, 0.31352534890174866, -0.04973582178354263, 0.24743109941482544, -0.11710304021835327, -0.2699453830718994, -0.07095632702112198, 0.4570090174674988, 0.32718557119369507, -0.00381489098072052, -0.22507737576961517, 0.23806849122047424, -0.02824259176850319, 0.33930981159210205, 0.42192602157592773, 0.21184903383255005, 0.06424833834171295, -0.303403377532959, 0.34218958020210266, -0.043450094759464264, 0.3152382969856262, -0.43130743503570557, 0.1800324022769928, -0.1818016767501831, 0.3645859360694885, -0.16651953756809235, 0.03396577760577202, 0.25285398960113525, 0.22571364045143127, 0.2906474471092224, 0.2445881962776184, -0.22483733296394348, -0.16451895236968994, -0.28338050842285156, -0.1635492444038391, 0.18382136523723602, -0.017002470791339874, 0.06693468987941742, -0.05330000817775726, 0.005376692861318588, -0.04796230420470238, 0.70824134349823, 0.32214266061782837, -0.11175873875617981, 0.11500225961208344, 0.12266015261411667, 0.1557595282793045, 0.0508694052696228, -0.4318726062774658, -0.09381656348705292, 0.01919534057378769, -0.09993050992488861, -0.1178683489561081, 0.13368192315101624, -0.33115220069885254, -0.38928869366645813, 0.30374449491500854, -0.0982372909784317, -0.07728572189807892, -0.08675561845302582, -0.2915606200695038, 0.0790761187672615, 0.15416362881660461, -0.003173351287841797, 0.08002397418022156, -0.38728320598602295, 0.34550338983535767, -0.47673431038856506, 0.31859034299850464, 0.02281949855387211, -0.0294557623565197, -0.2023852914571762, 0.41362518072128296, 0.14458662271499634, -0.00019811466336250305, -0.0570516511797905, 0.47485530376434326, 0.2508472502231598, -0.11635722219944, -0.28243154287338257, -0.16730836033821106, 0.28310713171958923, -0.21850991249084473, -0.022259879857301712, -0.24204126000404358, -0.08594334125518799, -0.10205116868019104, -0.16816678643226624, 0.31607574224472046, -0.31865960359573364, 0.37494972348213196, -0.005638644099235535, -0.12204597890377045, -0.01973467692732811, 0.07111430168151855, 0.005571641027927399, -0.30862852931022644, 0.145157128572464, -0.2106427103281021, -0.23088906705379486, -0.015244350768625736, -0.2034909874200821, 0.2316909283399582, 0.6763933897018433, -0.012486912310123444, -0.15642137825489044, 0.25419560074806213, -0.20753340423107147, -0.13537734746932983, 0.26991817355155945, 0.08935026824474335, 0.23624813556671143, 0.2174348384141922, 0.32046064734458923, 0.06530136615037918, -0.33884239196777344, -0.17915953695774078, 0.023149754852056503, 0.1315264254808426, -0.09910289943218231, 0.11595433950424194, -0.05012519657611847, -0.13367816805839539, -0.20808446407318115, 0.18368229269981384, -0.24452096223831177, 0.12595602869987488, -0.5133945941925049, 0.10672274231910706, -0.40276703238487244, -0.05456079542636871, -0.28454434871673584, -0.16996818780899048, -0.2858054041862488, -0.28913775086402893, 0.0927560105919838, -0.08234347403049469, -0.013099245727062225, 0.1860370635986328, -0.12691949307918549, -0.06893564760684967, -0.009740874171257019, 0.07855936884880066, 0.05411490797996521, 0.20550590753555298, -0.273173987865448, -0.02713102102279663, -0.024655882269144058, 0.10788597166538239, 0.20721717178821564, -0.3317858576774597, -0.0518476665019989, -0.17590555548667908, -0.5137355923652649, 0.16951151192188263, -0.23516260087490082, 0.1172177866101265, 0.23585529625415802, -0.029194902628660202, -0.3156244158744812, -0.005574561655521393, 0.37103861570358276, -0.32693302631378174, -0.07022067159414291, 0.29245585203170776, 0.017445333302021027, 0.009508911520242691, 0.06770280003547668, -0.05636179447174072, 0.05656275898218155, -0.03240973502397537, 0.7508158683776855, 0.01404525339603424, -0.035528428852558136, 0.24759116768836975, 0.2540314793586731, -0.14765727519989014, -0.1983942985534668, -0.1259375810623169, -0.34997111558914185, -0.03479154407978058, -0.05145267769694328, -0.06912686675786972, -0.16865167021751404, 0.06758122146129608, -0.017377719283103943, 0.001574561931192875, 0.10696068406105042, -0.4863283634185791, 0.1555672287940979, -0.1272909939289093, 0.1611909717321396, 0.0508393868803978, 0.18446864187717438, 0.24323400855064392, -0.3500969409942627, 0.18608400225639343, -0.10475645214319229, -0.18173053860664368, 0.24405288696289062, -0.178620845079422, 0.1933799386024475, -0.28494107723236084, 0.4934176206588745, 0.20282702147960663, 0.46029120683670044, 0.35031574964523315, 0.1372057944536209, -0.023758750408887863, -0.477909117937088, 0.30168333649635315, -0.48296448588371277, -0.014558013528585434, -0.04696515575051308, -0.10379721224308014, -0.19000157713890076, 0.2835112512111664, 0.1522505283355713, 0.29299670457839966, 0.23126628994941711, -0.2253572791814804, 0.09309574961662292, -0.38463863730430603, 0.15597328543663025, -0.032254401594400406, 0.13859732449054718, 0.23391492664813995, 0.1681990921497345, 0.15148285031318665, -0.3267448842525482, -0.11054568737745285, -0.01112140342593193, 0.09881364554166794, -0.03362790122628212, -0.2869005799293518, -0.331954687833786, -0.3523530960083008, 0.22473859786987305, 0.11272686719894409, 0.3969356417655945, 0.019827574491500854, -0.441292405128479, 0.12736940383911133, 0.21841074526309967, 0.5154029130935669, 0.2951781749725342, -0.03356648609042168, -0.16884011030197144, -0.2445865273475647, -0.5142931938171387, -0.00921284407377243, 0.055013224482536316, 0.2154838889837265, 0.1400313824415207, 0.3522374927997589, -0.251360148191452, 0.12063916027545929, 0.7887939214706421, 0.24057602882385254, -0.0879661813378334, -0.10206258296966553, -0.3415113687515259, 0.01261882483959198, 0.1565302163362503, 0.21251742541790009, 0.3677329421043396, 0.04073856770992279, -0.01826067455112934, -0.17451879382133484, -0.1562962830066681, -0.3287963271141052, 0.10143131017684937, 0.16397033631801605, 0.5188546776771545, -0.2546452283859253, 0.4638757109642029, -0.04226071015000343, 0.1971651017665863, 0.12974707782268524, 0.7009040713310242, -0.47252488136291504, -0.08635459095239639, 0.022127743810415268, -0.18222783505916595, 0.3999961018562317, 0.5383913516998291, -0.13123342394828796, 0.39555439352989197, 0.03386254981160164, 0.5705653429031372, -0.3665527105331421, -0.11297757923603058, 0.09545031189918518, 0.11643917858600616, -0.18929243087768555, -0.29467296600341797, 0.3296630382537842, -0.027810674160718918, 0.040804147720336914, 0.23190318048000336, 0.5035112500190735, -0.08191706240177155, 0.2280445396900177, -0.2724992334842682, 1.0095864534378052, 0.14383335411548615, 0.2564791142940521, 0.21882140636444092, -0.21254190802574158, 0.0023931339383125305, -0.3670435845851898, 0.055517036467790604, -0.4546175003051758, -0.4153529405593872, 0.024953626096248627, -0.060854703187942505, 0.026797987520694733, -0.02535155788064003, 0.08918112516403198, 0.3253255784511566, -0.09543554484844208, 0.3057842254638672, -0.29654061794281006, -0.11402776837348938, -0.2713322043418884, -0.049009814858436584, -0.17959532141685486, -0.03873944282531738, 0.18125733733177185, 0.028446588665246964, 0.003808978945016861, 0.23671652376651764, -0.2629346251487732, -0.43819770216941833, -0.23086027801036835, -0.045017488300800323, -0.15467579662799835, -0.024258267134428024, 0.1538427174091339, -0.3157482445240021, 0.06557601690292358, 0.0006434256210923195, -0.021180298179388046, 0.10074406862258911, 0.03644818812608719, 0.3354405462741852, -0.1847914606332779, 0.13084375858306885, 0.07535097748041153, 0.07906149327754974, 0.06442534923553467, 0.15427516400814056, -0.3007628321647644, -0.34937727451324463, -0.1299707293510437, -0.1746310591697693, -0.08302059769630432, 0.2965811789035797, 0.04106583446264267, -0.4755130410194397, -0.0782974362373352, -0.12662839889526367, 0.31479912996292114, -0.2139517366886139, 0.02594202756881714, 0.10989247262477875, -0.08055990934371948, 0.2527124583721161, 0.1828765571117401, -0.3935561180114746, -0.4359346628189087, 0.42144322395324707, -0.035981472581624985, 0.29456353187561035, 0.15353605151176453, 0.18245938420295715, -0.12302540242671967, -0.041436634957790375, 0.3492640554904938, 0.6376187801361084, -0.8064422607421875, -0.06277626007795334, -0.4120841920375824, 0.19343720376491547, -0.11296738684177399, 0.19095206260681152, 0.39387840032577515, -0.11405152082443237, -0.22151914238929749, -0.08086548000574112, -0.1835809350013733, 0.39230120182037354, 0.1416035294532776, 0.1689363569021225, 0.24974662065505981, 0.34581124782562256, 0.11965461820363998, 0.25426730513572693, -0.13278090953826904, 0.04135800153017044, 0.0029138028621673584, 0.07114237546920776, -0.24675199389457703, -0.0101911760866642, 0.3361445963382721, -0.23649288713932037, 0.01768389344215393, 0.30417534708976746, 0.09251147508621216, -0.08097120374441147, -0.14969199895858765, 0.15149809420108795, -0.1355515420436859, 0.20317673683166504, -0.33752262592315674, 0.009388506412506104, -0.22642402350902557, -0.4071255624294281, 0.08304084837436676, 0.16477417945861816, 0.3563787043094635, 0.03164217993617058, 0.4502277374267578, 0.04049567133188248, -0.04348424822092056, 0.11954241991043091, -0.08296439051628113, 0.321823388338089, -0.14049828052520752, -0.17246663570404053, -0.1785963922739029, 0.08081638813018799, -0.1411752551794052, 0.21170398592948914, 0.02907688543200493, -0.23891159892082214, 0.17255282402038574, 0.05733116716146469, 0.02873142808675766, -0.056845519691705704, 0.5487534403800964, 0.33283376693725586, 0.10598316788673401, -0.11335153132677078, 0.12337225675582886, 0.027588296681642532, -0.2956043779850006, 0.1303991675376892, 0.17223653197288513, 0.020000983029603958, 0.04784351587295532, 0.47316813468933105, 0.19582292437553406, 0.2781375050544739, -0.28326866030693054, 0.011464186012744904, 0.20811592042446136, 0.04793795943260193, 0.0072671398520469666, 0.4124520719051361, -0.12719455361366272, 0.42656150460243225, 0.272615522146225, 0.07973718643188477, 0.2938895523548126, 0.3949659764766693, 0.020341763272881508, 0.3622569739818573, -0.28686052560806274, 0.1117003932595253, 0.24292245507240295, -0.16514021158218384, -0.37874892354011536, 0.11451361328363419, 0.006279490888118744, -0.04835858941078186, 0.0010097324848175049, 0.7017371654510498, -0.1797722578048706, -0.26596781611442566, -0.2701706290245056, -0.12228570133447647, -0.07974445074796677, -0.06918437033891678, 0.1327972561120987, -0.10124912112951279, -0.3297460079193115, -0.2065439522266388, 0.10581802576780319, 0.02393544465303421, 0.25338178873062134, -0.08518107980489731, 0.12363500893115997, -0.16118678450584412, -0.1059345006942749, 0.1251641809940338, 0.19123652577400208, -0.15495961904525757, 0.1603625863790512, 0.08231111615896225, 0.0954599380493164, 0.32869499921798706, -0.12365321815013885, 0.1981278955936432, -0.24470117688179016, 0.28033220767974854, -0.21569453179836273, 0.16642358899116516, -0.03090909868478775, -0.07963278144598007, 0.29942798614501953, 0.252532422542572, 0.14348125457763672, 0.2756720185279846, 0.01645219698548317, -0.05924868583679199, 0.04507487267255783, 0.2110477238893509, 0.3253701627254486, -0.5575070381164551, 0.5249732136726379, -0.5678144097328186, -0.21225053071975708, -0.16210559010505676, -0.23936700820922852, -0.22637496888637543, 0.2602114677429199, 0.020095620304346085, -0.40240678191185, 0.06896552443504333, -0.08570902049541473, -0.02462342008948326, 0.12768471240997314, 0.12518629431724548, 0.13381092250347137, -0.02088126912713051, -0.2324422001838684, -0.3762584924697876, -0.39049673080444336, 0.01628190651535988, -0.31826168298721313, -0.10932682454586029, 0.24956324696540833, 0.3111456632614136, -0.0773378387093544, -0.1883745938539505, 0.4191959798336029, -0.15011736750602722, -0.12516549229621887, 0.24902985990047455, -0.006436653435230255, -0.20914307236671448, -0.4258222281932831, -0.063264399766922, -0.02843056619167328, -0.19450536370277405, 0.19415217638015747, 0.2304164320230484, -0.27275368571281433, -0.13586010038852692, 0.21582865715026855, 0.0735647976398468, -0.0590861551463604, 0.08168172836303711, 0.13040517270565033, 0.10372304916381836, 0.06323147565126419, 0.07471314072608948, -0.22018611431121826, -0.24865716695785522, -0.12767036259174347, 0.5747600197792053, -0.2562839686870575, 0.25848889350891113, 0.07646159827709198, -0.5496758222579956, 0.16877813637256622, 0.20785734057426453, 0.31136444211006165, 0.025333616882562637, -0.41564497351646423, 0.19470830261707306, -0.276397705078125, 0.2045324444770813, 0.4212189018726349, 0.6074342727661133, -0.12810590863227844, 0.15695205330848694, 0.1770065426826477, -0.29017308354377747, 0.29094022512435913, -0.19130869209766388, -0.10498610138893127, 0.029043644666671753, 0.09659330546855927, 0.415765643119812, -0.5158454179763794, -0.7708714604377747, -0.330843448638916, 0.30751708149909973, 0.06578738987445831, 0.23456427454948425, 0.3017424941062927, -0.1868007481098175, 0.10453452169895172, -0.0572715625166893, 0.3764173686504364, 0.06530265510082245, -0.41812261939048767, 0.41091930866241455, -0.3055681586265564 ]
https://github.com/huggingface/datasets/issues/5913
Thanks for reporting, @cjt222. What is the structure of your JSON files. Please note that it is normally simpler if the data file format is JSON-Lines instead.
I tried to load a custom dataset using the following statement: dataset = load_dataset('json', data_files=data_files). The dataset contains 50 million text-image pairs, but an error occurred.
### Describe the bug File "/home/kas/.conda/envs/diffusers/lib/python3.7/site-packages/datasets/builder.py", line 1858, in _prepare_split_single Downloading and preparing dataset json/default to /home/kas/diffusers/examples/dreambooth/cache_data/datasets/json/default-acf423d8c6ef99d0/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4... Downloading data files: 0%| | 0/1 [00:00<?, ?it/s] Downloading data files: 100%|██████████| 1/1 [00:00<00:00, 84.35it/s] Extracting data files: 0%| | 0/1 [00:00<?, ?it/s] for _, table in generator: File "/home/kas/.conda/envs/diffusers/lib/python3.7/site-packages/datasets/packaged_modules/json/json.py", line 114, in _generate_tables io.BytesIO(batch), read_options=paj.ReadOptions(block_size=block_size) File "pyarrow/_json.pyx", line 258, in pyarrow._json.read_json Extracting data files: 100%|██████████| 1/1 [00:00<00:00, 27.72it/s] Generating train split: 0 examples [00:00, ? examples/s] File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 125, in pyarrow.lib.check_status pyarrow.lib.ArrowCapacityError: array cannot contain more than 2147483646 bytes, have 2390448764 ### Steps to reproduce the bug 1、data_files = ["1.json", "2.json", "3.json"] 2、dataset = load_dataset('json', data_files=data_files) ### Expected behavior Read the dataset normally. ### Environment info - `datasets` version: 2.12.0 - Platform: Linux-4.15.0-29-generic-x86_64-with-debian-buster-sid - Python version: 3.7.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 1.3.5
27
I tried to load a custom dataset using the following statement: dataset = load_dataset('json', data_files=data_files). The dataset contains 50 million text-image pairs, but an error occurred. ### Describe the bug File "/home/kas/.conda/envs/diffusers/lib/python3.7/site-packages/datasets/builder.py", line 1858, in _prepare_split_single Downloading and preparing dataset json/default to /home/kas/diffusers/examples/dreambooth/cache_data/datasets/json/default-acf423d8c6ef99d0/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4... Downloading data files: 0%| | 0/1 [00:00<?, ?it/s] Downloading data files: 100%|██████████| 1/1 [00:00<00:00, 84.35it/s] Extracting data files: 0%| | 0/1 [00:00<?, ?it/s] for _, table in generator: File "/home/kas/.conda/envs/diffusers/lib/python3.7/site-packages/datasets/packaged_modules/json/json.py", line 114, in _generate_tables io.BytesIO(batch), read_options=paj.ReadOptions(block_size=block_size) File "pyarrow/_json.pyx", line 258, in pyarrow._json.read_json Extracting data files: 100%|██████████| 1/1 [00:00<00:00, 27.72it/s] Generating train split: 0 examples [00:00, ? examples/s] File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 125, in pyarrow.lib.check_status pyarrow.lib.ArrowCapacityError: array cannot contain more than 2147483646 bytes, have 2390448764 ### Steps to reproduce the bug 1、data_files = ["1.json", "2.json", "3.json"] 2、dataset = load_dataset('json', data_files=data_files) ### Expected behavior Read the dataset normally. ### Environment info - `datasets` version: 2.12.0 - Platform: Linux-4.15.0-29-generic-x86_64-with-debian-buster-sid - Python version: 3.7.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 1.3.5 Thanks for reporting, @cjt222. What is the structure of your JSON files. Please note that it is normally simpler if the data file format is JSON-Lines instead.
[ -0.3578908443450928, 0.19285902380943298, -0.1386357843875885, 0.29010456800460815, 0.2431730031967163, 0.024912923574447632, 0.3775229752063751, 0.46858498454093933, -0.17913463711738586, 0.09429796785116196, -0.07349081337451935, 0.28123247623443604, -0.12814085185527802, -0.01682966575026512, -0.01497919112443924, -0.05779387056827545, -0.04588991403579712, 0.26567670702934265, 0.07067783176898956, 0.0702790766954422, -0.2913780212402344, 0.09554719179868698, -0.07660958170890808, 0.16233868896961212, -0.33372098207473755, -0.13839904963970184, 0.20448628067970276, 0.3668385148048401, -0.23990578949451447, -0.5116048455238342, 0.050727978348731995, -0.003127116709947586, 0.04479555785655975, 0.3830408751964569, -0.00010420451144455001, 0.24558258056640625, 0.4240446090698242, -0.06925588101148605, -0.23421229422092438, -0.02565915137529373, -0.16238246858119965, -0.17092454433441162, 0.0772067978978157, -0.38898175954818726, 0.132954403758049, -0.34067416191101074, -0.12270113080739975, -0.03289111703634262, 0.504283607006073, 0.3937144875526428, 0.2892172932624817, 0.07243628054857254, 0.25476890802383423, -0.04581969231367111, 0.431148886680603, 0.1309669017791748, 0.1380193531513214, 0.42113086581230164, 0.1965951919555664, -0.050575874745845795, -0.2209966480731964, 0.060946784913539886, -0.10110516846179962, 0.2599702775478363, 0.1976717859506607, -0.06344766914844513, -0.04179553687572479, -0.13232803344726562, 0.025246746838092804, 0.258512943983078, 0.5058722496032715, -0.36551836133003235, -0.20401127636432648, -0.19039762020111084, -0.07418192923069, -0.24137428402900696, 0.17923766374588013, 0.402847021818161, -0.4442426562309265, 0.0990557074546814, -0.25493454933166504, 0.11361026763916016, -0.26868072152137756, 0.12339670956134796, -0.13634595274925232, -0.03224077448248863, 0.07932323217391968, 0.21788926422595978, 0.09698496758937836, -0.035523660480976105, 0.13724128901958466, 0.03974062204360962, -0.06989336013793945, 0.061467695981264114, -0.2224118858575821, 0.08206704258918762, 0.034859851002693176, -0.4194903075695038, 0.35738515853881836, 0.015234556049108505, 0.2902500033378601, -0.018565945327281952, 0.0637485533952713, 0.24794957041740417, 0.2912960350513458, 0.06657864153385162, -0.2879353165626526, -0.00745096430182457, 0.20838913321495056, 0.09026283025741577, -0.20551183819770813, 0.07292599976062775, -0.06313784420490265, -0.2859927713871002, 0.019340917468070984, -0.14419452846050262, 0.27840161323547363, -0.021623820066452026, -0.43327444791793823, 0.008886709809303284, -0.21211647987365723, -0.06676604598760605, -0.018916158005595207, 0.2599111497402191, 0.00470927357673645, -0.09491081535816193, 0.11531627178192139, 0.09501496702432632, -0.10836201161146164, -0.21228443086147308, -0.201246976852417, 0.17187394201755524, -0.15215560793876648, -0.06192735582590103, 0.21912600100040436, -0.026689033955335617, 0.2247125804424286, -0.03272302448749542, 0.08747807890176773, -0.10185934603214264, 0.14030495285987854, -0.2934405505657196, -0.14531904458999634, 0.37134629487991333, 0.05723440647125244, -0.04277101904153824, -0.01967637985944748, -0.16437217593193054, -0.10068585723638535, 0.33952781558036804, -0.23224690556526184, -0.43350839614868164, -0.22710321843624115, 0.2751520276069641, -0.16892340779304504, 0.12192724645137787, -0.22675706446170807, 0.06359286606311798, 0.28953397274017334, -0.2583797574043274, 0.01457459107041359, -0.10050755739212036, -0.06540529429912567, -0.42691391706466675, 0.09132961928844452, 0.32951879501342773, -0.6764136552810669, 0.14367374777793884, 0.14305120706558228, -0.26583731174468994, 0.06381052732467651, 0.3423274755477905, -0.3669798970222473, 0.4150932729244232, -0.33941999077796936, 0.3274261951446533, 0.260029137134552, -0.06611187011003494, -0.40268266201019287, 0.2139112651348114, -0.16562405228614807, -0.009813092648983002, 0.06543098390102386, 0.03427409008145332, 0.20140458643436432, -0.06952794641256332, 0.44544869661331177, 0.316244900226593, -0.05915304273366928, 0.09166201204061508, -0.15670418739318848, -0.2653260827064514, 0.11729839444160461, 0.2950095236301422, -0.007638935931026936, -0.07443439960479736, 0.32833075523376465, -0.006517220288515091, 0.1726778745651245, -0.12114334106445312, -0.017183499410748482, 0.2831681966781616, 0.058092713356018066, 0.0383920893073082, -0.018785014748573303, 0.09563696384429932, -0.433993399143219, 0.24510161578655243, -0.3570576310157776, 0.07303962111473083, -0.293199747800827, -0.030856721103191376, -0.28249770402908325, 0.1828048974275589, -0.2098301202058792, 0.02098570019006729, 0.283438503742218, -0.014967292547225952, 0.06537061929702759, 0.03410443663597107, -0.06770481169223785, 0.10895343124866486, -0.22252875566482544, 0.024274758994579315, -0.41247308254241943, 0.3010784089565277, -0.09910931438207626, -0.2960684299468994, 0.11832600831985474, 0.07581454515457153, -0.07420535385608673, -0.07657627761363983, -0.13127824664115906, 0.37527137994766235, -0.000586342066526413, 0.1271880567073822, -0.17689228057861328, 0.042756542563438416, -0.01290791854262352, -0.34871625900268555, 0.015356948599219322, 0.1096319705247879, 0.11781460046768188, -0.09063459187746048, -0.15001016855239868, 0.26325201988220215, -0.052058566361665726, -0.03453857824206352, 0.010510511696338654, -0.2022111713886261, 0.3962533175945282, -0.04335988312959671, 0.09525784850120544, -0.006864108145236969, 0.09428076446056366, 0.3395760655403137, 0.28865665197372437, 0.13646796345710754, -0.3329223394393921, -0.2265067994594574, 0.4806758165359497, -0.05228918045759201, 0.2157939225435257, 0.2555052638053894, -0.0353512316942215, -0.2749379575252533, -0.006258128210902214, -0.026100873947143555, 0.5216407179832458, 0.24842916429042816, -0.1536993831396103, 0.07795438170433044, -0.036673542112112045, -0.27082276344299316, 0.11963959038257599, 0.13339203596115112, 0.3648737370967865, 0.36439797282218933, 0.40143394470214844, -0.14664438366889954, -0.4192935824394226, -0.3969768285751343, 0.15800383687019348, 0.40444791316986084, -0.32471024990081787, -0.07041305303573608, -0.05743424966931343, -0.08200279623270035, -0.045646339654922485, 0.06023693457245827, -0.11779007315635681, -0.12397496402263641, 0.18225310742855072, 0.0675663948059082, -0.18085792660713196, 0.1123632863163948, -0.006437085568904877, 0.20195835828781128, 0.19764330983161926, -0.2551000714302063, -0.265143483877182, -0.14056041836738586, -0.22967390716075897, 0.13589411973953247, 0.2789999842643738, -0.028746075928211212, 0.3024143576622009, -0.1269540935754776, -0.08768878877162933, -0.02525092475116253, -0.18228477239608765, 0.12292605638504028, -0.04749847948551178, 0.18814298510551453, 0.2950989305973053, 0.22422528266906738, 0.22961920499801636, -0.21772126853466034, 0.3581632971763611, 0.04414378106594086, -0.28090596199035645, 0.33552828431129456, -0.04948285222053528, 0.07966767251491547, -0.09349925816059113, -0.3517262637615204, -0.2402293086051941, -0.4683547616004944, 0.21075177192687988, 0.1929093301296234, 0.16102001070976257, 0.19209593534469604, 0.4755591154098511, 0.10731832683086395, 0.02085895463824272, -0.02805044874548912, -0.22991563379764557, -0.30500808358192444, 0.13545800745487213, -0.12959569692611694, -0.2725335359573364, -0.049496397376060486, 0.013438202440738678, 0.13105317950248718, 0.08893211930990219, -0.6474632620811462, -0.045805029571056366, -0.11982883512973785, 0.3433516025543213, -0.2696895897388458, -0.17839273810386658, 0.140483096241951, 0.12255855649709702, -0.24673235416412354, -0.1557723879814148, -0.04784113168716431, -0.0030710026621818542, -0.06413306295871735, 0.001574937254190445, 0.10550850629806519, 0.45164456963539124, 0.03619647026062012, 0.5421335697174072, 0.08571521937847137, -0.29720109701156616, 0.5060833692550659, -0.30069875717163086, 0.27922168374061584, -0.19614829123020172, -0.11113899946212769, 0.007948238402605057, -0.09856052696704865, -0.1298503279685974, 0.09723551571369171, -0.17299401760101318, -0.19616080820560455, -0.09230013191699982, 0.028355948626995087, -0.4522526264190674, -0.10694056749343872, 0.2479168176651001, 0.02584533579647541, 0.09497757256031036, -0.12382102757692337, -0.16643035411834717, -0.10995087027549744, -0.08777200430631638, -0.09759820997714996, -0.08815832436084747, 0.012401755899190903, -0.07973235845565796, -0.2511928081512451, 0.0034955106675624847, -0.3506455421447754, 0.2786857485771179, 0.09090617299079895, 0.3063039779663086, -0.08561713993549347, 0.15156826376914978, 0.11990508437156677, -0.23459108173847198, 0.7631166577339172, -0.20472361147403717, 0.15949833393096924, 0.1838977038860321, 0.29295748472213745, -0.3754836618900299, -0.030796904116868973, -0.18913978338241577, 0.23858574032783508, 0.08727981895208359, 0.3624132573604584, -0.3564128279685974, -0.07227663695812225, 0.275957316160202, 0.2992430031299591, -0.1553424894809723, -0.3317432999610901, -0.3115536570549011, -0.5339493155479431, -0.44577816128730774, -0.0972825139760971, 0.19796356558799744, 0.37073343992233276, 0.00417608767747879, -0.17531833052635193, 0.01660211570560932, -0.12468740344047546, -0.08396803587675095, 0.08112277090549469, 0.1804751306772232, -0.04114760085940361, 0.08385354280471802, -0.10350814461708069, -0.05492667853832245, 0.4110249876976013, 0.700351357460022, 0.16356542706489563, -0.2351306825876236, -0.058992672711610794, 0.034400347620248795, 0.06571265310049057, 0.21899420022964478, -0.22450965642929077, -0.09155754745006561, -0.1370859295129776, 0.20461294054985046, 0.04939065873622894, 0.05501113459467888, 0.35579556226730347, -0.2994573712348938, -0.2172352820634842, -0.26959437131881714, 0.48853379487991333, -0.018667548894882202, 0.1145058274269104, 0.04243136942386627, -0.22307631373405457, -0.23456668853759766, 0.16845184564590454, 0.20967639982700348, 0.8091542720794678, -0.11276352405548096, 0.19486857950687408, 0.461651086807251, -0.08890237659215927, 0.2720872163772583, -0.4591972231864929, 0.0639769658446312, -0.33349376916885376, 0.0490606464445591, -0.014916185289621353, -0.1927485316991806, 0.06223737448453903, 0.3285601735115051, 0.0413699746131897, 0.024021439254283905, -0.0050254687666893005, 0.07651552557945251, 0.14037102460861206, 0.2747774124145508, -0.09877724200487137, -0.11620979011058807, -0.2727566957473755, 0.15690937638282776, -0.14551778137683868, -0.15719489753246307, -0.14691013097763062, -0.15825572609901428, -0.024559341371059418, -0.3626418113708496, -0.19956763088703156, 0.13046303391456604, -0.3169150650501251, 0.30426308512687683, 0.04510737210512161, -0.22215992212295532, -0.09585125744342804, 0.26185378432273865, -0.19375233352184296, 0.043388381600379944, -0.07905659079551697, 0.18431270122528076, -0.10024015605449677, 0.004642527550458908, -0.03711928427219391, 0.074742391705513, 0.2804505527019501, -0.09569340199232101, -0.20310327410697937, 0.16463911533355713, -0.23142655193805695, -0.22936272621154785, -0.09712652117013931, 0.18901944160461426, 0.009030048735439777, -0.353530615568161, -0.20553472638130188, -0.28472480177879333, -0.1369217187166214, -0.19411659240722656, 0.16183874011039734, 0.16098639369010925, -0.11948885023593903, 0.29463744163513184, -0.20376448333263397, -0.29599258303642273, -0.07780612260103226, 0.3639046251773834, 0.12584343552589417, 0.04254881292581558, 0.4534183442592621, 0.21552029252052307, 0.002357862889766693, -0.23207969963550568, 0.18809208273887634, 0.3440285921096802, -0.7698429226875305, 0.33411380648612976, -0.003282703459262848, 0.1553005576133728, -0.06890728324651718, 0.35790741443634033, 0.08528821915388107, 0.10963185131549835, 0.20688997209072113, -0.5175844430923462, -0.2955719232559204, 0.3132198750972748, 0.11796073615550995, 0.2070220410823822, 0.24717211723327637, 0.10285328328609467, 0.05102776736021042, 0.017463335767388344, -0.38343143463134766, 0.3112364709377289, -0.3353186249732971, 0.12067227065563202, -0.1983056515455246, 0.051861777901649475, 0.06398823857307434, 0.11398953199386597, 0.23930345475673676, 0.2746913433074951, -0.22560736536979675, -0.31435856223106384, -0.021089911460876465, 0.10021714866161346, 0.06665980815887451, -0.09400883316993713, -0.01207428053021431, -0.13740947842597961, -0.21668735146522522, 0.08005353063344955, 0.1545090675354004, 0.017362944781780243, -0.18251287937164307, -0.08052241802215576, 0.02914898842573166, 0.03646283969283104, -0.05387261509895325, 0.023442260921001434, -0.27187034487724304, 0.25848230719566345, 0.10284122824668884, 0.24806390702724457, -0.003850869834423065, -0.10252197831869125, -0.2619849741458893, 0.0691002681851387, 0.13261911273002625, 0.06539566814899445, 0.2115517556667328, -0.5112095475196838, -0.01279689371585846, -0.1619199514389038, 0.46832799911499023, 0.2703635096549988, -0.49125003814697266, -0.020925365388393402, 0.16694769263267517, 0.2620704770088196, -0.38655853271484375, -0.17357993125915527, 0.17673245072364807, -0.0998711809515953, 0.05737036466598511, 0.12523724138736725, 0.24593126773834229, -0.05357544124126434, -0.30315420031547546, 0.009473178535699844, 0.43733975291252136, 0.14644503593444824, -0.21780771017074585, 0.5187718868255615, -0.2296142280101776, -0.0227852463722229, 0.19239482283592224, 0.38657504320144653, 0.37595313787460327, 0.699701726436615, -0.11056831479072571, 0.327949196100235, -0.05339372158050537, -0.08075544238090515, -0.09252774715423584, -0.4602092504501343, 0.24420586228370667, 0.32111215591430664, 0.1080932468175888, 0.17060211300849915, -0.03495866432785988, 0.21593739092350006, 0.14474287629127502, 0.18927109241485596, -0.12426292896270752, 0.10028641670942307, -0.07809905707836151, 0.04279392212629318, -0.3285979628562927, -0.2888490855693817, -0.16635817289352417, 0.05447874963283539, -0.10948516428470612, -0.16127076745033264, 0.07636979967355728, 0.06851091980934143, -0.22319918870925903, -0.3746832013130188, 0.33181118965148926, 0.0747479796409607, -0.20854786038398743, -0.3974487781524658, 0.27632176876068115, 0.4101978540420532, -0.0796956941485405, 0.28040769696235657, 0.25708457827568054, 0.645484983921051, 0.37863466143608093, -0.0035246647894382477, -0.004191629588603973, -0.19017434120178223, -0.10517346113920212, -0.2429128736257553, 0.17012716829776764, 0.3436467945575714, 0.0596194863319397, 0.32719919085502625, 0.2530101537704468, -0.2310689240694046, 0.10949727892875671, 0.38889777660369873, 0.14291532337665558, -0.18016253411769867, -0.10664448142051697, -0.3112768828868866, -0.34211432933807373, -0.1359649896621704, -0.010673150420188904, -0.392710417509079, -0.1695876121520996, 0.2617182433605194, 0.05474846437573433, 0.11000557988882065, -0.023406008258461952, 0.14043277502059937, -0.25622937083244324, 0.6384507417678833, 0.19700336456298828, 0.21917715668678284, -0.23608703911304474, -0.13181950151920319, -0.589812695980072, 0.23416604101657867, -0.3419809639453888, -0.1621769666671753, 0.21022218465805054, 0.27414169907569885, 0.03149504214525223, 0.20123808085918427, 0.09350907802581787, 0.24981775879859924, -0.14433345198631287, 0.34040117263793945, -0.33266955614089966, -0.17538805305957794, 0.1568000465631485, 0.06669746339321136, -0.07610885798931122, -0.40546315908432007, 0.17092660069465637, -0.2880582809448242, 0.1973203867673874, -0.32460734248161316, -0.03015933930873871, 0.1884239912033081, -0.014190344139933586, 0.5868884921073914, 0.0013297498226165771, 0.4296158254146576, -0.20196779072284698, 0.005742862820625305, -0.13582772016525269, -0.21001777052879333, -0.19427728652954102, 0.3111945390701294, 0.23629817366600037, 0.46031898260116577, -0.06585560739040375, 0.04176483675837517, -0.20639057457447052, 0.0928422063589096, -0.1850060671567917, 0.09798341989517212, -0.15462656319141388, 0.10221457481384277, -0.04347582161426544, 0.13484635949134827, -0.005079541355371475, 0.046277858316898346, 0.023143455386161804, 0.06794319301843643, -0.32200518250465393, -0.5157651901245117, 0.5123614072799683, -0.39519184827804565, -0.3903753459453583, 0.1773144006729126, 0.034869030117988586, -0.06347410380840302, 0.06177211552858353, -0.29043012857437134, 0.32975345849990845, 0.4584996998310089, 0.079774871468544, -0.3218410611152649, 0.20146474242210388, -0.10115266591310501, -0.04736403003334999, 0.026560090482234955, -0.05380062013864517, 0.03261341154575348, -0.18521080911159515, -0.02525535225868225, -0.26382648944854736 ]
https://github.com/huggingface/datasets/issues/5913
> Thanks for reporting, @cjt222. > > What is the structure of your JSON files. Please note that it is normally simpler if the data file format is JSON-Lines instead. Thanks! I have encountered similar problems. I modify the json format from list to line and works!
I tried to load a custom dataset using the following statement: dataset = load_dataset('json', data_files=data_files). The dataset contains 50 million text-image pairs, but an error occurred.
### Describe the bug File "/home/kas/.conda/envs/diffusers/lib/python3.7/site-packages/datasets/builder.py", line 1858, in _prepare_split_single Downloading and preparing dataset json/default to /home/kas/diffusers/examples/dreambooth/cache_data/datasets/json/default-acf423d8c6ef99d0/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4... Downloading data files: 0%| | 0/1 [00:00<?, ?it/s] Downloading data files: 100%|██████████| 1/1 [00:00<00:00, 84.35it/s] Extracting data files: 0%| | 0/1 [00:00<?, ?it/s] for _, table in generator: File "/home/kas/.conda/envs/diffusers/lib/python3.7/site-packages/datasets/packaged_modules/json/json.py", line 114, in _generate_tables io.BytesIO(batch), read_options=paj.ReadOptions(block_size=block_size) File "pyarrow/_json.pyx", line 258, in pyarrow._json.read_json Extracting data files: 100%|██████████| 1/1 [00:00<00:00, 27.72it/s] Generating train split: 0 examples [00:00, ? examples/s] File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 125, in pyarrow.lib.check_status pyarrow.lib.ArrowCapacityError: array cannot contain more than 2147483646 bytes, have 2390448764 ### Steps to reproduce the bug 1、data_files = ["1.json", "2.json", "3.json"] 2、dataset = load_dataset('json', data_files=data_files) ### Expected behavior Read the dataset normally. ### Environment info - `datasets` version: 2.12.0 - Platform: Linux-4.15.0-29-generic-x86_64-with-debian-buster-sid - Python version: 3.7.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 1.3.5
47
I tried to load a custom dataset using the following statement: dataset = load_dataset('json', data_files=data_files). The dataset contains 50 million text-image pairs, but an error occurred. ### Describe the bug File "/home/kas/.conda/envs/diffusers/lib/python3.7/site-packages/datasets/builder.py", line 1858, in _prepare_split_single Downloading and preparing dataset json/default to /home/kas/diffusers/examples/dreambooth/cache_data/datasets/json/default-acf423d8c6ef99d0/0.0.0/e347ab1c932092252e717ff3f949105a4dd28b27e842dd53157d2f72e276c2e4... Downloading data files: 0%| | 0/1 [00:00<?, ?it/s] Downloading data files: 100%|██████████| 1/1 [00:00<00:00, 84.35it/s] Extracting data files: 0%| | 0/1 [00:00<?, ?it/s] for _, table in generator: File "/home/kas/.conda/envs/diffusers/lib/python3.7/site-packages/datasets/packaged_modules/json/json.py", line 114, in _generate_tables io.BytesIO(batch), read_options=paj.ReadOptions(block_size=block_size) File "pyarrow/_json.pyx", line 258, in pyarrow._json.read_json Extracting data files: 100%|██████████| 1/1 [00:00<00:00, 27.72it/s] Generating train split: 0 examples [00:00, ? examples/s] File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 125, in pyarrow.lib.check_status pyarrow.lib.ArrowCapacityError: array cannot contain more than 2147483646 bytes, have 2390448764 ### Steps to reproduce the bug 1、data_files = ["1.json", "2.json", "3.json"] 2、dataset = load_dataset('json', data_files=data_files) ### Expected behavior Read the dataset normally. ### Environment info - `datasets` version: 2.12.0 - Platform: Linux-4.15.0-29-generic-x86_64-with-debian-buster-sid - Python version: 3.7.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 1.3.5 > Thanks for reporting, @cjt222. > > What is the structure of your JSON files. Please note that it is normally simpler if the data file format is JSON-Lines instead. Thanks! I have encountered similar problems. I modify the json format from list to line and works!
[ -0.3578908443450928, 0.19285902380943298, -0.1386357843875885, 0.29010456800460815, 0.2431730031967163, 0.024912923574447632, 0.3775229752063751, 0.46858498454093933, -0.17913463711738586, 0.09429796785116196, -0.07349081337451935, 0.28123247623443604, -0.12814085185527802, -0.01682966575026512, -0.01497919112443924, -0.05779387056827545, -0.04588991403579712, 0.26567670702934265, 0.07067783176898956, 0.0702790766954422, -0.2913780212402344, 0.09554719179868698, -0.07660958170890808, 0.16233868896961212, -0.33372098207473755, -0.13839904963970184, 0.20448628067970276, 0.3668385148048401, -0.23990578949451447, -0.5116048455238342, 0.050727978348731995, -0.003127116709947586, 0.04479555785655975, 0.3830408751964569, -0.00010420451144455001, 0.24558258056640625, 0.4240446090698242, -0.06925588101148605, -0.23421229422092438, -0.02565915137529373, -0.16238246858119965, -0.17092454433441162, 0.0772067978978157, -0.38898175954818726, 0.132954403758049, -0.34067416191101074, -0.12270113080739975, -0.03289111703634262, 0.504283607006073, 0.3937144875526428, 0.2892172932624817, 0.07243628054857254, 0.25476890802383423, -0.04581969231367111, 0.431148886680603, 0.1309669017791748, 0.1380193531513214, 0.42113086581230164, 0.1965951919555664, -0.050575874745845795, -0.2209966480731964, 0.060946784913539886, -0.10110516846179962, 0.2599702775478363, 0.1976717859506607, -0.06344766914844513, -0.04179553687572479, -0.13232803344726562, 0.025246746838092804, 0.258512943983078, 0.5058722496032715, -0.36551836133003235, -0.20401127636432648, -0.19039762020111084, -0.07418192923069, -0.24137428402900696, 0.17923766374588013, 0.402847021818161, -0.4442426562309265, 0.0990557074546814, -0.25493454933166504, 0.11361026763916016, -0.26868072152137756, 0.12339670956134796, -0.13634595274925232, -0.03224077448248863, 0.07932323217391968, 0.21788926422595978, 0.09698496758937836, -0.035523660480976105, 0.13724128901958466, 0.03974062204360962, -0.06989336013793945, 0.061467695981264114, -0.2224118858575821, 0.08206704258918762, 0.034859851002693176, -0.4194903075695038, 0.35738515853881836, 0.015234556049108505, 0.2902500033378601, -0.018565945327281952, 0.0637485533952713, 0.24794957041740417, 0.2912960350513458, 0.06657864153385162, -0.2879353165626526, -0.00745096430182457, 0.20838913321495056, 0.09026283025741577, -0.20551183819770813, 0.07292599976062775, -0.06313784420490265, -0.2859927713871002, 0.019340917468070984, -0.14419452846050262, 0.27840161323547363, -0.021623820066452026, -0.43327444791793823, 0.008886709809303284, -0.21211647987365723, -0.06676604598760605, -0.018916158005595207, 0.2599111497402191, 0.00470927357673645, -0.09491081535816193, 0.11531627178192139, 0.09501496702432632, -0.10836201161146164, -0.21228443086147308, -0.201246976852417, 0.17187394201755524, -0.15215560793876648, -0.06192735582590103, 0.21912600100040436, -0.026689033955335617, 0.2247125804424286, -0.03272302448749542, 0.08747807890176773, -0.10185934603214264, 0.14030495285987854, -0.2934405505657196, -0.14531904458999634, 0.37134629487991333, 0.05723440647125244, -0.04277101904153824, -0.01967637985944748, -0.16437217593193054, -0.10068585723638535, 0.33952781558036804, -0.23224690556526184, -0.43350839614868164, -0.22710321843624115, 0.2751520276069641, -0.16892340779304504, 0.12192724645137787, -0.22675706446170807, 0.06359286606311798, 0.28953397274017334, -0.2583797574043274, 0.01457459107041359, -0.10050755739212036, -0.06540529429912567, -0.42691391706466675, 0.09132961928844452, 0.32951879501342773, -0.6764136552810669, 0.14367374777793884, 0.14305120706558228, -0.26583731174468994, 0.06381052732467651, 0.3423274755477905, -0.3669798970222473, 0.4150932729244232, -0.33941999077796936, 0.3274261951446533, 0.260029137134552, -0.06611187011003494, -0.40268266201019287, 0.2139112651348114, -0.16562405228614807, -0.009813092648983002, 0.06543098390102386, 0.03427409008145332, 0.20140458643436432, -0.06952794641256332, 0.44544869661331177, 0.316244900226593, -0.05915304273366928, 0.09166201204061508, -0.15670418739318848, -0.2653260827064514, 0.11729839444160461, 0.2950095236301422, -0.007638935931026936, -0.07443439960479736, 0.32833075523376465, -0.006517220288515091, 0.1726778745651245, -0.12114334106445312, -0.017183499410748482, 0.2831681966781616, 0.058092713356018066, 0.0383920893073082, -0.018785014748573303, 0.09563696384429932, -0.433993399143219, 0.24510161578655243, -0.3570576310157776, 0.07303962111473083, -0.293199747800827, -0.030856721103191376, -0.28249770402908325, 0.1828048974275589, -0.2098301202058792, 0.02098570019006729, 0.283438503742218, -0.014967292547225952, 0.06537061929702759, 0.03410443663597107, -0.06770481169223785, 0.10895343124866486, -0.22252875566482544, 0.024274758994579315, -0.41247308254241943, 0.3010784089565277, -0.09910931438207626, -0.2960684299468994, 0.11832600831985474, 0.07581454515457153, -0.07420535385608673, -0.07657627761363983, -0.13127824664115906, 0.37527137994766235, -0.000586342066526413, 0.1271880567073822, -0.17689228057861328, 0.042756542563438416, -0.01290791854262352, -0.34871625900268555, 0.015356948599219322, 0.1096319705247879, 0.11781460046768188, -0.09063459187746048, -0.15001016855239868, 0.26325201988220215, -0.052058566361665726, -0.03453857824206352, 0.010510511696338654, -0.2022111713886261, 0.3962533175945282, -0.04335988312959671, 0.09525784850120544, -0.006864108145236969, 0.09428076446056366, 0.3395760655403137, 0.28865665197372437, 0.13646796345710754, -0.3329223394393921, -0.2265067994594574, 0.4806758165359497, -0.05228918045759201, 0.2157939225435257, 0.2555052638053894, -0.0353512316942215, -0.2749379575252533, -0.006258128210902214, -0.026100873947143555, 0.5216407179832458, 0.24842916429042816, -0.1536993831396103, 0.07795438170433044, -0.036673542112112045, -0.27082276344299316, 0.11963959038257599, 0.13339203596115112, 0.3648737370967865, 0.36439797282218933, 0.40143394470214844, -0.14664438366889954, -0.4192935824394226, -0.3969768285751343, 0.15800383687019348, 0.40444791316986084, -0.32471024990081787, -0.07041305303573608, -0.05743424966931343, -0.08200279623270035, -0.045646339654922485, 0.06023693457245827, -0.11779007315635681, -0.12397496402263641, 0.18225310742855072, 0.0675663948059082, -0.18085792660713196, 0.1123632863163948, -0.006437085568904877, 0.20195835828781128, 0.19764330983161926, -0.2551000714302063, -0.265143483877182, -0.14056041836738586, -0.22967390716075897, 0.13589411973953247, 0.2789999842643738, -0.028746075928211212, 0.3024143576622009, -0.1269540935754776, -0.08768878877162933, -0.02525092475116253, -0.18228477239608765, 0.12292605638504028, -0.04749847948551178, 0.18814298510551453, 0.2950989305973053, 0.22422528266906738, 0.22961920499801636, -0.21772126853466034, 0.3581632971763611, 0.04414378106594086, -0.28090596199035645, 0.33552828431129456, -0.04948285222053528, 0.07966767251491547, -0.09349925816059113, -0.3517262637615204, -0.2402293086051941, -0.4683547616004944, 0.21075177192687988, 0.1929093301296234, 0.16102001070976257, 0.19209593534469604, 0.4755591154098511, 0.10731832683086395, 0.02085895463824272, -0.02805044874548912, -0.22991563379764557, -0.30500808358192444, 0.13545800745487213, -0.12959569692611694, -0.2725335359573364, -0.049496397376060486, 0.013438202440738678, 0.13105317950248718, 0.08893211930990219, -0.6474632620811462, -0.045805029571056366, -0.11982883512973785, 0.3433516025543213, -0.2696895897388458, -0.17839273810386658, 0.140483096241951, 0.12255855649709702, -0.24673235416412354, -0.1557723879814148, -0.04784113168716431, -0.0030710026621818542, -0.06413306295871735, 0.001574937254190445, 0.10550850629806519, 0.45164456963539124, 0.03619647026062012, 0.5421335697174072, 0.08571521937847137, -0.29720109701156616, 0.5060833692550659, -0.30069875717163086, 0.27922168374061584, -0.19614829123020172, -0.11113899946212769, 0.007948238402605057, -0.09856052696704865, -0.1298503279685974, 0.09723551571369171, -0.17299401760101318, -0.19616080820560455, -0.09230013191699982, 0.028355948626995087, -0.4522526264190674, -0.10694056749343872, 0.2479168176651001, 0.02584533579647541, 0.09497757256031036, -0.12382102757692337, -0.16643035411834717, -0.10995087027549744, -0.08777200430631638, -0.09759820997714996, -0.08815832436084747, 0.012401755899190903, -0.07973235845565796, -0.2511928081512451, 0.0034955106675624847, -0.3506455421447754, 0.2786857485771179, 0.09090617299079895, 0.3063039779663086, -0.08561713993549347, 0.15156826376914978, 0.11990508437156677, -0.23459108173847198, 0.7631166577339172, -0.20472361147403717, 0.15949833393096924, 0.1838977038860321, 0.29295748472213745, -0.3754836618900299, -0.030796904116868973, -0.18913978338241577, 0.23858574032783508, 0.08727981895208359, 0.3624132573604584, -0.3564128279685974, -0.07227663695812225, 0.275957316160202, 0.2992430031299591, -0.1553424894809723, -0.3317432999610901, -0.3115536570549011, -0.5339493155479431, -0.44577816128730774, -0.0972825139760971, 0.19796356558799744, 0.37073343992233276, 0.00417608767747879, -0.17531833052635193, 0.01660211570560932, -0.12468740344047546, -0.08396803587675095, 0.08112277090549469, 0.1804751306772232, -0.04114760085940361, 0.08385354280471802, -0.10350814461708069, -0.05492667853832245, 0.4110249876976013, 0.700351357460022, 0.16356542706489563, -0.2351306825876236, -0.058992672711610794, 0.034400347620248795, 0.06571265310049057, 0.21899420022964478, -0.22450965642929077, -0.09155754745006561, -0.1370859295129776, 0.20461294054985046, 0.04939065873622894, 0.05501113459467888, 0.35579556226730347, -0.2994573712348938, -0.2172352820634842, -0.26959437131881714, 0.48853379487991333, -0.018667548894882202, 0.1145058274269104, 0.04243136942386627, -0.22307631373405457, -0.23456668853759766, 0.16845184564590454, 0.20967639982700348, 0.8091542720794678, -0.11276352405548096, 0.19486857950687408, 0.461651086807251, -0.08890237659215927, 0.2720872163772583, -0.4591972231864929, 0.0639769658446312, -0.33349376916885376, 0.0490606464445591, -0.014916185289621353, -0.1927485316991806, 0.06223737448453903, 0.3285601735115051, 0.0413699746131897, 0.024021439254283905, -0.0050254687666893005, 0.07651552557945251, 0.14037102460861206, 0.2747774124145508, -0.09877724200487137, -0.11620979011058807, -0.2727566957473755, 0.15690937638282776, -0.14551778137683868, -0.15719489753246307, -0.14691013097763062, -0.15825572609901428, -0.024559341371059418, -0.3626418113708496, -0.19956763088703156, 0.13046303391456604, -0.3169150650501251, 0.30426308512687683, 0.04510737210512161, -0.22215992212295532, -0.09585125744342804, 0.26185378432273865, -0.19375233352184296, 0.043388381600379944, -0.07905659079551697, 0.18431270122528076, -0.10024015605449677, 0.004642527550458908, -0.03711928427219391, 0.074742391705513, 0.2804505527019501, -0.09569340199232101, -0.20310327410697937, 0.16463911533355713, -0.23142655193805695, -0.22936272621154785, -0.09712652117013931, 0.18901944160461426, 0.009030048735439777, -0.353530615568161, -0.20553472638130188, -0.28472480177879333, -0.1369217187166214, -0.19411659240722656, 0.16183874011039734, 0.16098639369010925, -0.11948885023593903, 0.29463744163513184, -0.20376448333263397, -0.29599258303642273, -0.07780612260103226, 0.3639046251773834, 0.12584343552589417, 0.04254881292581558, 0.4534183442592621, 0.21552029252052307, 0.002357862889766693, -0.23207969963550568, 0.18809208273887634, 0.3440285921096802, -0.7698429226875305, 0.33411380648612976, -0.003282703459262848, 0.1553005576133728, -0.06890728324651718, 0.35790741443634033, 0.08528821915388107, 0.10963185131549835, 0.20688997209072113, -0.5175844430923462, -0.2955719232559204, 0.3132198750972748, 0.11796073615550995, 0.2070220410823822, 0.24717211723327637, 0.10285328328609467, 0.05102776736021042, 0.017463335767388344, -0.38343143463134766, 0.3112364709377289, -0.3353186249732971, 0.12067227065563202, -0.1983056515455246, 0.051861777901649475, 0.06398823857307434, 0.11398953199386597, 0.23930345475673676, 0.2746913433074951, -0.22560736536979675, -0.31435856223106384, -0.021089911460876465, 0.10021714866161346, 0.06665980815887451, -0.09400883316993713, -0.01207428053021431, -0.13740947842597961, -0.21668735146522522, 0.08005353063344955, 0.1545090675354004, 0.017362944781780243, -0.18251287937164307, -0.08052241802215576, 0.02914898842573166, 0.03646283969283104, -0.05387261509895325, 0.023442260921001434, -0.27187034487724304, 0.25848230719566345, 0.10284122824668884, 0.24806390702724457, -0.003850869834423065, -0.10252197831869125, -0.2619849741458893, 0.0691002681851387, 0.13261911273002625, 0.06539566814899445, 0.2115517556667328, -0.5112095475196838, -0.01279689371585846, -0.1619199514389038, 0.46832799911499023, 0.2703635096549988, -0.49125003814697266, -0.020925365388393402, 0.16694769263267517, 0.2620704770088196, -0.38655853271484375, -0.17357993125915527, 0.17673245072364807, -0.0998711809515953, 0.05737036466598511, 0.12523724138736725, 0.24593126773834229, -0.05357544124126434, -0.30315420031547546, 0.009473178535699844, 0.43733975291252136, 0.14644503593444824, -0.21780771017074585, 0.5187718868255615, -0.2296142280101776, -0.0227852463722229, 0.19239482283592224, 0.38657504320144653, 0.37595313787460327, 0.699701726436615, -0.11056831479072571, 0.327949196100235, -0.05339372158050537, -0.08075544238090515, -0.09252774715423584, -0.4602092504501343, 0.24420586228370667, 0.32111215591430664, 0.1080932468175888, 0.17060211300849915, -0.03495866432785988, 0.21593739092350006, 0.14474287629127502, 0.18927109241485596, -0.12426292896270752, 0.10028641670942307, -0.07809905707836151, 0.04279392212629318, -0.3285979628562927, -0.2888490855693817, -0.16635817289352417, 0.05447874963283539, -0.10948516428470612, -0.16127076745033264, 0.07636979967355728, 0.06851091980934143, -0.22319918870925903, -0.3746832013130188, 0.33181118965148926, 0.0747479796409607, -0.20854786038398743, -0.3974487781524658, 0.27632176876068115, 0.4101978540420532, -0.0796956941485405, 0.28040769696235657, 0.25708457827568054, 0.645484983921051, 0.37863466143608093, -0.0035246647894382477, -0.004191629588603973, -0.19017434120178223, -0.10517346113920212, -0.2429128736257553, 0.17012716829776764, 0.3436467945575714, 0.0596194863319397, 0.32719919085502625, 0.2530101537704468, -0.2310689240694046, 0.10949727892875671, 0.38889777660369873, 0.14291532337665558, -0.18016253411769867, -0.10664448142051697, -0.3112768828868866, -0.34211432933807373, -0.1359649896621704, -0.010673150420188904, -0.392710417509079, -0.1695876121520996, 0.2617182433605194, 0.05474846437573433, 0.11000557988882065, -0.023406008258461952, 0.14043277502059937, -0.25622937083244324, 0.6384507417678833, 0.19700336456298828, 0.21917715668678284, -0.23608703911304474, -0.13181950151920319, -0.589812695980072, 0.23416604101657867, -0.3419809639453888, -0.1621769666671753, 0.21022218465805054, 0.27414169907569885, 0.03149504214525223, 0.20123808085918427, 0.09350907802581787, 0.24981775879859924, -0.14433345198631287, 0.34040117263793945, -0.33266955614089966, -0.17538805305957794, 0.1568000465631485, 0.06669746339321136, -0.07610885798931122, -0.40546315908432007, 0.17092660069465637, -0.2880582809448242, 0.1973203867673874, -0.32460734248161316, -0.03015933930873871, 0.1884239912033081, -0.014190344139933586, 0.5868884921073914, 0.0013297498226165771, 0.4296158254146576, -0.20196779072284698, 0.005742862820625305, -0.13582772016525269, -0.21001777052879333, -0.19427728652954102, 0.3111945390701294, 0.23629817366600037, 0.46031898260116577, -0.06585560739040375, 0.04176483675837517, -0.20639057457447052, 0.0928422063589096, -0.1850060671567917, 0.09798341989517212, -0.15462656319141388, 0.10221457481384277, -0.04347582161426544, 0.13484635949134827, -0.005079541355371475, 0.046277858316898346, 0.023143455386161804, 0.06794319301843643, -0.32200518250465393, -0.5157651901245117, 0.5123614072799683, -0.39519184827804565, -0.3903753459453583, 0.1773144006729126, 0.034869030117988586, -0.06347410380840302, 0.06177211552858353, -0.29043012857437134, 0.32975345849990845, 0.4584996998310089, 0.079774871468544, -0.3218410611152649, 0.20146474242210388, -0.10115266591310501, -0.04736403003334999, 0.026560090482234955, -0.05380062013864517, 0.03261341154575348, -0.18521080911159515, -0.02525535225868225, -0.26382648944854736 ]
https://github.com/huggingface/datasets/issues/5912
Hi ! in your code batching is **only used within** `map`, to process examples in batch. The dataset itself however is not batched and returns elements one by one. To iterate on batches, you can do ```python for batch in dataset.iter(batch_size=8): ... ```
Missing elements in `map` a batched dataset
### Describe the bug As outlined [here](https://discuss.huggingface.co/t/length-error-using-map-with-datasets/40969/3?u=sachin), the following collate function drops 5 out of possible 6 elements in the batch (it is 6 because out of the eight, two are bad links in laion). A reproducible [kaggle kernel ](https://www.kaggle.com/sachin/laion-hf-dataset/edit) can be found here. The weirdest part is when inspecting the sizes of the tensors as shown below, both `tokenized_captions["input_ids"]` and `image_features` show the correct shapes. Simply the output only has one element (with the batch dimension squeezed out). ```python class CollateFn: def get_image(self, url): try: response = requests.get(url) return Image.open(io.BytesIO(response.content)).convert("RGB") except PIL.UnidentifiedImageError: logger.info(f"Reading error: Could not transform f{url}") return None except requests.exceptions.ConnectionError: logger.info(f"Connection error: Could not transform f{url}") return None def __call__(self, batch): images = [self.get_image(url) for url in batch["url"]] captions = [caption for caption, image in zip(batch["caption"], images) if image is not None] images = [image for image in images if image is not None] tokenized_captions = tokenizer( captions, padding="max_length", truncation=True, max_length=tokenizer.model_max_length, return_tensors="pt", ) image_features = torch.stack([torch.Tensor(feature_extractor(image)["pixel_values"][0]) for image in images]) # import pdb; pdb.set_trace() return {"input_ids": tokenized_captions["input_ids"], "images": image_features} collate_fn = CollateFn() laion_ds = datasets.load_dataset("laion/laion400m", split="train", streaming=True) laion_ds_batched = laion_ds.map(collate_fn, batched=True, batch_size=8, remove_columns=next(iter(laion_ds)).keys()) ``` ### Steps to reproduce the bug A reproducible [kaggle kernel ](https://www.kaggle.com/sachin/laion-hf-dataset/edit) can be found here. ### Expected behavior Would expect `next(iter(laion_ds_batched))` to produce two tensors of shape `(batch_size, 77)` and `batch_size, image_shape`. ### Environment info datasets==2.12.0 python==3.10
43
Missing elements in `map` a batched dataset ### Describe the bug As outlined [here](https://discuss.huggingface.co/t/length-error-using-map-with-datasets/40969/3?u=sachin), the following collate function drops 5 out of possible 6 elements in the batch (it is 6 because out of the eight, two are bad links in laion). A reproducible [kaggle kernel ](https://www.kaggle.com/sachin/laion-hf-dataset/edit) can be found here. The weirdest part is when inspecting the sizes of the tensors as shown below, both `tokenized_captions["input_ids"]` and `image_features` show the correct shapes. Simply the output only has one element (with the batch dimension squeezed out). ```python class CollateFn: def get_image(self, url): try: response = requests.get(url) return Image.open(io.BytesIO(response.content)).convert("RGB") except PIL.UnidentifiedImageError: logger.info(f"Reading error: Could not transform f{url}") return None except requests.exceptions.ConnectionError: logger.info(f"Connection error: Could not transform f{url}") return None def __call__(self, batch): images = [self.get_image(url) for url in batch["url"]] captions = [caption for caption, image in zip(batch["caption"], images) if image is not None] images = [image for image in images if image is not None] tokenized_captions = tokenizer( captions, padding="max_length", truncation=True, max_length=tokenizer.model_max_length, return_tensors="pt", ) image_features = torch.stack([torch.Tensor(feature_extractor(image)["pixel_values"][0]) for image in images]) # import pdb; pdb.set_trace() return {"input_ids": tokenized_captions["input_ids"], "images": image_features} collate_fn = CollateFn() laion_ds = datasets.load_dataset("laion/laion400m", split="train", streaming=True) laion_ds_batched = laion_ds.map(collate_fn, batched=True, batch_size=8, remove_columns=next(iter(laion_ds)).keys()) ``` ### Steps to reproduce the bug A reproducible [kaggle kernel ](https://www.kaggle.com/sachin/laion-hf-dataset/edit) can be found here. ### Expected behavior Would expect `next(iter(laion_ds_batched))` to produce two tensors of shape `(batch_size, 77)` and `batch_size, image_shape`. ### Environment info datasets==2.12.0 python==3.10 Hi ! in your code batching is **only used within** `map`, to process examples in batch. The dataset itself however is not batched and returns elements one by one. To iterate on batches, you can do ```python for batch in dataset.iter(batch_size=8): ... ```
[ 0.06454868614673615, -0.23429949581623077, -0.04375562071800232, 0.3354438245296478, 0.02739712968468666, 0.10073454678058624, 0.6815289258956909, 0.3147595524787903, -0.14844703674316406, 0.27320611476898193, 0.12604013085365295, 0.12251227349042892, 0.14440776407718658, -0.018664516508579254, -0.06989459693431854, -0.24429768323898315, 0.05661945044994354, 0.11440351605415344, 0.17349952459335327, -0.19178615510463715, -0.48907268047332764, 0.23610186576843262, -0.3799819052219391, -0.25611382722854614, -0.052973199635744095, -0.08920472115278244, -0.46058136224746704, -0.23592734336853027, -0.08747215569019318, -0.2289428412914276, 0.1091264858841896, -0.10712265223264694, -0.12010148167610168, 0.3476669192314148, -0.00011805044778157026, -0.11187766492366791, 0.2768944203853607, -0.0005357563495635986, 0.008212585002183914, -0.03202730417251587, -0.22479553520679474, -0.6584882140159607, -0.24706581234931946, -0.35894858837127686, 0.28544726967811584, 0.06821486353874207, -0.15629851818084717, -0.1244964674115181, 0.10389445722103119, 0.2801090180873871, 0.10141555964946747, 0.32148247957229614, 0.05464591085910797, -0.01873898319900036, 0.5258213877677917, 0.22850877046585083, -0.05952782928943634, 0.06605742871761322, 0.2169257402420044, -0.10010066628456116, -0.06929945945739746, 0.4093865752220154, 0.009847886860370636, -0.3278166651725769, -0.04981322959065437, -0.18078702688217163, -0.13592465221881866, -0.5812042355537415, 0.2324063628911972, 0.2578407824039459, -0.050761014223098755, 0.13295675814151764, -0.18974784016609192, -0.3267974853515625, -0.032494910061359406, -0.37097233533859253, -0.16587761044502258, 0.28523892164230347, -0.05719413235783577, -0.08311831206083298, -0.5257017612457275, 0.33187341690063477, -0.05253325402736664, 0.265369713306427, -0.18267476558685303, 0.14660009741783142, 0.027443397790193558, 0.11541382968425751, -0.07838423550128937, 0.010472049936652184, 0.026398204267024994, -0.06507591903209686, 0.11681036651134491, 0.29508763551712036, -0.1491421014070511, -0.040247801691293716, 0.27037671208381653, -0.3209538757801056, 0.3153385519981384, -0.40154334902763367, -0.2572745382785797, -0.007449986878782511, 0.20165768265724182, 0.05736040696501732, 0.2500147819519043, 0.4237050712108612, 0.06642566621303558, -0.11801136285066605, -0.02998766303062439, -0.060570284724235535, 0.19430257380008698, -0.01693572849035263, 0.09002470225095749, -0.29440346360206604, -0.1993606984615326, -0.05766240879893303, 0.02539927512407303, 0.011481091380119324, -0.1015067845582962, 0.20271983742713928, -0.44448792934417725, 0.18204843997955322, -0.2130214422941208, 0.2975940406322479, -0.20155806839466095, 0.337627649307251, 0.13912037014961243, 0.13796375691890717, -0.050727568566799164, -0.1235281229019165, -0.12882769107818604, -0.1375008225440979, -0.14386782050132751, -0.15291264653205872, 0.04499875009059906, -0.08917912095785141, 0.3092825710773468, -0.04429304599761963, 0.17780113220214844, -0.05575065687298775, -0.0925007313489914, -0.3470187187194824, 0.31718963384628296, 0.16137255728244781, 0.12896427512168884, 0.10145936161279678, 0.2373972088098526, 0.009922847151756287, -0.14315110445022583, 0.10673604905605316, -0.36473965644836426, -0.010034538805484772, -0.19396239519119263, 0.06013198569417, 0.05640638619661331, 0.48201367259025574, -0.1578083038330078, 0.17014345526695251, 0.3034997582435608, 0.20300975441932678, -0.07836486399173737, -0.4560980200767517, -0.24865995347499847, -0.2563086748123169, 0.21846452355384827, 0.17436710000038147, -0.11853417754173279, -0.31698131561279297, -0.10381947457790375, 0.5013485550880432, 0.35381999611854553, 0.5001627802848816, 0.0384267158806324, 0.22745370864868164, -0.29652345180511475, 0.41756606101989746, 0.47732824087142944, -0.2570838928222656, -0.1333305835723877, 0.3578958213329315, 0.05522453784942627, 0.1843111515045166, -0.3044511079788208, -0.07646182179450989, 0.6202530860900879, -0.027997201308608055, 0.6642728447914124, 0.12166445702314377, -0.2861315608024597, 0.011979542672634125, -0.35948437452316284, 0.06972170621156693, 0.37148669362068176, -0.1335146725177765, 0.2903705835342407, -0.014554258435964584, 0.23598280549049377, -0.3991791903972626, 0.1484677791595459, -0.04772046208381653, 0.2814679741859436, 0.5340501070022583, 0.15908294916152954, -0.1516774594783783, 0.28332433104515076, 0.36008065938949585, -0.41852813959121704, 0.1117018386721611, -0.00615837424993515, 0.26241469383239746, -0.14519555866718292, -0.14063364267349243, 0.0579974427819252, 0.13431218266487122, 0.19783756136894226, -0.187950998544693, 0.007497556507587433, -0.2803903818130493, -0.10045445710420609, 0.15018612146377563, 0.30260270833969116, -0.2544174790382385, -0.038669537752866745, 0.0649014562368393, -0.3660340905189514, 0.07393411546945572, -0.2471613734960556, -0.039658743888139725, 0.09554295241832733, 0.31943362951278687, 0.3382543921470642, -0.026045044884085655, -0.0727136954665184, 0.19771790504455566, 0.004980161786079407, -0.14811287820339203, -0.24004772305488586, -0.1997983306646347, 0.4191174805164337, -0.31066080927848816, 0.08812881261110306, -0.12212784588336945, 0.013113543391227722, -0.1701820343732834, 0.09173864871263504, 0.3180832266807556, 0.057453274726867676, 0.3678589463233948, 0.005507335066795349, 0.2092002034187317, 0.02482641488313675, -0.007773548364639282, -0.2790205478668213, -0.2530251741409302, 0.1568131148815155, -0.10678689181804657, 0.054122209548950195, 0.1498049646615982, -0.23605158925056458, 0.13640040159225464, 0.48753806948661804, -0.04417651891708374, -0.11355435848236084, 0.22689810395240784, -0.28327012062072754, -0.1383790373802185, 0.20331329107284546, -0.19219622015953064, 0.33688464760780334, 0.2313116490840912, 0.010757813230156898, -0.15025261044502258, -0.08238258957862854, -0.054457057267427444, 0.05425434559583664, 0.17943640053272247, -0.08252284675836563, 0.16688048839569092, 0.4712311625480652, 0.23882204294204712, -0.1886407732963562, -0.19468089938163757, -0.09985358268022537, -0.06718172878026962, -0.17950598895549774, 0.06596951186656952, -0.08149241656064987, -0.10605256259441376, 0.015518207103013992, -0.3303389549255371, -0.26952508091926575, -0.5415741205215454, 0.09009595215320587, -0.231953427195549, -0.1272362321615219, 0.23494067788124084, -0.0499090738594532, 0.18157008290290833, 0.3661627173423767, -0.01964678429067135, -0.3510277569293976, -0.046685077250003815, -0.2903417944908142, -0.03902353346347809, -0.0725042000412941, -0.19201362133026123, 0.05917293578386307, -0.05063054710626602, -0.4269200563430786, -0.33003246784210205, -0.5314414501190186, 0.1966741532087326, -0.39095622301101685, -0.01074310764670372, 0.20434048771858215, 0.20612815022468567, -0.257713258266449, -0.17028990387916565, 0.2697780728340149, 0.10150996595621109, -0.14785636961460114, 0.2653145492076874, 0.006159808486700058, -0.25045737624168396, -0.3471894860267639, -0.08672385662794113, -0.016258060932159424, -0.3512168526649475, 0.49712038040161133, 0.08022143691778183, 0.08066647499799728, 0.17347440123558044, 0.2447846233844757, 0.0007553696632385254, 0.3784664273262024, -0.07240239530801773, -0.2447127401828766, -0.06886015832424164, 0.3942914307117462, -0.26934441924095154, -0.46364063024520874, -0.17251089215278625, -0.10117745399475098, 0.17778414487838745, 0.5312865376472473, -0.5326017737388611, -0.012893583625555038, -0.005755247548222542, 0.15247230231761932, 0.048631925135850906, -0.09851911664009094, 0.31043702363967896, 0.06790903210639954, 0.06597386300563812, -0.21177318692207336, -0.1554936021566391, 0.0038843825459480286, 0.2548906207084656, 0.37788155674934387, -0.16064037382602692, 0.49122995138168335, 0.22781462967395782, 0.5852528810501099, 0.129054456949234, -0.18734781444072723, 0.13181264698505402, -0.17571984231472015, 0.38278305530548096, -0.07380051165819168, -0.1271270364522934, 0.5054375529289246, -0.28093579411506653, -0.07717777788639069, 0.08841007947921753, -0.1731727421283722, -0.4192017614841461, 0.0942513719201088, 0.1981387585401535, -0.2441786676645279, -0.254383385181427, 0.23456133902072906, 0.16817496716976166, 0.31485360860824585, 0.18474283814430237, 0.01734599471092224, -0.23388472199440002, -0.2202649712562561, 0.2641618549823761, -0.19604796171188354, 0.1533784419298172, 0.058178845793008804, -0.10063858330249786, -0.4149788022041321, -0.6526435017585754, 0.2627498507499695, 0.19210559129714966, 0.4993118941783905, 0.050692737102508545, -0.17378652095794678, -0.12909942865371704, 0.28233084082603455, 0.8901879787445068, -0.0871315449476242, -0.3186188340187073, 0.2297816276550293, 0.08778972923755646, -0.659683108329773, -0.042378176003694534, -0.15498188138008118, -0.26591527462005615, 0.5229505300521851, 0.839952290058136, -0.11056225746870041, 0.09190833568572998, 0.19676154851913452, 0.18404421210289001, 0.016172416508197784, 0.16154710948467255, -0.02401580661535263, -0.35509008169174194, -0.13021400570869446, -0.020735900849103928, 0.39474350214004517, 0.28979042172431946, -0.02132735587656498, -0.5476419925689697, -0.028556082397699356, -0.12924765050411224, -0.021218255162239075, 0.10817176103591919, 0.27738749980926514, 0.029500048607587814, 0.09461177885532379, -0.08092133700847626, 0.22889427840709686, 0.48223876953125, 0.16693654656410217, -0.11305758357048035, -0.12413689494132996, 0.29974696040153503, -0.2303246259689331, 0.3990741968154907, 0.4469686448574066, 0.012491457164287567, -0.20652711391448975, -0.2659655213356018, 0.6555484533309937, -0.06427410244941711, 0.4058769643306732, 0.44309860467910767, 0.016563095152378082, -0.49556127190589905, 0.1867072880268097, -0.1551412045955658, -0.06393855810165405, 0.06228289008140564, 0.4181520938873291, -0.3983115553855896, -0.3878327012062073, 0.5456895232200623, 0.2437668889760971, 1.0568145513534546, 0.018234942108392715, 0.22432094812393188, 0.31758052110671997, 0.21693752706050873, 0.041223905980587006, -0.30328428745269775, 0.19164109230041504, -0.1586727499961853, -0.2995914816856384, 0.019436568021774292, -0.03556741401553154, -0.18407778441905975, 0.04225841909646988, -0.2526822090148926, 0.1740182638168335, 0.17540299892425537, 0.31717124581336975, -0.1632343828678131, -0.2726494371891022, 0.2518633008003235, -0.4473223388195038, -0.012394219636917114, 0.08091270923614502, 0.152886301279068, 0.25063639879226685, -0.16295142471790314, 0.17135150730609894, -0.06201334670186043, -0.4231211543083191, -0.2526111900806427, 0.20577575266361237, -0.6212855577468872, 0.28017404675483704, 0.1284475326538086, -0.09751110523939133, -0.09524102509021759, 0.3803301155567169, 0.03275701403617859, 0.2503528296947479, -0.02460533194243908, 0.10289494693279266, 0.30815988779067993, 0.1827346384525299, 0.23264658451080322, -0.2591221034526825, 0.1452690064907074, -0.09768541902303696, 0.2480885535478592, -0.04425426572561264, -0.18978643417358398, 0.17060494422912598, -0.18870970606803894, 0.12774907052516937, -0.32642844319343567, -0.22453847527503967, -0.12690389156341553, 0.05025797337293625, 0.18013286590576172, -0.24187324941158295, 0.0267327968031168, -0.09438499808311462, -0.18529778718948364, 0.4320201575756073, -0.15317511558532715, -0.23952534794807434, -0.11178954690694809, 0.1942199021577835, 0.11475099623203278, -0.07359083741903305, 0.14317086338996887, 0.20635318756103516, -0.17627832293510437, -0.06421829015016556, -0.029337167739868164, -0.12458306550979614, -0.12884430587291718, 0.15928901731967926, -0.44117921590805054, -0.011621356010437012, -0.36783912777900696, 0.2856442630290985, 0.04139575734734535, 0.06841069459915161, -0.07193667441606522, -0.3551042675971985, -0.2011682689189911, 0.2916925847530365, 0.202956885099411, 0.22678148746490479, -0.15376698970794678, 0.2946885824203491, -0.0040548816323280334, 0.3027554452419281, -0.20725694298744202, -0.12759865820407867, -0.2376505732536316, 0.46709153056144714, 0.04041467234492302, 0.17178219556808472, 0.30589666962623596, -0.09955474734306335, -0.031569987535476685, 0.3445059657096863, 0.052219562232494354, -0.08693636208772659, -0.30103981494903564, 0.06674300879240036, 0.21429197490215302, 0.09866398572921753, 0.24243780970573425, 0.011703014373779297, 0.002582598477602005, -0.40247777104377747, 0.019710779190063477, 0.10899249464273453, -0.06454722583293915, -0.11049017310142517, 0.0981137603521347, 0.048419974744319916, 0.31160297989845276, 0.33444643020629883, 0.13172270357608795, 0.2763688266277313, 0.3019488453865051, 0.3228723704814911, 0.09338343143463135, 0.12692978978157043, 0.11886534839868546, -0.033437151461839676, -0.2099134624004364, -0.03706790506839752, 0.2951083481311798, -0.13532927632331848, -0.251732736825943, -0.08641231060028076, 0.18486109375953674, 0.021410278975963593, -0.40439844131469727, 0.02773740142583847, 0.2014177441596985, 0.15771397948265076, -0.18521881103515625, -0.11239506304264069, 0.3105122148990631, -0.12694203853607178, 0.026301227509975433, 0.17059829831123352, 0.07142391055822372, -0.08492940664291382, -0.21786262094974518, -0.03214529901742935, 0.20401616394519806, -0.055847592651844025, 0.04149746522307396, 0.10769979655742645, -0.005414150655269623, 0.29342517256736755, -0.07072465866804123, 0.01816742494702339, 0.2801656723022461, 0.0307761263102293, 0.1849529892206192, 0.16711093485355377, 0.25780627131462097, 0.2591046988964081, -0.0008123107254505157, -0.1509462296962738, 0.0935722291469574, 0.3621479272842407, -0.2650350332260132, 0.33031100034713745, -0.026657577604055405, 0.20599576830863953, 0.1664731353521347, -0.5283300876617432, 0.09809931367635727, 0.5083603262901306, -0.24162612855434418, 0.052279502153396606, -0.31763866543769836, 0.09045206010341644, -0.2913944125175476, 0.007937952876091003, 0.39554011821746826, -0.13707959651947021, 0.19087497889995575, 0.2773589491844177, -0.057983171194791794, -0.006211014464497566, -0.43138402700424194, 0.09009380638599396, 0.18216566741466522, -0.23831117153167725, 0.2005888670682907, -0.1751493215560913, -0.06661456823348999, -0.20500221848487854, 0.10891985893249512, 0.4337536096572876, 0.1956009715795517, 0.07688134163618088, -0.15330836176872253, 0.32605329155921936, -0.20638161897659302, -0.2876783013343811, 0.09260611236095428, 0.23439964652061462, -0.095919169485569, 0.16179364919662476, 0.04358077794313431, -0.14276936650276184, -0.08847689628601074, -0.03780711069703102, 0.026952490210533142, 0.1478692889213562, 0.08525822311639786, -0.29452311992645264, -0.46816131472587585, -0.33376264572143555, -0.19743524491786957, -0.2241692841053009, 0.11642082780599594, 0.5720770955085754, -0.018824853003025055, 0.31530606746673584, 0.21310940384864807, 0.052022211253643036, -0.055859290063381195, 0.09224456548690796, 0.5211729407310486, -0.3020671308040619, -0.1759566068649292, -0.40874820947647095, -0.21702034771442413, 0.23087339103221893, -0.28581613302230835, 0.13665041327476501, 0.25366735458374023, 0.18289056420326233, 0.08332767337560654, -0.0757388174533844, 0.16445612907409668, -0.14710566401481628, 0.11440344899892807, 0.17991583049297333, -0.3657785654067993, -0.1277073621749878, -0.30431288480758667, 0.13491378724575043, 0.13746541738510132, -0.24614883959293365, 0.21084266901016235, -0.14211136102676392, -0.013871073722839355, -0.12554559111595154, 0.019569560885429382, -0.12000548839569092, -0.19050092995166779, 0.40235698223114014, 0.2712864875793457, 0.042241405695676804, -0.08227963745594025, -0.21336831152439117, 0.0780629962682724, -0.20278625190258026, -0.02177068218588829, 0.20957006514072418, 0.05349094420671463, 0.15951935946941376, -0.10641175508499146, -0.14336757361888885, -0.14081436395645142, 0.3587372601032257, 0.4774514436721802, -0.1865786463022232, -0.234660804271698, 0.41550275683403015, -0.35246193408966064, 0.0897943377494812, 0.1452319324016571, 0.36807408928871155, -0.04516652971506119, 0.15057101845741272, -0.17474792897701263, -0.6292343139648438, 0.44990816712379456, -0.8537517189979553, -0.3523852825164795, -0.0688323900103569, 0.03408406302332878, -0.029922276735305786, -0.07960476726293564, -0.3420548737049103, -0.32033199071884155, 0.18570134043693542, 0.05007284879684448, -0.4025750756263733, 0.020084720104932785, -0.26336488127708435, 0.022950001060962677, -0.12200784683227539, -0.17968741059303284, 0.14656512439250946, -0.36216557025909424, 0.10767144709825516, -0.17983068525791168 ]
https://github.com/huggingface/datasets/issues/5910
Currently, it's not possible to chain `set_format`/`set_transform` calls (plus, this is a breaking change if we decide to implement it), so I see two possible solutions: * using `set_format`/`set_transform` for the 1st transform and then passing the transformed example/batch to the 2nd transform * implementing and registering a custom formatter (the relevant code is [here](https://github.com/huggingface/datasets/tree/main/src/datasets/formatting)) Btw, your example requires a single `set_format` call: ```python ds.set_format("torch", columns=["image"], output_all_columns=True, dtype=torch.double) ```
Cannot use both set_format and set_transform
### Describe the bug I need to process some data using the set_transform method but I also need the data to be formatted for pytorch before processing it. I don't see anywhere in the documentation something that says that both methods cannot be used at the same time. ### Steps to reproduce the bug ``` from datasets import load_dataset ds = load_dataset("mnist", split="train") ds.set_format(type="torch") def transform(entry): return entry["image"].double() ds.set_transform(transform) print(ds[0]) ``` ### Expected behavior It should print the pytorch tensor image as a double, but it errors because "entry" in the transform function doesn't receive a pytorch tensor to begin with, it receives a PIL Image -> entry.double() errors because entry isn't a pytorch tensor. ### Environment info Latest versions. ### Note: It would be at least handy to have access to a function that can do the dataset.set_format in the set_transform function. Something like: ``` from datasets import load_dataset, do_format ds = load_dataset("mnist", split="train") def transform(entry): entry = do_format(entry, type="torch") return entry["image"].double() ds.set_transform(transform) print(ds[0]) ```
69
Cannot use both set_format and set_transform ### Describe the bug I need to process some data using the set_transform method but I also need the data to be formatted for pytorch before processing it. I don't see anywhere in the documentation something that says that both methods cannot be used at the same time. ### Steps to reproduce the bug ``` from datasets import load_dataset ds = load_dataset("mnist", split="train") ds.set_format(type="torch") def transform(entry): return entry["image"].double() ds.set_transform(transform) print(ds[0]) ``` ### Expected behavior It should print the pytorch tensor image as a double, but it errors because "entry" in the transform function doesn't receive a pytorch tensor to begin with, it receives a PIL Image -> entry.double() errors because entry isn't a pytorch tensor. ### Environment info Latest versions. ### Note: It would be at least handy to have access to a function that can do the dataset.set_format in the set_transform function. Something like: ``` from datasets import load_dataset, do_format ds = load_dataset("mnist", split="train") def transform(entry): entry = do_format(entry, type="torch") return entry["image"].double() ds.set_transform(transform) print(ds[0]) ``` Currently, it's not possible to chain `set_format`/`set_transform` calls (plus, this is a breaking change if we decide to implement it), so I see two possible solutions: * using `set_format`/`set_transform` for the 1st transform and then passing the transformed example/batch to the 2nd transform * implementing and registering a custom formatter (the relevant code is [here](https://github.com/huggingface/datasets/tree/main/src/datasets/formatting)) Btw, your example requires a single `set_format` call: ```python ds.set_format("torch", columns=["image"], output_all_columns=True, dtype=torch.double) ```
[ -0.29396408796310425, -0.3666975796222687, 0.011062927544116974, 0.012519169598817825, 0.2693057358264923, -0.05619646608829498, 0.5307270884513855, 0.3404295742511749, -0.3794787526130676, -0.049909673631191254, -0.07404270023107529, 0.2621923089027405, -0.19932174682617188, 0.1951020359992981, 0.052834756672382355, -0.3028879165649414, 0.13386045396327972, -0.03945016860961914, -0.2902354896068573, 0.1639443188905716, -0.03493117541074753, -0.027786431834101677, -0.22152601182460785, -0.11498246341943741, -0.497964084148407, 0.034454651176929474, -0.08969034254550934, -0.19814181327819824, 0.061983585357666016, -0.1519404947757721, 0.26840925216674805, 0.1409166157245636, -0.18920451402664185, 0.9459832906723022, -0.00012696304474957287, 0.17097218334674835, 0.3106038570404053, 0.029338598251342773, -0.2222386598587036, -0.5026341080665588, 0.08363673090934753, -0.36812713742256165, 0.07310763746500015, -0.3429679870605469, -0.17904916405677795, -0.4991435706615448, -0.1177806705236435, -0.22721734642982483, 0.5057839751243591, 0.3319813311100006, 0.13703611493110657, 0.3764813542366028, 0.003685086965560913, -0.08543980121612549, -0.009221673011779785, 0.4337012767791748, -0.07104364782571793, 0.013439219444990158, 0.019399747252464294, 0.3604700267314911, 0.18638567626476288, 0.37608450651168823, -0.31972500681877136, -0.03140196576714516, 0.15849551558494568, 0.23877526819705963, -0.43679940700531006, -0.20721808075904846, -0.07360099256038666, 0.08311253786087036, 0.29022759199142456, -0.3215779960155487, -0.38798072934150696, -0.4565030634403229, -0.03850613161921501, -0.2075524777173996, 0.30025625228881836, 0.10310045629739761, 0.018253572285175323, 0.023107726126909256, -0.47909149527549744, 0.009399913251399994, -0.09097205102443695, 0.2813867926597595, -0.13230176270008087, -0.12129990756511688, -0.1537366509437561, 0.20305213332176208, -0.08951903134584427, 0.2028791904449463, 0.2493850588798523, -0.23823346197605133, 0.2369585782289505, 0.18961572647094727, -0.18380390107631683, -0.033176228404045105, -0.02557120844721794, -0.32529589533805847, -0.026894547045230865, 0.26161494851112366, -0.03020765446126461, -0.21755404770374298, -0.19410724937915802, 0.005141139961779118, 0.19456352293491364, 0.5202229022979736, -0.007648345082998276, 0.2983718812465668, 0.2707381248474121, -0.2846452295780182, 0.24170757830142975, -0.1158846765756607, 0.46800941228866577, -0.5263937711715698, 0.07043326646089554, 0.17042362689971924, 0.6114744544029236, -0.15077205002307892, 0.053227536380290985, -0.2582811117172241, -0.1832430064678192, -0.31954067945480347, 0.13176007568836212, 0.0871242880821228, 0.08916772156953812, 0.5470013618469238, 0.3306296467781067, 0.3014933168888092, 0.03517630696296692, -0.016553319990634918, -0.08913023769855499, 0.1381358504295349, -0.24880854785442352, 0.0998741015791893, 0.1423533707857132, -0.5088561773300171, 0.013590119779109955, 0.6589440703392029, 0.09830173850059509, 0.022019274532794952, 0.029132694005966187, -0.34838518500328064, 0.4057445824146271, 0.0879213735461235, -0.29192566871643066, 0.44639474153518677, 0.04511265084147453, 0.31590333580970764, -0.18617427349090576, 0.18121804296970367, -0.3840682804584503, -0.04032875597476959, -0.08211057633161545, 0.05113258585333824, -0.07197162508964539, 0.18235526978969574, -0.04107636213302612, 0.308707058429718, 0.5664247870445251, -0.16030405461788177, 0.08903127908706665, -0.19493979215621948, -0.17638316750526428, -0.23191703855991364, 0.28092318773269653, -0.023850195109844208, -0.12111018598079681, -0.1982841193675995, 0.3562021851539612, 0.11303669214248657, 0.16393086314201355, 0.30728065967559814, -0.05087411403656006, 0.19776712357997894, -0.27083465456962585, -0.15987496078014374, 0.3708612620830536, -0.38141170144081116, -0.1447748839855194, -0.019915640354156494, -0.015968799591064453, 0.0088067427277565, 0.048273880034685135, -0.04358380287885666, -0.029987823218107224, -0.19880074262619019, -0.12531980872154236, 0.28035271167755127, -0.16617313027381897, -0.005809485912322998, -0.00872144103050232, -0.028659678995609283, 0.4328199028968811, -0.05560404434800148, 0.13594895601272583, 0.15489628911018372, -0.3056158125400543, 0.1288783699274063, 0.0019128825515508652, -0.2043384313583374, 0.01671304926276207, -0.04918172210454941, -0.31087589263916016, 0.05352608487010002, 0.08446761965751648, -0.35172921419143677, -0.2717510461807251, -0.021498918533325195, 0.06703653186559677, 0.06679987907409668, -0.09437273442745209, -0.09666384756565094, -0.12694890797138214, -0.2111995816230774, -0.05337163805961609, -0.12239795178174973, 0.04275171086192131, 0.14237523078918457, 0.2578490972518921, 0.11314943432807922, -0.3718874752521515, 0.26329392194747925, 0.20872658491134644, 0.03204928711056709, -0.1868068426847458, 0.2222495675086975, 0.04928918182849884, -0.3817290961742401, -0.3413938283920288, 0.20290891826152802, 0.2778187096118927, -0.15891200304031372, -0.25645747780799866, 0.3658527731895447, -0.0971791073679924, 0.0204459335654974, -0.7999147772789001, 0.133827343583107, 0.3746301829814911, -0.07748819887638092, -0.3221658170223236, 0.14350607991218567, 0.14022067189216614, -0.1789558231830597, -0.3335827589035034, 0.2313615381717682, -0.16284257173538208, 0.3087507486343384, -0.05696076527237892, 0.02856546640396118, -0.11442698538303375, -0.13639040291309357, -0.2219228446483612, -0.1955317258834839, 0.18001104891300201, -0.2618371248245239, 0.13577893376350403, -0.11416834592819214, -0.43195468187332153, -0.21742010116577148, 0.2931362986564636, 0.11473247408866882, 0.20913884043693542, -0.008387964218854904, -0.07043434679508209, 0.19723153114318848, 0.07275822013616562, -0.03870115429162979, 0.36980947852134705, 0.05022212490439415, -0.003172917291522026, 0.08075244724750519, -0.21374158561229706, -0.03621860593557358, 0.1031327098608017, 0.23715323209762573, 0.13774150609970093, 0.006150206550955772, 0.37102076411247253, 0.19308000802993774, 0.1266842633485794, 0.0841599702835083, -0.026781126856803894, -0.2645961046218872, -0.39181196689605713, 0.14917060732841492, -0.4752405881881714, -0.07589833438396454, -0.4542415738105774, -0.13834798336029053, 0.1184551864862442, -0.1744249165058136, -0.2599033713340759, 0.13812163472175598, -0.13364358246326447, 0.15229007601737976, 0.018337607383728027, -0.049659937620162964, -0.08790697157382965, -0.10145401954650879, -0.241678386926651, 0.06116301566362381, 0.10241704434156418, -0.06336769461631775, 0.2885565459728241, -0.35838204622268677, 0.4907914698123932, 0.030765943229198456, -0.372672438621521, -0.07727628946304321, -0.2800861597061157, 0.27656489610671997, -0.04124307632446289, -0.13663528859615326, 0.11728560924530029, -0.020164012908935547, 0.12771207094192505, -0.06935754418373108, 0.4285551905632019, -0.10969176143407822, 0.1059216856956482, 0.043975718319416046, -0.12990304827690125, 0.21398891508579254, -0.3627188205718994, -0.10734599828720093, -0.04963847994804382, -0.11907531321048737, 0.04938451573252678, -0.5165140628814697, 0.03371158242225647, 0.19912974536418915, -0.06939557194709778, 0.14556553959846497, -0.09084783494472504, 0.2715689539909363, -0.10062630474567413, -0.03112354874610901, 0.45214682817459106, -0.28958752751350403, -0.33005568385124207, -0.19532817602157593, 0.11375284940004349, -0.1582196056842804, 0.36238983273506165, -0.13543057441711426, -0.41054779291152954, -0.45159512758255005, 0.09522463381290436, -0.199374258518219, 0.21150408685207367, 0.18525204062461853, 0.14736419916152954, 0.0224713534116745, -0.06758465617895126, -0.1344292163848877, -0.0031996071338653564, -0.1047179326415062, -0.021118279546499252, 0.24571269750595093, 0.3588220775127411, 0.2750527560710907, 0.519051194190979, 0.1392984539270401, -0.2324506789445877, 0.25181153416633606, -0.09113609045743942, 0.22347280383110046, -0.2828977108001709, -0.5567670464515686, 0.07882529497146606, -0.10945864021778107, 0.07925590127706528, -0.14656966924667358, -0.22034835815429688, -0.015628596767783165, -0.3635244369506836, 0.130563423037529, -0.35692089796066284, -0.18064990639686584, 0.09823624789714813, -0.14411427080631256, 0.35076436400413513, -0.20565927028656006, 0.3154454231262207, 0.19175784289836884, -0.004584662616252899, 0.2579350173473358, -0.015933312475681305, 0.05616094172000885, 0.16111299395561218, -0.17141352593898773, -0.2649095058441162, -0.1411755084991455, 0.32198941707611084, 0.0793878436088562, 0.3747875690460205, -0.207749605178833, 0.10980309545993805, 0.07835325598716736, -0.03287079557776451, 0.7850143909454346, 0.1853668987751007, -0.1917467713356018, 0.06472750008106232, -0.41161268949508667, -0.5950185656547546, -0.14386922121047974, -0.05907334387302399, 0.2109687179327011, 0.18080750107765198, 0.31683820486068726, -0.21901248395442963, -0.1343410611152649, 0.16193439066410065, 0.25411224365234375, 0.051028087735176086, -0.2908259928226471, 0.06660924851894379, -0.2651906907558441, -0.19252049922943115, -0.040302686393260956, 0.3125680387020111, 0.10661868751049042, -0.13476209342479706, 0.06458598375320435, -0.1562487781047821, -0.10454879701137543, 0.059502504765987396, -0.20547477900981903, 0.2929154634475708, -0.03652283549308777, 0.08199621737003326, 0.49536383152008057, 0.31183022260665894, 0.0552278608083725, 0.28851690888404846, -0.0431191623210907, -0.26760029792785645, 0.08906585723161697, 0.1291208565235138, 0.2569608986377716, 0.2107544243335724, -0.058131732046604156, 0.08247001469135284, -0.1547962725162506, 0.013258285820484161, -0.31997525691986084, 0.23741121590137482, 0.3026963472366333, 0.11016841232776642, -0.4911145865917206, -0.6297398805618286, 0.370333731174469, 0.3227497339248657, 0.03596656024456024, 0.23707813024520874, -0.014252681285142899, -0.3674725890159607, 0.3108021318912506, -0.041863106191158295, 0.9272467494010925, 0.1644778996706009, 0.2206069529056549, 0.14886724948883057, -0.3326646089553833, 0.6864731311798096, 0.0039518773555755615, 0.07745032012462616, -0.11540476977825165, -0.1983068287372589, -0.09518351405858994, -0.3884882926940918, 0.10235878080129623, 0.009478556923568249, -0.4059150815010071, 0.31144431233406067, -0.5603933334350586, -0.021646199747920036, -0.0671863928437233, 0.19649213552474976, 0.09314895421266556, -0.2918112277984619, -0.14598038792610168, 0.08182449638843536, -0.141981303691864, 0.12836667895317078, -0.013939294964075089, 0.08350895345211029, -0.052994828671216965, -0.09183929115533829, -0.21464237570762634, 0.12757007777690887, -0.25525954365730286, 0.2634374797344208, -0.34056955575942993, -0.6874959468841553, 0.19441168010234833, 0.37896934151649475, 0.45035821199417114, -0.16548866033554077, 0.03172396123409271, 0.0511416457593441, 0.01993405632674694, 0.3612360954284668, -0.2601052522659302, -0.32167360186576843, 0.5030068755149841, 0.04767888784408569, 0.08529704809188843, 0.05638822913169861, -0.04770336672663689, 0.10019642859697342, -0.13277718424797058, 0.12536141276359558, 0.09571444243192673, -0.15097635984420776, -0.14754272997379303, 0.1187364012002945, 0.5378273725509644, -0.19858470559120178, 0.027248449623584747, 0.19915033876895905, 0.10147508233785629, 0.32305002212524414, -0.44471269845962524, -0.11159517616033554, -0.08448132127523422, 0.2749626934528351, 0.2169450968503952, -0.2122548222541809, 0.5070075392723083, 0.2875501215457916, -0.1365383118391037, 0.06162801384925842, 0.09776593744754791, 0.11380065977573395, -0.5933038592338562, 0.4559505879878998, -0.10697782039642334, 0.12849391996860504, -0.3591431975364685, 0.19111967086791992, -0.05544715002179146, -0.15363670885562897, -0.04617471247911453, -0.10817276686429977, -0.2090187966823578, -0.07907706499099731, 0.34906429052352905, 0.3303438425064087, 0.22702476382255554, 0.4158220887184143, 0.10419905930757523, 0.2035156637430191, -0.196920707821846, -0.08754975348711014, 0.20239275693893433, 0.3044387698173523, 0.15232916176319122, 0.11756449192762375, 0.17111757397651672, -0.19508938491344452, -0.05306928977370262, 0.08209265768527985, 0.1219976395368576, -0.14327336847782135, -0.31429919600486755, 0.10579082369804382, 0.10764740407466888, -0.24757683277130127, -0.04371261969208717, -0.18467405438423157, 0.16797056794166565, -0.23380911350250244, 0.2504575550556183, 0.5206432938575745, -0.08390563726425171, 0.2158220261335373, 0.014343632385134697, -0.002159472554922104, -0.06918489933013916, 0.12327713519334793, 0.018359892070293427, -0.1804904341697693, 0.21844422817230225, 0.31541818380355835, 0.06107189878821373, 0.05958817899227142, -0.31950321793556213, -0.06270094215869904, 0.3338443636894226, -0.08081960678100586, -0.20780116319656372, -0.18955664336681366, 0.036008939146995544, -0.01646561175584793, 0.4112449586391449, 0.0629308819770813, -0.17689692974090576, 0.199136883020401, 0.2262139916419983, 0.08471202105283737, 0.12550918757915497, 0.12204291671514511, 0.04975058138370514, 0.26557427644729614, -0.00948585569858551, 0.11958976089954376, -0.13423842191696167, 0.32454392313957214, -0.2680811583995819, 0.18834279477596283, 0.04513435438275337, -0.3271678388118744, 0.36433422565460205, 0.3372541666030884, -0.05768898129463196, 0.21697545051574707, 0.24931687116622925, -0.17268946766853333, -0.03234606608748436, -0.1744670271873474, 0.36386457085609436, 0.5251694321632385, 0.39146149158477783, -0.0902828723192215, 0.44087710976600647, -0.01845858246088028, -0.16317744553089142, -0.1741526573896408, 0.037855364382267, 0.30190691351890564, 0.030309326946735382, 0.32564404606819153, -0.12957683205604553, -0.4597494304180145, 0.041920267045497894, 0.32333722710609436, -0.023901723325252533, 0.06433283537626266, -0.12843692302703857, -0.09475647658109665, 0.12857113778591156, -0.09528855979442596, -0.03455710411071777, -0.032212208956480026, 0.43657350540161133, 0.2833429276943207, -0.12059084326028824, -0.04556713253259659, -0.16129472851753235, 0.23090383410453796, 0.21728451550006866, -0.05125758796930313, 0.13043969869613647, 0.3330513834953308, -0.09453986585140228, 0.16513212025165558, 0.6733446717262268, 0.33050116896629333, 0.4142031967639923, -0.024855103343725204, -0.13700106739997864, -0.0892435610294342, 0.1059725284576416, 0.09644103795289993, 0.2242720127105713, -0.15655077993869781, -0.2177065908908844, 0.30152469873428345, 0.06336791813373566, -0.18071071803569794, 0.07394379377365112, -0.23860332369804382, 0.2554793357849121, -0.4318353831768036, 0.4199332892894745, -0.16657161712646484, -0.20790745317935944, 0.14360612630844116, -0.015719059854745865, -0.2609346807003021, -0.13098789751529694, 0.5137184262275696, 0.0423225574195385, -0.0009649991989135742, -0.1129172295331955, 0.03108539804816246, 0.4163377583026886, 0.20768685638904572, 0.1722601354122162, 0.24811066687107086, 0.015710636973381042, 0.0233784019947052, -0.2730768024921417, -0.0561336912214756, -0.006365880370140076, 0.20534241199493408, -0.022209985181689262, -0.12683182954788208, 0.048082977533340454, 0.07316872477531433, 0.5047126412391663, -0.3320961892604828, 0.11899665743112564, 0.26305413246154785, -0.14314454793930054, -0.26700177788734436, -0.162972092628479, -0.09531331807374954, 0.07381947338581085, -0.29185670614242554, 0.1617584228515625, 0.04629557207226753, 0.043099723756313324, -0.1499604731798172, 0.13664081692695618, 0.09960225224494934, -0.091710165143013, 0.45277073979377747, 0.5260083079338074, 0.5881495475769043, -0.11906047910451889, 0.13127267360687256, -0.03209565579891205, -0.0021455995738506317, -0.42710256576538086, 0.2313302755355835, -0.15113726258277893, 0.3319224417209625, -0.4921765923500061, -0.37471818923950195, -0.14811278879642487, 0.37444713711738586, -0.10604622960090637, -0.07174913585186005, -0.10661625862121582, 0.13646064698696136, -0.05588584765791893, -0.06735223531723022, 0.17888592183589935, 0.4087353050708771, -0.14541186392307281, 0.19261008501052856, -0.5530495047569275, -0.36236855387687683, 0.47557637095451355, -0.5737718343734741, -0.3874223828315735, -0.10976183414459229, -0.14128413796424866, -0.12310995161533356, 0.22521932423114777, -0.45081979036331177, -0.4120502173900604, 0.12257610261440277, -0.0724867433309555, -0.14056871831417084, 0.22685088217258453, 0.05685571953654289, -0.22144606709480286, -0.06082149222493172, 0.5620587468147278, 0.13507483899593353, -0.2561091184616089, -0.17880675196647644, -0.1082843691110611 ]
https://github.com/huggingface/datasets/issues/5910
Hey Mario, Thanks, for getting back to me. the toDouble was just an example my real life case requires many more transforms. What do you mean by: > using set_format/set_transform for the 1st transform and then passing the transformed example/batch to the 2nd transform How would that go, I thought you can't chain them? As for the custom formatter, is it possible to reference an existing formatter, in my case `torch_formatter` inside of my custom formatter? maybe I can inherit from it and just call `super.recursive_tensorize()`?
Cannot use both set_format and set_transform
### Describe the bug I need to process some data using the set_transform method but I also need the data to be formatted for pytorch before processing it. I don't see anywhere in the documentation something that says that both methods cannot be used at the same time. ### Steps to reproduce the bug ``` from datasets import load_dataset ds = load_dataset("mnist", split="train") ds.set_format(type="torch") def transform(entry): return entry["image"].double() ds.set_transform(transform) print(ds[0]) ``` ### Expected behavior It should print the pytorch tensor image as a double, but it errors because "entry" in the transform function doesn't receive a pytorch tensor to begin with, it receives a PIL Image -> entry.double() errors because entry isn't a pytorch tensor. ### Environment info Latest versions. ### Note: It would be at least handy to have access to a function that can do the dataset.set_format in the set_transform function. Something like: ``` from datasets import load_dataset, do_format ds = load_dataset("mnist", split="train") def transform(entry): entry = do_format(entry, type="torch") return entry["image"].double() ds.set_transform(transform) print(ds[0]) ```
86
Cannot use both set_format and set_transform ### Describe the bug I need to process some data using the set_transform method but I also need the data to be formatted for pytorch before processing it. I don't see anywhere in the documentation something that says that both methods cannot be used at the same time. ### Steps to reproduce the bug ``` from datasets import load_dataset ds = load_dataset("mnist", split="train") ds.set_format(type="torch") def transform(entry): return entry["image"].double() ds.set_transform(transform) print(ds[0]) ``` ### Expected behavior It should print the pytorch tensor image as a double, but it errors because "entry" in the transform function doesn't receive a pytorch tensor to begin with, it receives a PIL Image -> entry.double() errors because entry isn't a pytorch tensor. ### Environment info Latest versions. ### Note: It would be at least handy to have access to a function that can do the dataset.set_format in the set_transform function. Something like: ``` from datasets import load_dataset, do_format ds = load_dataset("mnist", split="train") def transform(entry): entry = do_format(entry, type="torch") return entry["image"].double() ds.set_transform(transform) print(ds[0]) ``` Hey Mario, Thanks, for getting back to me. the toDouble was just an example my real life case requires many more transforms. What do you mean by: > using set_format/set_transform for the 1st transform and then passing the transformed example/batch to the 2nd transform How would that go, I thought you can't chain them? As for the custom formatter, is it possible to reference an existing formatter, in my case `torch_formatter` inside of my custom formatter? maybe I can inherit from it and just call `super.recursive_tensorize()`?
[ -0.173383891582489, -0.3966641426086426, -0.001988973468542099, 0.08512470871210098, 0.3002565801143646, -0.1064986065030098, 0.4715593159198761, 0.41056767106056213, -0.34300798177719116, -0.025087811052799225, -0.05731403827667236, 0.2118729054927826, -0.33772051334381104, 0.15243595838546753, 0.09813596308231354, -0.2815319299697876, 0.1484401822090149, -0.0018944628536701202, -0.15966230630874634, 0.1025562435388565, -0.03954582288861275, -0.06897397339344025, -0.20234304666519165, -0.13019943237304688, -0.4377153813838959, 0.16270354390144348, -0.053028181195259094, -0.26160702109336853, 0.019612155854701996, -0.16447825729846954, 0.3183306157588959, 0.1630820780992508, -0.11984401941299438, 1.1011369228363037, -0.00012726488057523966, 0.16570760309696198, 0.297679603099823, -0.07924505323171616, 0.04906608164310455, -0.4580234885215759, 0.009274668991565704, -0.3252238631248474, 0.06924246996641159, -0.3279687762260437, -0.09378951787948608, -0.4506594240665436, -0.14003245532512665, -0.180186465382576, 0.5405130982398987, 0.40040189027786255, 0.10974466800689697, 0.1605442315340042, 0.04546850174665451, -0.03718745708465576, 0.1353292167186737, 0.3832053244113922, -0.03883238881826401, -0.03199051693081856, 0.06778973340988159, 0.3344501852989197, 0.3293567895889282, 0.3871670067310333, -0.31800490617752075, -0.039851054549217224, 0.17927788197994232, 0.12192587554454803, -0.24130001664161682, -0.27603209018707275, -0.10166400671005249, 0.1811322569847107, 0.26012930274009705, -0.27563387155532837, -0.38893982768058777, -0.2855861783027649, -0.09889478236436844, -0.1241721361875534, 0.1600763499736786, 0.06457976996898651, -0.023059047758579254, -0.08130048215389252, -0.38786381483078003, -0.01283329725265503, -0.19938427209854126, 0.2586260437965393, -0.1516418159008026, 0.06616441905498505, -0.061014167964458466, 0.19390657544136047, -0.0798904299736023, 0.16578316688537598, 0.32643723487854004, -0.12184061110019684, 0.2953488230705261, 0.23716452717781067, -0.21773432195186615, -0.08365415036678314, 0.003365948796272278, -0.44677478075027466, -0.12055112421512604, 0.20676849782466888, 0.17099004983901978, -0.08596549928188324, -0.13843248784542084, -0.034279316663742065, 0.21625277400016785, 0.5362661480903625, -0.1293307989835739, 0.258426308631897, 0.286166250705719, -0.40399616956710815, 0.120122529566288, -0.08797712624073029, 0.3658011257648468, -0.5173191428184509, -0.05232580751180649, 0.18035626411437988, 0.5482801795005798, -0.1247546523809433, 0.19354188442230225, -0.30627456307411194, -0.24076762795448303, -0.3888603150844574, 0.14509645104408264, 0.10273893177509308, -0.06880951672792435, 0.5889657139778137, 0.19181379675865173, 0.18132631480693817, 0.036248110234737396, 0.07531516253948212, -0.048611320555210114, 0.1307315230369568, -0.27670198678970337, 0.08041491359472275, 0.13981850445270538, -0.4370960593223572, 0.004722148180007935, 0.5876429080963135, 0.11732174456119537, -0.01904279738664627, -0.013270735740661621, -0.4007991850376129, 0.4236960709095001, 0.05057733878493309, -0.27755552530288696, 0.42001646757125854, 0.020395226776599884, 0.2338567078113556, -0.2247326672077179, 0.14805462956428528, -0.4129296541213989, -0.20015272498130798, -0.07018530368804932, 0.03849097713828087, -0.06272928416728973, 0.20433251559734344, 0.0802653357386589, 0.20950765907764435, 0.5958109498023987, -0.19324085116386414, 0.03690473735332489, -0.32222941517829895, -0.06573021411895752, -0.33414918184280396, 0.24910575151443481, -0.12277877330780029, -0.25191253423690796, -0.1512453705072403, 0.3401571214199066, 0.19385963678359985, 0.27105996012687683, 0.26412561535835266, -0.06556995213031769, 0.24016109108924866, -0.20460331439971924, -0.15010611712932587, 0.46506136655807495, -0.35243406891822815, -0.17472079396247864, -0.06879869848489761, 0.12399217486381531, -0.006737694144248962, 0.11935142427682877, -0.06045880168676376, 0.03291115537285805, -0.18170489370822906, -0.08558237552642822, 0.15557806193828583, -0.08332228660583496, -0.12936460971832275, -0.06034506857395172, 0.038134753704071045, 0.48276203870773315, -0.11513988673686981, 0.25527915358543396, 0.08488862216472626, -0.3647119998931885, 0.14137250185012817, -0.012202341109514236, -0.22472256422042847, -0.01557307317852974, -0.1183975487947464, -0.22954778373241425, 0.1596522033214569, 0.21780386567115784, -0.2760242521762848, -0.07195410132408142, 0.03707582503557205, -0.05308730900287628, 0.09928886592388153, 0.030171193182468414, -0.07178518176078796, -0.1008705198764801, -0.20080134272575378, -0.06859274208545685, -0.09266501665115356, 0.041524842381477356, 0.13785918056964874, 0.2290254831314087, 0.019726917147636414, -0.4461560845375061, 0.10074777901172638, 0.21449115872383118, -0.055241890251636505, -0.15928897261619568, 0.13904796540737152, -0.03694317862391472, -0.41974472999572754, -0.3684483766555786, 0.2494712471961975, 0.31125786900520325, -0.1879112720489502, -0.2314257174730301, 0.27553611993789673, -0.044675372540950775, -0.043248046189546585, -0.9472652077674866, 0.21217480301856995, 0.333730012178421, -0.15923775732517242, -0.2813180685043335, 0.2737640142440796, 0.137422114610672, -0.26548099517822266, -0.2068556249141693, 0.18383941054344177, -0.07781516015529633, 0.3816182613372803, -0.018653564155101776, -0.01316491886973381, -0.09667693078517914, -0.1590307056903839, -0.30077195167541504, -0.1163460835814476, 0.1407366245985031, -0.24321629106998444, 0.2272486686706543, -0.15410009026527405, -0.4532203674316406, -0.19810496270656586, 0.29551512002944946, 0.17129255831241608, 0.13012975454330444, -0.00777038699015975, -0.15760374069213867, 0.14935319125652313, 0.039490483701229095, -0.031133487820625305, 0.32330381870269775, 0.004038546234369278, -0.009100902825593948, 0.05878716707229614, -0.2831096351146698, -0.09262852370738983, 0.06591596454381943, 0.23601938784122467, 0.1681300848722458, 0.07828420400619507, 0.2810186743736267, 0.1538396179676056, 0.24233871698379517, 0.036358542740345, -0.10469861328601837, -0.27698034048080444, -0.3347727954387665, 0.11155492067337036, -0.4232531785964966, -0.07549876719713211, -0.4701334834098816, -0.35744887590408325, 0.15766575932502747, -0.10834479331970215, -0.24288570880889893, -0.04259048029780388, -0.1438317745923996, 0.1746424436569214, 0.0788874551653862, 0.010413497686386108, -0.14169622957706451, -0.004613038152456284, -0.1837201714515686, -0.02229771390557289, 0.08973807096481323, -0.1034768745303154, 0.31588590145111084, -0.5296101570129395, 0.3634277582168579, 0.12046787887811661, -0.40046876668930054, 0.15759135782718658, -0.313753604888916, 0.25945723056793213, 0.02686343714594841, -0.22600530087947845, 0.11212143301963806, -0.11551859974861145, 0.23394984006881714, -0.0953795313835144, 0.38768908381462097, -0.13286665081977844, 0.2314225137233734, 0.051641516387462616, -0.14518919587135315, 0.17193503677845, -0.3153870105743408, -0.12702716886997223, -0.18594807386398315, -0.14132633805274963, 0.008305948227643967, -0.2826412618160248, 0.12561607360839844, 0.11389457434415817, -0.02916673570871353, 0.1716308742761612, 0.0628737136721611, 0.2729617655277252, -0.007336750626564026, 0.008877165615558624, 0.4955156445503235, -0.31064462661743164, -0.267282098531723, -0.1489265263080597, 0.024506010115146637, 0.05404358729720116, 0.342552125453949, -0.1833389699459076, -0.26249492168426514, -0.40558353066444397, -0.0681491270661354, -0.2245256006717682, 0.23527370393276215, 0.23053742945194244, 0.23590654134750366, -0.009147867560386658, -0.08895957469940186, -0.001257278025150299, -0.010705500841140747, -0.1340351104736328, -0.008496824651956558, 0.26862668991088867, 0.14887544512748718, 0.3282218873500824, 0.5715974569320679, 0.07214747369289398, -0.267976850271225, 0.160199835896492, -0.08422970771789551, 0.07063262909650803, -0.1500246524810791, -0.5528003573417664, 0.047350313514471054, -0.1638614982366562, 0.04970857501029968, -0.11186021566390991, -0.24511325359344482, -0.010525435209274292, -0.3279157280921936, 0.23071476817131042, -0.25575628876686096, -0.12619391083717346, 0.1884855329990387, -0.11272427439689636, 0.3082696199417114, -0.25392335653305054, 0.2753121852874756, 0.12575098872184753, -0.04661933705210686, 0.25325557589530945, -0.04725378751754761, -0.043867453932762146, 0.1515539288520813, -0.17003557085990906, -0.33802998065948486, -0.03779054433107376, 0.3793591260910034, 0.03681451454758644, 0.37167519330978394, -0.06881789863109589, 0.12392502278089523, 0.017460977658629417, -0.11373381316661835, 0.7581360936164856, 0.09099485725164413, -0.24336707592010498, 0.24162991344928741, -0.4791961908340454, -0.6215699911117554, -0.19415831565856934, -0.11641588062047958, 0.29548969864845276, 0.1282118707895279, 0.2799137234687805, -0.1072949543595314, -0.12560948729515076, 0.1582982987165451, 0.20581471920013428, -0.012590274214744568, -0.28287985920906067, 0.10582247376441956, -0.2535148561000824, -0.09808719158172607, -0.07758504897356033, 0.16697362065315247, 0.05130846053361893, -0.2156786322593689, 0.028191961348056793, -0.23963284492492676, -0.1563461422920227, 0.12078187614679337, -0.18146763741970062, 0.2319192886352539, 0.03264427185058594, -0.018345490097999573, 0.383343368768692, 0.3419073820114136, 0.08726692944765091, 0.14317184686660767, -0.07813701033592224, -0.24841928482055664, -0.009556438773870468, 0.12392044067382812, 0.3121984601020813, 0.17453354597091675, 0.02015373855829239, 0.05981617793440819, -0.20145587623119354, -0.05679342523217201, -0.36708158254623413, 0.3766106069087982, 0.2561665177345276, -0.04632003977894783, -0.4728269577026367, -0.7493591904640198, 0.39757978916168213, 0.34633880853652954, -0.005737408995628357, 0.2638218402862549, -0.13916006684303284, -0.4187504053115845, 0.35315197706222534, 0.09981156140565872, 1.108323097229004, 0.2814483046531677, 0.2301882654428482, 0.018662605434656143, -0.2658243179321289, 0.6219097375869751, -0.05730479955673218, 0.1954243779182434, -0.11986939609050751, -0.16440130770206451, -0.14829736948013306, -0.40921899676322937, 0.10582587122917175, 0.062319185584783554, -0.5193466544151306, 0.2729530930519104, -0.5160269141197205, -0.014438934624195099, 0.009918324649333954, 0.13541311025619507, 0.3129211664199829, -0.2805987000465393, -0.05610903725028038, 0.05321446806192398, -0.1700611710548401, 0.07311467826366425, -0.02298024669289589, 0.04158087447285652, -0.010386496782302856, -0.08269724994897842, -0.1674685776233673, 0.1188059151172638, -0.3397029638290405, 0.19595734775066376, -0.3767856955528259, -0.687148928642273, 0.16679227352142334, 0.3932630121707916, 0.40488722920417786, -0.05921484902501106, -0.03399623557925224, 0.0373714342713356, 0.13782748579978943, 0.22269350290298462, -0.2535044848918915, -0.29048845171928406, 0.5217903852462769, 0.027397289872169495, 0.07529833912849426, 0.1286490112543106, 0.028713032603263855, 0.11883148550987244, -0.1885453760623932, 0.13040101528167725, 0.20725210011005402, -0.06114065647125244, -0.17805147171020508, 0.22812625765800476, 0.3971177637577057, -0.14329586923122406, 0.02864319086074829, 0.11450567841529846, -0.023322926834225655, 0.5721790790557861, -0.5133671164512634, -0.07554368674755096, -0.033481039106845856, 0.18531189858913422, 0.38250279426574707, -0.16222205758094788, 0.4830321669578552, 0.24188534915447235, -0.055834509432315826, 0.08623334765434265, 0.058071985840797424, 0.0355200469493866, -0.44487789273262024, 0.45342516899108887, -0.17814336717128754, 0.06661468744277954, -0.3262183368206024, 0.17163430154323578, -0.0022853680420666933, -0.10573533177375793, -0.10453864187002182, -0.02745126187801361, -0.198368102312088, -0.15705274045467377, 0.4604623317718506, 0.39464208483695984, 0.051940567791461945, 0.4528391361236572, 0.06389166414737701, 0.3341320753097534, -0.19413596391677856, -0.041482262313365936, 0.12504515051841736, 0.2670215666294098, -0.024209320545196533, 0.15539753437042236, -0.0039003677666187286, -0.16614118218421936, -0.11186986416578293, 0.16953179240226746, 0.06736035645008087, -0.11871987581253052, -0.339508056640625, 0.12425992637872696, 0.19895243644714355, -0.24607452750205994, 0.002063460648059845, -0.06781738251447678, 0.2085391879081726, -0.12557105720043182, 0.17008031904697418, 0.5191417932510376, -0.09027988463640213, 0.3716624975204468, -0.0027707302942872047, 0.0454830676317215, -0.13044998049736023, 0.1849232316017151, 0.06560085713863373, 0.11317075788974762, 0.3296266794204712, 0.3430864214897156, 0.15763387084007263, -0.027126118540763855, -0.28918540477752686, -0.08003009855747223, 0.3207082748413086, -0.06985649466514587, -0.23000894486904144, -0.1770685464143753, 0.03868739306926727, -0.09193871170282364, 0.3547324538230896, 0.1794002503156662, -0.22297562658786774, 0.23662078380584717, 0.2691662609577179, 0.06298625469207764, 0.12005725502967834, 0.06449653953313828, 0.04980703443288803, 0.22904634475708008, -0.03290531784296036, 0.17913585901260376, -0.057405985891819, 0.3177865743637085, -0.2771375775337219, 0.20637714862823486, 0.010044604539871216, -0.33534643054008484, 0.440229207277298, 0.27764105796813965, -0.13474969565868378, 0.18395085632801056, 0.18130788207054138, -0.16927653551101685, 0.04817235469818115, -0.18906421959400177, 0.32752370834350586, 0.49105754494667053, 0.49330592155456543, -0.19564974308013916, 0.45143741369247437, 0.03710883855819702, -0.1423291563987732, -0.09592550247907639, 0.04904258996248245, 0.3771512508392334, -0.02508578822016716, 0.290386438369751, -0.11607462167739868, -0.4149610102176666, 0.07646335661411285, 0.21310830116271973, 0.08805853128433228, -0.0049897655844688416, -0.20739629864692688, -0.0770050510764122, 0.025675401091575623, -0.07142390310764313, -0.02217203751206398, 0.06574845314025879, 0.3355225920677185, 0.2219773381948471, -0.1708451360464096, 0.0825420469045639, -0.10225066542625427, 0.17484448850154877, 0.24387645721435547, -0.064729705452919, 0.12166862189769745, 0.40192437171936035, -0.06367944926023483, 0.029628828167915344, 0.6846855878829956, 0.3028629720211029, 0.5529243350028992, -0.2558717131614685, -0.1839372217655182, 0.027198251336812973, 0.10016661137342453, 0.09390504658222198, 0.18732821941375732, -0.09151524305343628, -0.28507745265960693, 0.27088820934295654, 0.04326464235782623, -0.17883004248142242, 0.21640554070472717, -0.2084091156721115, 0.28891533613204956, -0.3954181373119354, 0.40397703647613525, 0.007741931825876236, -0.24522890150547028, 0.24773436784744263, -0.015674609690904617, -0.43475478887557983, -0.1901697814464569, 0.5574563145637512, 0.018458928912878036, -0.0025407373905181885, -0.12423661351203918, 0.01854332908987999, 0.37867799401283264, 0.4272034764289856, 0.010589887388050556, 0.36851125955581665, 0.03762611374258995, 0.006769031286239624, -0.176901176571846, 0.07187911123037338, -0.005543929059058428, 0.17089451849460602, -0.07730104774236679, -0.0389493927359581, 0.017661884427070618, 0.06512463092803955, 0.44840991497039795, -0.522437334060669, 0.011682860553264618, 0.31606587767601013, -0.15324118733406067, -0.16156502068042755, -0.13482865691184998, 0.020057154819369316, 0.17962072789669037, -0.25249481201171875, 0.1360705941915512, -0.044810522347688675, 0.030123695731163025, -0.06932573020458221, 0.09885982424020767, 0.2552761733531952, -0.03517591580748558, 0.6199276447296143, 0.4730459749698639, 0.5526522397994995, -0.10017728805541992, 0.15949535369873047, 0.05899069085717201, 0.08213920891284943, -0.4108630120754242, 0.13639411330223083, -0.04259543865919113, 0.24419137835502625, -0.5851110219955444, -0.48502659797668457, -0.15392839908599854, 0.2738337814807892, -0.060026053339242935, -0.019489333033561707, -0.021831609308719635, 0.04650376737117767, -0.05291558429598808, -0.17866460978984833, 0.14411398768424988, 0.40821659564971924, -0.22202512621879578, 0.18581239879131317, -0.5796849727630615, -0.2595532536506653, 0.48833996057510376, -0.45214930176734924, -0.3888915777206421, -0.22880299389362335, -0.18841826915740967, -0.23047016561031342, 0.3575030565261841, -0.4621051847934723, -0.4032467305660248, 0.15436530113220215, -0.005325768142938614, -0.2295612245798111, 0.1878831833600998, 0.0838659256696701, -0.32923221588134766, -0.08596275746822357, 0.3283292055130005, 0.13915327191352844, -0.18979910016059875, -0.2665932774543762, -0.11479689925909042 ]
https://github.com/huggingface/datasets/issues/5910
> How would that go, I thought you can't chain them? Yes, they cannot be chained. This is what I meant: ```python ds.set_transform(first_transform) # calling the 2nd transform on each accessed batch second_transform(ds[2:3]) ``` > As for the custom formatter, is it possible to reference an existing formatter, in my case torch_formatter inside of my custom formatter? > >maybe I can inherit from it and just call super.recursive_tensorize()? Yes, subclassing makes the most sense.
Cannot use both set_format and set_transform
### Describe the bug I need to process some data using the set_transform method but I also need the data to be formatted for pytorch before processing it. I don't see anywhere in the documentation something that says that both methods cannot be used at the same time. ### Steps to reproduce the bug ``` from datasets import load_dataset ds = load_dataset("mnist", split="train") ds.set_format(type="torch") def transform(entry): return entry["image"].double() ds.set_transform(transform) print(ds[0]) ``` ### Expected behavior It should print the pytorch tensor image as a double, but it errors because "entry" in the transform function doesn't receive a pytorch tensor to begin with, it receives a PIL Image -> entry.double() errors because entry isn't a pytorch tensor. ### Environment info Latest versions. ### Note: It would be at least handy to have access to a function that can do the dataset.set_format in the set_transform function. Something like: ``` from datasets import load_dataset, do_format ds = load_dataset("mnist", split="train") def transform(entry): entry = do_format(entry, type="torch") return entry["image"].double() ds.set_transform(transform) print(ds[0]) ```
74
Cannot use both set_format and set_transform ### Describe the bug I need to process some data using the set_transform method but I also need the data to be formatted for pytorch before processing it. I don't see anywhere in the documentation something that says that both methods cannot be used at the same time. ### Steps to reproduce the bug ``` from datasets import load_dataset ds = load_dataset("mnist", split="train") ds.set_format(type="torch") def transform(entry): return entry["image"].double() ds.set_transform(transform) print(ds[0]) ``` ### Expected behavior It should print the pytorch tensor image as a double, but it errors because "entry" in the transform function doesn't receive a pytorch tensor to begin with, it receives a PIL Image -> entry.double() errors because entry isn't a pytorch tensor. ### Environment info Latest versions. ### Note: It would be at least handy to have access to a function that can do the dataset.set_format in the set_transform function. Something like: ``` from datasets import load_dataset, do_format ds = load_dataset("mnist", split="train") def transform(entry): entry = do_format(entry, type="torch") return entry["image"].double() ds.set_transform(transform) print(ds[0]) ``` > How would that go, I thought you can't chain them? Yes, they cannot be chained. This is what I meant: ```python ds.set_transform(first_transform) # calling the 2nd transform on each accessed batch second_transform(ds[2:3]) ``` > As for the custom formatter, is it possible to reference an existing formatter, in my case torch_formatter inside of my custom formatter? > >maybe I can inherit from it and just call super.recursive_tensorize()? Yes, subclassing makes the most sense.
[ -0.18959437310695648, -0.3872321844100952, -0.005772851407527924, 0.06828268617391586, 0.24726474285125732, -0.04113319516181946, 0.5087500810623169, 0.3649783134460449, -0.31870144605636597, -0.07594459503889084, -0.12077987194061279, 0.19695761799812317, -0.2688393294811249, 0.13158273696899414, 0.06850946694612503, -0.2538204789161682, 0.10692033171653748, -0.035088807344436646, -0.18008238077163696, 0.1554124653339386, -0.04358114302158356, -0.06402546912431717, -0.19532278180122375, -0.11469593644142151, -0.40405330061912537, 0.12475544959306717, -0.038630206137895584, -0.26499468088150024, 0.06334426254034042, -0.21937128901481628, 0.320310115814209, 0.14724421501159668, -0.1572762131690979, 1.080014944076538, -0.00012893912207800895, 0.1451251208782196, 0.2563421130180359, -0.0401449128985405, 0.026785291731357574, -0.44769924879074097, 0.034499093890190125, -0.34002357721328735, 0.09487515687942505, -0.3615415692329407, -0.07807723432779312, -0.495805561542511, -0.15676036477088928, -0.17448297142982483, 0.5467052459716797, 0.3720798194408417, 0.10797330737113953, 0.21125192940235138, 0.07458692789077759, -0.05246038734912872, 0.05896444618701935, 0.4164884090423584, -0.060246922075748444, 0.03607066720724106, 0.020892120897769928, 0.3864797353744507, 0.2687520980834961, 0.24883879721164703, -0.33461201190948486, -0.015284367837011814, 0.16665387153625488, 0.13816118240356445, -0.2808755934238434, -0.2671360969543457, -0.06215773895382881, 0.13418671488761902, 0.3042801022529602, -0.29112911224365234, -0.35557034611701965, -0.2905392050743103, -0.048208680003881454, -0.10651026666164398, 0.22492024302482605, 0.06876818090677261, -0.016779623925685883, -0.02582237869501114, -0.3741339445114136, -0.04612467810511589, -0.16962996125221252, 0.299041211605072, -0.07986750453710556, 0.09016776084899902, -0.005944676697254181, 0.1564027965068817, -0.1040186956524849, 0.1986292004585266, 0.34614020586013794, -0.14811314642429352, 0.2601062059402466, 0.20566639304161072, -0.18417790532112122, -0.06443469226360321, -0.047352295368909836, -0.4701448976993561, -0.1013682559132576, 0.2255186289548874, 0.15361420810222626, -0.11425477266311646, -0.1249399483203888, -0.022064698860049248, 0.14104129374027252, 0.4799320101737976, -0.14549203217029572, 0.2944265604019165, 0.2791236639022827, -0.3590339720249176, 0.14257684350013733, -0.09373284131288528, 0.4336084723472595, -0.4815538227558136, -0.022835835814476013, 0.14390775561332703, 0.5473620295524597, -0.11828115582466125, 0.16817301511764526, -0.2565690875053406, -0.2634541392326355, -0.40496379137039185, 0.11692827194929123, 0.018180690705776215, -0.008063960820436478, 0.5267443060874939, 0.2458338886499405, 0.2179265320301056, 0.03921274095773697, 0.062463704496622086, -0.011945005506277084, 0.1006246954202652, -0.29365211725234985, 0.12762537598609924, 0.13360241055488586, -0.4246355891227722, -0.015321832150220871, 0.662282407283783, 0.11519250273704529, -0.021322108805179596, 0.023994341492652893, -0.38334566354751587, 0.40876156091690063, 0.0497770719230175, -0.30062180757522583, 0.4410022497177124, 0.02654002234339714, 0.2233821600675583, -0.2197302281856537, 0.10294672846794128, -0.3799685835838318, -0.130417138338089, -0.10672000795602798, 0.03828129544854164, -0.05931352078914642, 0.23690497875213623, 0.13188126683235168, 0.20621879398822784, 0.6370275020599365, -0.18575385212898254, 0.061644647270441055, -0.3168157935142517, -0.13709762692451477, -0.2986995577812195, 0.24935264885425568, -0.14105834066867828, -0.28807494044303894, -0.18566448986530304, 0.34210824966430664, 0.209819495677948, 0.19416359066963196, 0.26480111479759216, -0.06360523402690887, 0.25821471214294434, -0.24948431551456451, -0.23129814863204956, 0.425534725189209, -0.3081511855125427, -0.19215846061706543, -0.08480103313922882, 0.02627280354499817, 0.01069662719964981, 0.12436992675065994, -0.04999113082885742, 0.03054998815059662, -0.182460755109787, -0.07467573881149292, 0.1757763922214508, -0.07236042618751526, -0.2127102017402649, -0.0728251114487648, 0.01469181478023529, 0.44949406385421753, -0.13250264525413513, 0.21951088309288025, 0.12711206078529358, -0.31312546133995056, 0.14232772588729858, -0.022691361606121063, -0.2214474231004715, -0.012523282319307327, -0.05871554836630821, -0.2926071286201477, 0.15524375438690186, 0.16885893046855927, -0.283355176448822, -0.12628205120563507, 0.0062562525272369385, -0.007767245173454285, 0.09390115737915039, 0.023297039791941643, -0.08647492527961731, -0.07059760391712189, -0.22935834527015686, 0.004800362978130579, -0.07982683181762695, 0.042201802134513855, 0.1775791198015213, 0.20871873199939728, 0.06998934596776962, -0.44291922450065613, 0.16941484808921814, 0.22605733573436737, -0.0452764593064785, -0.1149200052022934, 0.13137203454971313, -0.02419142797589302, -0.39298906922340393, -0.32677555084228516, 0.2578551173210144, 0.28361576795578003, -0.11415085941553116, -0.24223029613494873, 0.21391040086746216, -0.08522774279117584, -0.08405080437660217, -0.9249314665794373, 0.21548962593078613, 0.3462250232696533, -0.1641034632921219, -0.28992342948913574, 0.2997417151927948, 0.10891680419445038, -0.284559965133667, -0.13502658903598785, 0.21932056546211243, -0.08898536115884781, 0.3871228098869324, -0.02930525690317154, 0.03101087361574173, -0.10882823914289474, -0.13654500246047974, -0.2955305576324463, -0.13097718358039856, 0.17170420289039612, -0.26483285427093506, 0.2524239420890808, -0.11124639958143234, -0.4593642055988312, -0.20444031059741974, 0.24727842211723328, 0.14633533358573914, 0.10931335389614105, -0.015691135078668594, -0.16199946403503418, 0.1853533387184143, 0.03492097556591034, -0.015370987355709076, 0.35362809896469116, 0.019785255193710327, 0.005067168734967709, 0.11505930125713348, -0.3288629949092865, -0.12100633233785629, 0.012042578309774399, 0.2825683653354645, 0.10694551467895508, 0.12590250372886658, 0.3071620762348175, 0.16269241273403168, 0.24837476015090942, 0.04236841946840286, -0.10714904963970184, -0.3272857367992401, -0.3947753310203552, 0.10806114226579666, -0.43602168560028076, -0.06079304218292236, -0.45874452590942383, -0.3166176676750183, 0.17045164108276367, -0.1564757227897644, -0.27168983221054077, 0.023250272497534752, -0.1283729374408722, 0.17077070474624634, -0.03258458152413368, 0.041227228939533234, -0.1528831124305725, -0.06712734699249268, -0.20192262530326843, 0.025146637111902237, 0.09083622694015503, -0.0988023579120636, 0.3460651636123657, -0.5245147943496704, 0.4567711651325226, 0.16009332239627838, -0.4263726472854614, 0.1439892053604126, -0.24845823645591736, 0.21245473623275757, 0.06675820052623749, -0.254128634929657, 0.07144876569509506, -0.14522236585617065, 0.2315441370010376, -0.17773966491222382, 0.37171196937561035, -0.11017616093158722, 0.2476392239332199, 0.0172615647315979, -0.1382349133491516, 0.19890817999839783, -0.3422226011753082, -0.09122738242149353, -0.17758244276046753, -0.14015653729438782, -0.020125366747379303, -0.31378963589668274, 0.12692023813724518, 0.08649943768978119, -0.08436568081378937, 0.17699402570724487, 0.005797099322080612, 0.29084503650665283, -0.023017359897494316, -0.0037724003195762634, 0.5629560947418213, -0.3207933306694031, -0.2941007912158966, -0.11948151886463165, 0.013793811202049255, 0.049386411905288696, 0.30291950702667236, -0.18983051180839539, -0.24438749253749847, -0.39044880867004395, -0.004620850086212158, -0.24230358004570007, 0.20168375968933105, 0.14459408819675446, 0.2474534511566162, 0.009301535785198212, -0.03504816070199013, -0.029553338885307312, 0.048602595925331116, -0.23002733290195465, -0.016766943037509918, 0.28067833185195923, 0.16489437222480774, 0.298155814409256, 0.5204401612281799, 0.07673823833465576, -0.2817199230194092, 0.15913225710391998, -0.0428941436111927, 0.08958035707473755, -0.1808471381664276, -0.5834515690803528, 0.005578219890594482, -0.15527348220348358, 0.03616734594106674, -0.14404132962226868, -0.2724134624004364, -0.058406051248311996, -0.3519667387008667, 0.25615406036376953, -0.23613399267196655, -0.13000211119651794, 0.12340965867042542, -0.17719212174415588, 0.33969566226005554, -0.2559220790863037, 0.30504029989242554, 0.14575296640396118, -0.07352703809738159, 0.27256670594215393, -0.04835910722613335, -0.07873471081256866, 0.1841006875038147, -0.15963703393936157, -0.31195947527885437, -0.05517762899398804, 0.37196260690689087, 0.030729547142982483, 0.37085258960723877, -0.10603117942810059, 0.10162895917892456, 0.05315955728292465, -0.0787128433585167, 0.6887109875679016, 0.13803593814373016, -0.23157726228237152, 0.2833355665206909, -0.4702876806259155, -0.6097635626792908, -0.22640123963356018, -0.06618830561637878, 0.23918485641479492, 0.1286151111125946, 0.22798359394073486, -0.1177128404378891, -0.08523337543010712, 0.16369757056236267, 0.21402738988399506, -0.010682359337806702, -0.31998884677886963, 0.1380704641342163, -0.2494453638792038, -0.04245712235569954, -0.09741884469985962, 0.1726871132850647, 0.07302313297986984, -0.19144898653030396, 0.058727867901325226, -0.23523086309432983, -0.12886685132980347, 0.14111748337745667, -0.2097804695367813, 0.18843549489974976, -0.020822616294026375, 0.02515607327222824, 0.43366947770118713, 0.33449578285217285, 0.07097402215003967, 0.1218932643532753, 0.01445743627846241, -0.19977164268493652, 0.03193451091647148, 0.08531738817691803, 0.2821671962738037, 0.1742478609085083, 0.017196092754602432, 0.12040373682975769, -0.2118811458349228, -0.09315074235200882, -0.34637847542762756, 0.28465840220451355, 0.2729063034057617, -0.046399328857660294, -0.5184569954872131, -0.7151049375534058, 0.3447672128677368, 0.3303035497665405, -0.023171082139015198, 0.2287769466638565, -0.18834923207759857, -0.4469740092754364, 0.36044779419898987, 0.1112641841173172, 1.126194953918457, 0.22195306420326233, 0.2568489611148834, 0.051613714545965195, -0.3535679876804352, 0.6970531344413757, -0.09565150737762451, 0.17338359355926514, -0.12665791809558868, -0.19184762239456177, -0.1587909460067749, -0.46091464161872864, 0.12275177985429764, 0.010445065796375275, -0.4673130214214325, 0.23838013410568237, -0.5241464972496033, 0.06365783512592316, 0.029938533902168274, 0.16736575961112976, 0.2964451014995575, -0.28151974081993103, -0.05240294337272644, 0.04550383239984512, -0.15469786524772644, 0.050250303000211716, -0.035533592104911804, 0.04909549281001091, -0.025945603847503662, -0.022226683795452118, -0.194011390209198, 0.13189393281936646, -0.2832644283771515, 0.2540861666202545, -0.39441365003585815, -0.7105313539505005, 0.19154860079288483, 0.3840290307998657, 0.4300328493118286, -0.05884074792265892, -0.03916896879673004, -0.009790947660803795, 0.09146372973918915, 0.23598390817642212, -0.23544323444366455, -0.31448474526405334, 0.5027211308479309, 0.0415128692984581, 0.10784007608890533, 0.19384802877902985, 0.07848507165908813, 0.057816438376903534, -0.19274520874023438, 0.09980025142431259, 0.16629326343536377, -0.12020593136548996, -0.20427736639976501, 0.2000930905342102, 0.451729416847229, -0.13402386009693146, 0.017291158437728882, 0.06609944999217987, -0.017612528055906296, 0.5035821795463562, -0.5354754328727722, -0.08879631757736206, -0.07264865934848785, 0.2805963158607483, 0.3898237347602844, -0.1293133795261383, 0.4952680468559265, 0.2628304958343506, -0.10483148694038391, 0.10337547957897186, 0.03890155255794525, 0.009380444884300232, -0.46545475721359253, 0.3983140289783478, -0.11511074006557465, 0.0476076602935791, -0.40813612937927246, 0.12619753181934357, 0.0639185905456543, -0.0735851526260376, -0.0901128277182579, -0.024011649191379547, -0.25054675340652466, -0.12858551740646362, 0.454709529876709, 0.3597734868526459, 0.07313106954097748, 0.4716281294822693, 0.03278997540473938, 0.31934791803359985, -0.17770713567733765, -0.07297933846712112, 0.16435620188713074, 0.2035503089427948, 0.04597187787294388, 0.15031234920024872, -0.0004048869013786316, -0.1312250792980194, -0.11459730565547943, 0.15564465522766113, 0.12277233600616455, -0.11505603790283203, -0.29980024695396423, 0.1282796859741211, 0.21358853578567505, -0.2580685615539551, -0.031356558203697205, -0.1508089005947113, 0.2467729151248932, -0.12557725608348846, 0.19412778317928314, 0.5510445833206177, -0.06340596824884415, 0.37339451909065247, -0.06318959593772888, 0.052409157156944275, -0.14371585845947266, 0.19799257814884186, 0.048461686819791794, 0.07302314043045044, 0.3328173756599426, 0.3206985294818878, 0.14211523532867432, 0.020102322101593018, -0.31983569264411926, -0.02996564283967018, 0.25913774967193604, -0.10150948911905289, -0.2184731364250183, -0.18399715423583984, 0.04232483357191086, -0.08363259583711624, 0.35837870836257935, 0.17790281772613525, -0.20820216834545135, 0.17342017590999603, 0.24230316281318665, 0.04705635458230972, 0.1096542477607727, 0.05532698333263397, 0.13660922646522522, 0.2788560390472412, -0.05564490705728531, 0.14646321535110474, -0.06018173694610596, 0.2569442391395569, -0.3277197480201721, 0.19024106860160828, 0.02091601863503456, -0.313845694065094, 0.440768837928772, 0.32654085755348206, -0.03613422065973282, 0.23858435451984406, 0.18465331196784973, -0.1585255265235901, 0.014698538929224014, -0.2345486283302307, 0.38625726103782654, 0.46307963132858276, 0.48037096858024597, -0.15379288792610168, 0.4453563392162323, 0.029839850962162018, -0.1457284837961197, -0.0880349799990654, 0.0970892459154129, 0.3337942957878113, 0.01199134811758995, 0.2662924826145172, -0.05152994394302368, -0.43992114067077637, 0.04565715044736862, 0.2207554280757904, 0.0657067522406578, 0.03257736191153526, -0.20574893057346344, -0.10824113339185715, 0.04509425163269043, -0.02999168634414673, 0.012441465631127357, 0.06105736643075943, 0.41257524490356445, 0.20387564599514008, -0.142288938164711, 0.07478195428848267, -0.037599194794893265, 0.22758951783180237, 0.15633784234523773, -0.048700325191020966, 0.12328369170427322, 0.3495718836784363, -0.01243184506893158, 0.0706816166639328, 0.6886034607887268, 0.2822166383266449, 0.5003029108047485, -0.20743809640407562, -0.19348648190498352, -0.01714671030640602, 0.10215562582015991, 0.09842939674854279, 0.24758103489875793, -0.087397500872612, -0.321710467338562, 0.29502835869789124, 0.03567995876073837, -0.1864050030708313, 0.2456778585910797, -0.21324320137500763, 0.32570523023605347, -0.3847152888774872, 0.4033007025718689, -0.007300790399312973, -0.288595974445343, 0.32755815982818604, -0.02147349715232849, -0.3703451156616211, -0.16149048507213593, 0.5759245157241821, 0.05917568877339363, -0.009172532707452774, -0.10293596237897873, 0.021286290138959885, 0.37058791518211365, 0.3500719666481018, 0.08064451813697815, 0.31453263759613037, 0.05519013851881027, 0.010723263025283813, -0.17871659994125366, 0.10432896018028259, 0.00664140097796917, 0.144392192363739, -0.11181779950857162, -0.09299351274967194, 0.045812539756298065, 0.07046029716730118, 0.5042908191680908, -0.4391940236091614, -0.009379226714372635, 0.3182736039161682, -0.14465409517288208, -0.19610443711280823, -0.1413910835981369, -0.007515858858823776, 0.07079776376485825, -0.26022058725357056, 0.13919594883918762, -0.03154325485229492, 0.03408636152744293, -0.0436800941824913, 0.07875822484493256, 0.2757837176322937, -0.025692090392112732, 0.5789204835891724, 0.5022222995758057, 0.5754956007003784, -0.08422236144542694, 0.1741449236869812, 0.03936634585261345, 0.061737310141325, -0.386305570602417, 0.19848182797431946, -0.09224643558263779, 0.2933194637298584, -0.6223616600036621, -0.42796483635902405, -0.1333290934562683, 0.3530639410018921, -0.09174469113349915, -0.04034353047609329, -0.017332136631011963, 0.08972829580307007, -0.08383424580097198, -0.12953385710716248, 0.15208128094673157, 0.3947661519050598, -0.1752171516418457, 0.24172991514205933, -0.5496973991394043, -0.2181350588798523, 0.4583556056022644, -0.4976871609687805, -0.3761168420314789, -0.1889694780111313, -0.1290878802537918, -0.17886248230934143, 0.3292146921157837, -0.4286099672317505, -0.4487591087818146, 0.1560155749320984, -0.07813861966133118, -0.20766577124595642, 0.2109891176223755, 0.05535659193992615, -0.27925291657447815, -0.10295434296131134, 0.3569948971271515, 0.11038079857826233, -0.2024092972278595, -0.3393498659133911, -0.10805428773164749 ]
https://github.com/huggingface/datasets/issues/5908
Hi ! `shard` currently returns a slow dataset by default, with examples evenly distributed in the dataset. You can get a fast dataset using `contiguous=True` (which should be the default imo): ```python dataset = dataset.shard(10, 0, contiguous=True) ``` This way you don't need to flatten_indices() and sort should be fast as well
Unbearably slow sorting on big mapped datasets
### Describe the bug For me, with ~40k lines, sorting took 3.5 seconds on a flattened dataset (including the flatten operation) and 22.7 seconds on a mapped dataset (right after sharding), which is about x5 slowdown. Moreover, it seems like it slows down exponentially with bigger datasets (wasn't able to sort 700k lines at all, with flattening takes about a minute). ### Steps to reproduce the bug ```Python from datasets import load_dataset import time dataset = load_dataset("xnli", "en", split="train") dataset = dataset.shard(10, 0) print(len(dataset)) t = time.time() # dataset = dataset.flatten_indices() # uncomment this line and it's fast dataset = dataset.sort("label", reverse=True, load_from_cache_file=False) print(f"finished in {time.time() - t:.4f} seconds") ``` ### Expected behavior Expect sorting to take the same or less time than flattening and then sorting. ### Environment info - `datasets` version: 2.12.1.dev0 (same with 2.12.0 too) - Platform: Windows-10-10.0.22621-SP0 - Python version: 3.10.10 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.1
52
Unbearably slow sorting on big mapped datasets ### Describe the bug For me, with ~40k lines, sorting took 3.5 seconds on a flattened dataset (including the flatten operation) and 22.7 seconds on a mapped dataset (right after sharding), which is about x5 slowdown. Moreover, it seems like it slows down exponentially with bigger datasets (wasn't able to sort 700k lines at all, with flattening takes about a minute). ### Steps to reproduce the bug ```Python from datasets import load_dataset import time dataset = load_dataset("xnli", "en", split="train") dataset = dataset.shard(10, 0) print(len(dataset)) t = time.time() # dataset = dataset.flatten_indices() # uncomment this line and it's fast dataset = dataset.sort("label", reverse=True, load_from_cache_file=False) print(f"finished in {time.time() - t:.4f} seconds") ``` ### Expected behavior Expect sorting to take the same or less time than flattening and then sorting. ### Environment info - `datasets` version: 2.12.1.dev0 (same with 2.12.0 too) - Platform: Windows-10-10.0.22621-SP0 - Python version: 3.10.10 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.1 Hi ! `shard` currently returns a slow dataset by default, with examples evenly distributed in the dataset. You can get a fast dataset using `contiguous=True` (which should be the default imo): ```python dataset = dataset.shard(10, 0, contiguous=True) ``` This way you don't need to flatten_indices() and sort should be fast as well
[ -0.21201182901859283, -0.14385494589805603, -0.057080596685409546, 0.17018406093120575, 0.12224605679512024, 0.0028864890336990356, 0.2648853659629822, 0.2745974659919739, -0.043997906148433685, 0.1251973956823349, -0.22299277782440186, 0.2705242931842804, -0.03344253823161125, -0.04856801778078079, -0.07284834235906601, -0.10991330444812775, 0.1028125137090683, -0.18360349535942078, 0.15897870063781738, -0.06595062464475632, -0.18718914687633514, -0.15308243036270142, -0.31371644139289856, -0.2999142110347748, -0.3590698838233948, -0.035431019961833954, -0.023513153195381165, 0.11692358553409576, -0.1270960122346878, -0.22375458478927612, 0.3198077380657196, -0.017061131075024605, -0.23257330060005188, 0.4073527455329895, -0.00011093446664744988, -0.009050443768501282, 0.28046903014183044, 0.3827647268772125, 0.035393718630075455, 0.37676340341567993, -0.09873418509960175, -0.3793034255504608, -0.3742106854915619, -0.19334498047828674, -0.05935901403427124, 0.11112135648727417, -0.09353091567754745, 0.028245501220226288, -0.10670338571071625, 0.04298305884003639, 0.17656025290489197, 0.15052972733974457, -0.0914202481508255, 0.015538770705461502, 0.4245428442955017, -0.07594911754131317, -0.12390156090259552, -0.03425509110093117, 0.2516433000564575, 0.016767188906669617, -0.2349817305803299, 0.20360279083251953, -0.309795081615448, -0.15067701041698456, 0.17265251278877258, 0.07970421016216278, -0.007845468819141388, -0.07436740398406982, 0.048103392124176025, 0.3328849971294403, -0.17307434976100922, -0.08676867932081223, -0.327695369720459, -0.5015802383422852, -0.16174930334091187, -0.40887871384620667, 0.09643908590078354, -0.219577819108963, -0.11443974077701569, -0.17802700400352478, -0.2255353033542633, 0.11588144302368164, 0.2395298182964325, 0.12776391208171844, -0.19244644045829773, 0.27251482009887695, 0.006644558161497116, -0.11940060555934906, 0.180672287940979, -0.4771305322647095, -0.025947149842977524, -0.35305216908454895, 0.038187019526958466, 0.2971104085445404, -0.6949398517608643, -0.20347097516059875, 0.3941923677921295, 0.3690475523471832, 0.0382845476269722, 0.05598128214478493, -0.20395618677139282, 0.19965384900569916, 0.1712605059146881, -0.06818707287311554, 0.10179883241653442, 0.5146191120147705, -0.15549211204051971, 0.11726204305887222, 0.37019580602645874, -0.03207825869321823, 0.1592317521572113, 0.21389149129390717, 0.2996808588504791, -0.6094205379486084, -0.006403513252735138, -0.095259889960289, 0.13500288128852844, -0.1272309422492981, -0.10067876428365707, -0.12759825587272644, 0.15574434399604797, -0.0105506032705307, 0.15394334495067596, 0.3174668252468109, -0.0882115513086319, 0.030903078615665436, -0.33955270051956177, -0.4021352529525757, -0.33725646138191223, 0.03207886219024658, -0.1642020344734192, -0.15748414397239685, -0.07741563767194748, 0.11409955471754074, 0.15343192219734192, -0.27820053696632385, -0.227758526802063, 0.16690145432949066, 0.22190815210342407, 0.28557145595550537, -0.2808119058609009, -0.02221718803048134, 0.1286666989326477, 0.3219471275806427, -0.2709770202636719, 0.2197156846523285, -0.05070899426937103, 0.020677022635936737, -0.3488897383213043, 0.23575393855571747, -0.51002436876297, -0.5210986137390137, 0.1460295170545578, 0.14001087844371796, -0.24556580185890198, 0.0006207218393683434, -0.35846295952796936, 0.17154067754745483, 0.21258407831192017, -0.004733093082904816, -0.18147814273834229, -0.2019636034965515, -0.3590187430381775, -0.003545306622982025, 0.3363107144832611, 0.0132032111287117, -0.09121523797512054, 0.23766931891441345, -0.5588264465332031, 0.3491756021976471, 0.16881099343299866, 0.5768606662750244, -0.15643665194511414, -0.006203383207321167, -0.07394268363714218, 0.21063564717769623, 0.30138495564460754, 0.10321899503469467, -0.7059488296508789, 0.21430541574954987, -0.1925285905599594, 0.1901504397392273, -0.07445552945137024, 0.3065428137779236, 0.4138936698436737, -0.2597694396972656, 0.26601576805114746, 0.3416129946708679, 0.05097123235464096, 0.1411254107952118, -0.6447843909263611, -0.028799723833799362, 0.08229239284992218, 0.475589394569397, 0.0369955338537693, -0.015521451830863953, 0.1093282550573349, -0.14898641407489777, 0.2670111358165741, 0.0755283534526825, -0.10362432897090912, 0.2531418204307556, 0.0563652403652668, -0.05798834189772606, 0.36742347478866577, -0.22476057708263397, -0.1987244188785553, 0.39195600152015686, 0.08095978200435638, -0.0756949633359909, 0.0004400014877319336, -0.20226985216140747, 0.08523856103420258, -0.016699742525815964, -0.32567787170410156, 0.131310373544693, 0.08750826120376587, -0.3332229554653168, 0.05383540689945221, 0.023622550070285797, 0.01007937639951706, -0.17408619821071625, -0.32842665910720825, -0.12527161836624146, -0.39545682072639465, 0.16348254680633545, 0.08238531649112701, -0.08717164397239685, 0.03882961720228195, -0.013180132955312729, 0.0028244731947779655, 0.019077833741903305, -0.11513425409793854, 0.11849391460418701, 0.12022106349468231, 0.10937247425317764, -0.04067232087254524, 0.39023083448410034, -0.0026223640888929367, -0.07921093702316284, -0.0115504190325737, 0.19272807240486145, -0.10757280886173248, -0.09434919059276581, -0.3480052649974823, 0.5446020364761353, -0.4415269196033478, 0.310639888048172, -0.13892236351966858, -0.028326578438282013, 0.162113219499588, 0.034768640995025635, 0.09845297783613205, 0.0783613845705986, 0.5540598630905151, 0.1344538927078247, 0.14285153150558472, 0.2652614116668701, 0.056482359766960144, 0.427335649728775, 0.6245177984237671, -0.10335181653499603, -0.11015453189611435, 0.34050917625427246, 0.07832026481628418, 0.02373041957616806, 0.09159421920776367, 0.2886643409729004, 0.06790481507778168, 0.321087121963501, 0.10661978274583817, -0.03542068228125572, 0.012238621711730957, -0.25045299530029297, 0.07410416007041931, 0.09645067900419235, -0.11483803391456604, 0.10839448869228363, 0.2373836189508438, 0.2540724277496338, -0.3622410297393799, -0.17721141874790192, -0.06858199834823608, 0.27593427896499634, -0.2134869396686554, -0.029250849038362503, -0.09005443006753922, -0.022610120475292206, -0.027916492894291878, -0.05947573482990265, -0.3535195291042328, -0.4143153131008148, 0.15994396805763245, 0.043422967195510864, -0.08007333427667618, 0.14312629401683807, 0.1304004043340683, 0.220679372549057, 0.19694964587688446, -0.3228520154953003, -0.38206470012664795, -0.08874782919883728, -0.07670547813177109, 0.10829319059848785, 0.399305522441864, 0.14361396431922913, 0.1935082972049713, 0.021691933274269104, -0.03884408250451088, -0.027257151901721954, -0.38728833198547363, -0.28321102261543274, -0.18824578821659088, 0.16887280344963074, -0.16938644647598267, -0.01018020510673523, -0.1392873078584671, -0.010713044553995132, 0.1349112093448639, 0.0648675337433815, -0.08355136960744858, 0.32251837849617004, -0.2026711404323578, -0.2538025677204132, -0.040740735828876495, -0.005958389490842819, -0.004484253004193306, -0.20273682475090027, 0.22827959060668945, -0.08427026867866516, 0.13831615447998047, -0.18853896856307983, -0.16264133155345917, 0.09710575640201569, -0.16117145121097565, -0.059490080922842026, 0.09571987390518188, -0.3888995051383972, 0.4268706738948822, 0.020391758531332016, -0.12707555294036865, -0.3341307044029236, -0.005412429571151733, -0.4718974530696869, 0.2133982628583908, -0.34016597270965576, 0.3519432544708252, -0.730770468711853, 0.37821072340011597, 0.22330796718597412, -0.12203744798898697, 0.6394097208976746, -0.01106344722211361, -0.05141681805253029, 0.13145577907562256, -0.2412736862897873, -0.14521700143814087, 0.058004509657621384, 0.10973772406578064, -0.05837022513151169, 0.3146727383136749, 0.4208328127861023, 0.5759046077728271, 0.29555755853652954, 0.2410864233970642, -0.1174650713801384, 0.19663502275943756, 0.11102345585823059, -0.28612154722213745, -0.33871302008628845, 0.1479705274105072, 0.19336700439453125, -0.19925722479820251, 0.06965630501508713, 0.35135671496391296, -0.11964143812656403, 0.15016888082027435, -0.3820248544216156, 0.34465086460113525, -0.21814727783203125, 0.05029315501451492, -0.18634860217571259, -0.076943039894104, 0.05064036697149277, 0.05792161822319031, -0.22426554560661316, -0.4887702465057373, 0.14948537945747375, -0.008362937718629837, 0.01612021215260029, -0.04949893802404404, -0.19176431000232697, -0.016528408974409103, -0.5275818705558777, 0.09287311136722565, 0.15258048474788666, 0.03742925077676773, 0.021645650267601013, -0.10095523297786713, 0.2960120439529419, 0.028153780847787857, 0.4382706582546234, 0.08802459388971329, 0.22259126603603363, 0.18724046647548676, -0.27058202028274536, -0.44582778215408325, 0.14101898670196533, -0.051037974655628204, -0.09551014006137848, 0.21736855804920197, 0.4676275849342346, -0.0971347838640213, 0.026185963302850723, 0.06435097754001617, -0.006098944693803787, -0.05004597082734108, -0.31809648871421814, -0.13089758157730103, -0.0374884158372879, 0.25267529487609863, 0.18311992287635803, -0.007766742259263992, 0.05421745404601097, -0.15596696734428406, -0.05155230686068535, -0.1862735152244568, 0.08994864672422409, 0.09229949116706848, -0.010675374418497086, 0.10010784864425659, -0.03187140077352524, 0.43464046716690063, 0.11621081829071045, 0.18253351747989655, -0.2924897372722626, 0.39339444041252136, 0.21355679631233215, -0.2021704763174057, -0.24813531339168549, 0.11160649359226227, -0.012313678860664368, 0.28250324726104736, -0.122749924659729, 0.0026416629552841187, -0.261242538690567, 0.36175060272216797, -0.242904394865036, -0.09493932127952576, 0.35531651973724365, 0.11781778931617737, -0.5517204999923706, -0.07142442464828491, 0.6204715967178345, 0.07774505019187927, -0.15530434250831604, 0.6923741698265076, 0.22453419864177704, 0.06352921575307846, 0.4097588062286377, 0.21242016553878784, 0.7731717824935913, -0.3157578706741333, 0.13896429538726807, 0.14120149612426758, 0.19951508939266205, 0.17693567276000977, 0.009173676371574402, 0.34110236167907715, -0.14851990342140198, -0.4505433738231659, 0.20342940092086792, 0.04687647521495819, -0.04954792186617851, 0.12615716457366943, -0.0013023987412452698, 0.10260992497205734, 0.008066371083259583, -0.1294509768486023, -0.22691674530506134, -0.058688558638095856, 0.2256808578968048, -0.17731831967830658, -0.37394997477531433, 0.1564873307943344, 0.09934575855731964, 0.0031164754182100296, 0.1448993980884552, 0.23962023854255676, -0.048998285084962845, 0.12775130569934845, -0.17245513200759888, -0.04034694284200668, 0.20193174481391907, 0.18491527438163757, -0.22794824838638306, -0.15034760534763336, 0.009299516677856445, 0.13735461235046387, -0.0160968117415905, 0.06567423045635223, -0.10691250115633011, 0.5022381544113159, 0.10793866217136383, 0.44247370958328247, 0.500403106212616, -0.26866835355758667, 0.06836675852537155, -0.03858226537704468, -0.010376527905464172, -0.2856920063495636, 0.050215963274240494, -0.4816550314426422, -0.5729071497917175, 0.19233757257461548, -0.1706414371728897, 0.1264394223690033, 0.009475801140069962, 0.21778641641139984, 0.14969633519649506, -0.10628221929073334, 0.18952974677085876, -0.016760095953941345, 0.12833558022975922, 0.6232466697692871, -0.2797476053237915, -0.2118465006351471, -0.05590962991118431, 0.5370905995368958, 0.09556284546852112, 0.25332799553871155, 0.06559588015079498, 0.11993733048439026, -0.4297548234462738, -0.07618474215269089, 0.18412654101848602, 0.027020663022994995, -0.11716943979263306, 0.17279423773288727, -0.3873814344406128, 0.18179334700107574, 0.11375129967927933, 0.00711613055318594, 0.02188166417181492, -0.3781437575817108, -0.23702172935009003, -0.1307774931192398, 0.059297941625118256, -0.0009743645787239075, 0.26056498289108276, 0.04726910963654518, -0.2553138732910156, 0.17471843957901, -0.1834472119808197, 0.05417550355195999, -0.3210819959640503, 0.16256916522979736, -0.008372746407985687, 0.04883041977882385, -0.013000586070120335, 0.08277300000190735, 0.2177247852087021, -0.040612101554870605, 0.014694850891828537, -0.14230915904045105, -0.012604320421814919, -0.27960050106048584, 0.007751017808914185, 0.016743093729019165, -0.07316481322050095, -0.27565252780914307, 0.08541175723075867, -0.1885482668876648, -0.24333001673221588, -0.35401788353919983, 0.1027812510728836, 0.48207104206085205, -0.027992814779281616, -0.09598923474550247, 0.17544052004814148, -0.12168058753013611, 0.054433614015579224, 0.30891385674476624, -0.11200123280286789, -0.1596411019563675, 0.10737638175487518, 0.2955437898635864, 0.00036451593041419983, 0.04819352924823761, 0.003686949610710144, 0.060802966356277466, 0.026180298998951912, -0.16832122206687927, 0.6369906067848206, -0.3283335566520691, -0.16547992825508118, 0.024154677987098694, 0.46737363934516907, 0.32200753688812256, -0.026429425925016403, -0.30249300599098206, 0.01067262515425682, 0.2052580565214157, -0.14228567481040955, -0.3004114627838135, 0.529308021068573, 0.4292939305305481, -0.03464621677994728, -0.1880834400653839, -0.30822497606277466, 0.15427841246128082, 0.008108247071504593, 0.08489145338535309, 0.2637578845024109, -0.4383579194545746, 0.29124921560287476, 0.10341568291187286, 0.22562800347805023, -0.19676078855991364, 0.25977784395217896, -0.005477322265505791, 0.010347098112106323, 0.7142409086227417, 0.039799805730581284, 0.5158810019493103, -0.25418373942375183, 0.277320921421051, -0.11851419508457184, -0.31379058957099915, 0.016340089961886406, 0.39337557554244995, -0.4783046543598175, -0.07404565811157227, 0.09486126899719238, 0.30652862787246704, -0.02161450870335102, -0.3583114445209503, -0.3250344693660736, 0.13690918684005737, -0.16820719838142395, 0.10809871554374695, 0.15190282464027405, -0.06204871088266373, 0.26271915435791016, 0.10665151476860046, 0.06601199507713318, 0.11705172806978226, 0.5047849416732788, 0.15736128389835358, -0.06181541085243225, -0.32780763506889343, 0.08376093953847885, -0.08591316640377045, 0.6023328304290771, 0.02732217311859131, -0.09397625178098679, 0.07421423494815826, -0.16003204882144928, 0.003996143117547035, 0.06759350001811981, 0.20715078711509705, 0.2868342995643616, 0.1321655511856079, -0.012834083288908005, 0.04852646216750145, -0.041235268115997314, -0.06089230626821518, 0.39555516839027405, -0.39835089445114136, 0.09526075422763824, 0.27515003085136414, 0.09371128678321838, -0.23319891095161438, -0.10164804011583328, -0.08982158452272415, 0.390229195356369, -0.09810670465230942, 0.12656912207603455, -0.15586137771606445, -0.18059098720550537, -0.16188225150108337, 0.007407419383525848, -0.06178800389170647, -0.28684622049331665, 0.3308793902397156, -0.2443666309118271, -0.05096239969134331, -0.2840435802936554, 0.10091295838356018, 0.01231401413679123, 0.48150312900543213, 0.27787545323371887, 0.06735225021839142, -0.0665045827627182, -0.171134352684021, -0.5246798992156982, -0.03411474823951721, -0.06909418106079102, 0.38236525654792786, 0.345039427280426, 0.09107688069343567, -0.15485118329524994, -0.05366183817386627, -0.08683419227600098, -0.44748467206954956, -0.22269541025161743, -0.011044846847653389, -0.2285543978214264, 0.07900450378656387, -0.2545293867588043, -0.27818235754966736, -0.22676599025726318, -0.4777582883834839, 0.2442682683467865, -0.1438872516155243, 0.06438419222831726, -0.11162319779396057, 0.27709266543388367, -0.03230677917599678, 0.27258485555648804, -0.014571122825145721, 0.32635027170181274, 0.08020283281803131, 0.2233695536851883, 0.03548470884561539, -0.19515261054039001, -0.06038710102438927, -0.16734133660793304, 0.03257777541875839, -0.1427578628063202, 0.1432703286409378, -0.18144892156124115, -0.21852298080921173, 0.00458044558763504, 0.23295089602470398, -0.1406276971101761, 0.17427238821983337, -0.15105707943439484, -0.08913722634315491, -0.07060909271240234, 0.48421767354011536, -0.09247265011072159, 0.27626174688339233, 0.15230408310890198, 0.18345043063163757, -0.10547548532485962, -0.16698923707008362, 0.4314139485359192, -0.5029057860374451, -0.06260146200656891, -0.11640486121177673, 0.10959704220294952, 0.18765750527381897, 0.009984040632843971, 0.11533574759960175, -0.2718162536621094, 0.22079521417617798, 0.21919400990009308, 0.11269528418779373, 0.4724458158016205, -0.1409250795841217, -0.02632412314414978, -0.1459992527961731, -0.05431785807013512, 0.0753476545214653, -0.27599942684173584, 0.17815297842025757, -0.11551615595817566 ]
https://github.com/huggingface/datasets/issues/5908
@lhoestq > contiguous=True (which should be the default imo) For `IterableDataset`, it's not possible to implement contiguous sharding without knowing the number of examples in advance, so setting the default value to `contiguous=True` would result in an inconsistency between `Dataset` and `IterableDataset` (when we add `IterableDataset.shard`)
Unbearably slow sorting on big mapped datasets
### Describe the bug For me, with ~40k lines, sorting took 3.5 seconds on a flattened dataset (including the flatten operation) and 22.7 seconds on a mapped dataset (right after sharding), which is about x5 slowdown. Moreover, it seems like it slows down exponentially with bigger datasets (wasn't able to sort 700k lines at all, with flattening takes about a minute). ### Steps to reproduce the bug ```Python from datasets import load_dataset import time dataset = load_dataset("xnli", "en", split="train") dataset = dataset.shard(10, 0) print(len(dataset)) t = time.time() # dataset = dataset.flatten_indices() # uncomment this line and it's fast dataset = dataset.sort("label", reverse=True, load_from_cache_file=False) print(f"finished in {time.time() - t:.4f} seconds") ``` ### Expected behavior Expect sorting to take the same or less time than flattening and then sorting. ### Environment info - `datasets` version: 2.12.1.dev0 (same with 2.12.0 too) - Platform: Windows-10-10.0.22621-SP0 - Python version: 3.10.10 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.1
46
Unbearably slow sorting on big mapped datasets ### Describe the bug For me, with ~40k lines, sorting took 3.5 seconds on a flattened dataset (including the flatten operation) and 22.7 seconds on a mapped dataset (right after sharding), which is about x5 slowdown. Moreover, it seems like it slows down exponentially with bigger datasets (wasn't able to sort 700k lines at all, with flattening takes about a minute). ### Steps to reproduce the bug ```Python from datasets import load_dataset import time dataset = load_dataset("xnli", "en", split="train") dataset = dataset.shard(10, 0) print(len(dataset)) t = time.time() # dataset = dataset.flatten_indices() # uncomment this line and it's fast dataset = dataset.sort("label", reverse=True, load_from_cache_file=False) print(f"finished in {time.time() - t:.4f} seconds") ``` ### Expected behavior Expect sorting to take the same or less time than flattening and then sorting. ### Environment info - `datasets` version: 2.12.1.dev0 (same with 2.12.0 too) - Platform: Windows-10-10.0.22621-SP0 - Python version: 3.10.10 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.1 @lhoestq > contiguous=True (which should be the default imo) For `IterableDataset`, it's not possible to implement contiguous sharding without knowing the number of examples in advance, so setting the default value to `contiguous=True` would result in an inconsistency between `Dataset` and `IterableDataset` (when we add `IterableDataset.shard`)
[ -0.2189244031906128, -0.13558702170848846, -0.03316659852862358, 0.17111873626708984, 0.07388722896575928, 0.0381171852350235, 0.2685607373714447, 0.24665917456150055, -0.07459157705307007, 0.0844036340713501, -0.24379289150238037, 0.2340613603591919, 0.018153764307498932, -0.2102927565574646, -0.08815407752990723, -0.07360907644033432, 0.11197967827320099, -0.1684662401676178, 0.0813765823841095, -0.01957741379737854, -0.1809529960155487, -0.04669642820954323, -0.35305070877075195, -0.34748220443725586, -0.3623111844062805, -0.05155143886804581, -0.053909823298454285, 0.10630883276462555, -0.07151082903146744, -0.3265530467033386, 0.3632562458515167, 0.07158271968364716, -0.21701902151107788, 0.37523379921913147, -0.00011345124949002638, -0.012471668422222137, 0.253505676984787, 0.3420891761779785, -0.02169984206557274, 0.3851478099822998, -0.09837211668491364, -0.3171716630458832, -0.3729701638221741, -0.15868346393108368, -0.06574812531471252, 0.011993024498224258, -0.07957315444946289, -0.010754436254501343, -0.15743955969810486, -0.015390198677778244, 0.1547807902097702, 0.10966528952121735, -0.12648718059062958, -0.08038021624088287, 0.2866780459880829, -0.04524264857172966, -0.14230038225650787, -0.0013513397425413132, 0.29213762283325195, -0.01648545265197754, -0.2350062131881714, 0.15033775568008423, -0.21757346391677856, -0.10656765103340149, 0.19094127416610718, 0.09469419717788696, -0.033277418464422226, -0.01916559971868992, 0.06024869158864021, 0.3179287314414978, -0.10714451223611832, -0.11528604477643967, -0.3072192072868347, -0.5444778203964233, -0.1843039095401764, -0.41219329833984375, 0.13982842862606049, -0.24543991684913635, -0.05988383665680885, -0.19531665742397308, -0.1969328373670578, 0.15775877237319946, 0.19030149281024933, 0.1463504135608673, -0.179268017411232, 0.2715305685997009, -0.012971533462405205, -0.10346074402332306, 0.16907735168933868, -0.4631960690021515, 0.03779178857803345, -0.3494938611984253, 0.04414103552699089, 0.3199200928211212, -0.6927553415298462, -0.18800091743469238, 0.41843509674072266, 0.35865795612335205, 0.10341322422027588, 0.07497169077396393, -0.1600804626941681, 0.10393443703651428, 0.12535086274147034, -0.14074046909809113, 0.1715732216835022, 0.525658130645752, -0.18203173577785492, 0.1529395580291748, 0.34758496284484863, 0.052919212728738785, 0.1570667028427124, 0.18622986972332, 0.2959839999675751, -0.5879409313201904, 0.05932316929101944, -0.11087600886821747, 0.16366751492023468, -0.12041961401700974, -0.16175995767116547, -0.16526228189468384, 0.07333572208881378, -0.0581112764775753, 0.19887791574001312, 0.23915185034275055, -0.06702455133199692, -0.031969115138053894, -0.40884682536125183, -0.36580389738082886, -0.3141354024410248, 0.08921545743942261, -0.15812963247299194, -0.19610922038555145, -0.08868512511253357, 0.17034384608268738, 0.16446688771247864, -0.29725897312164307, -0.20852819085121155, 0.1433035433292389, 0.15963004529476166, 0.2971974313259125, -0.29880309104919434, -0.08016463369131088, 0.22667725384235382, 0.3085477650165558, -0.27951040863990784, 0.22690778970718384, -0.09114484488964081, -0.0035796239972114563, -0.3619665503501892, 0.22637531161308289, -0.42116034030914307, -0.504257082939148, 0.15175245702266693, 0.10106346756219864, -0.3004957437515259, -0.023581612855196, -0.23629696667194366, 0.2125348448753357, 0.22437170147895813, -0.0951639711856842, -0.09907615184783936, -0.183110311627388, -0.37218213081359863, -0.007334457710385323, 0.32453522086143494, 0.08044158667325974, -0.15830883383750916, 0.19399493932724, -0.5173250436782837, 0.29306185245513916, 0.17122645676136017, 0.6621203422546387, -0.1357675939798355, 0.05492516607046127, -0.1443258821964264, 0.2604501247406006, 0.2548997402191162, 0.1462368220090866, -0.7229579091072083, 0.2737866938114166, -0.16832712292671204, 0.3479020297527313, -0.12233071029186249, 0.27818790078163147, 0.36442410945892334, -0.3223845958709717, 0.26762646436691284, 0.29461976885795593, 0.0012195277959108353, 0.047595828771591187, -0.6234857439994812, 0.030782029032707214, 0.0874849408864975, 0.4062100052833557, 0.004497673362493515, -0.008336242288351059, 0.11004621535539627, -0.19906479120254517, 0.3083984851837158, 0.10432376712560654, -0.05140135437250137, 0.2405492067337036, 0.05481458455324173, -0.06204308941960335, 0.4220791161060333, -0.23049670457839966, -0.24975351989269257, 0.37169313430786133, 0.09871120750904083, -0.1348634511232376, -0.04279535263776779, -0.22219218313694, 0.12078118324279785, -0.01264035701751709, -0.35091930627822876, 0.04491201043128967, 0.05895480513572693, -0.30214723944664, 0.08616375923156738, -0.01573682576417923, -0.05301995575428009, -0.0941506028175354, -0.26915279030799866, -0.1348048746585846, -0.426811158657074, 0.18587525188922882, 0.14725588262081146, -0.07419341802597046, 0.038584500551223755, 0.04142424464225769, -0.020052041858434677, -0.07690173387527466, -0.10712313652038574, 0.17845578491687775, 0.09042778611183167, 0.18913859128952026, -0.015130052343010902, 0.47706139087677, 0.06435349583625793, -0.05757518112659454, -0.0433138906955719, 0.10921092331409454, -0.1061086505651474, -0.11710643768310547, -0.3470926284790039, 0.4809029996395111, -0.5651865005493164, 0.3672885000705719, -0.08124710619449615, -0.04935385659337044, 0.22456826269626617, 0.06592420488595963, 0.0029501765966415405, 0.06942176073789597, 0.5505231618881226, 0.13765887916088104, 0.16173171997070312, 0.29068440198898315, 0.03929804265499115, 0.4324728548526764, 0.645969033241272, -0.10970208048820496, -0.162236288189888, 0.3107348680496216, 0.09316903352737427, -0.0011916384100914001, 0.11303585022687912, 0.19069255888462067, 0.17915451526641846, 0.2691693603992462, 0.16655679047107697, 0.031349338591098785, 0.009872093796730042, -0.24606110155582428, 0.08700843155384064, 0.14049088954925537, -0.04284557327628136, 0.14611609280109406, 0.209744393825531, 0.27344968914985657, -0.39708906412124634, -0.23535844683647156, -0.07137054204940796, 0.23801620304584503, -0.20412412285804749, -0.006792385131120682, -0.13650460541248322, -0.07794122397899628, -0.02869318425655365, -0.08984248340129852, -0.3195486068725586, -0.40494757890701294, 0.12215633690357208, 0.13061362504959106, -0.030556906014680862, 0.1435914933681488, 0.11033232510089874, 0.3456040620803833, 0.19279631972312927, -0.319061279296875, -0.4122529625892639, -0.06733617931604385, -0.09617655724287033, 0.08107425272464752, 0.3930322527885437, 0.06189342960715294, 0.2108074575662613, 0.07411499321460724, -0.056334543973207474, -0.09006547182798386, -0.3683851361274719, -0.24903473258018494, -0.18407291173934937, 0.1403442621231079, -0.06408243626356125, -0.05199747532606125, -0.09465280920267105, 0.06475479900836945, 0.13602545857429504, 0.09925305098295212, -0.016624893993139267, 0.25146061182022095, -0.26827070116996765, -0.31012845039367676, -0.013535447418689728, 0.028189247474074364, -0.0023851729929447174, -0.1888911873102188, 0.29210883378982544, -0.08125634491443634, 0.15581093728542328, -0.1184948980808258, -0.26451849937438965, 0.0959884375333786, -0.12051090598106384, -0.13095995783805847, 0.05276921018958092, -0.40455949306488037, 0.4225369989871979, -0.021463464945554733, -0.09656418859958649, -0.3309284448623657, -0.013776708394289017, -0.3390248119831085, 0.21154193580150604, -0.36324000358581543, 0.35364413261413574, -0.7320742011070251, 0.4108031690120697, 0.21754151582717896, -0.20344924926757812, 0.6676657795906067, -0.013734133914113045, -0.01595630869269371, 0.062168464064598083, -0.28684428334236145, -0.09536702930927277, 0.061058301478624344, 0.09990956634283066, 0.027858298271894455, 0.34167855978012085, 0.4417186379432678, 0.5991959571838379, 0.45445963740348816, 0.29518595337867737, -0.03568518906831741, 0.1105940118432045, 0.12007774412631989, -0.30664318799972534, -0.36077699065208435, 0.19485598802566528, 0.1646765172481537, -0.21655938029289246, 0.1155325174331665, 0.3085029125213623, -0.16601842641830444, 0.16439113020896912, -0.3648073375225067, 0.37474513053894043, -0.23641295731067657, 0.02824917994439602, -0.21970504522323608, -0.045766815543174744, 0.050081849098205566, 0.03969365358352661, -0.19983495771884918, -0.48958325386047363, 0.15639445185661316, -0.020838584750890732, 0.08115458488464355, -0.06731025874614716, -0.1726635992527008, -0.014342058449983597, -0.5391744375228882, 0.06991131603717804, 0.12533873319625854, 0.1388944387435913, -0.030069299042224884, -0.131042942404747, 0.31411510705947876, 0.003287486732006073, 0.5536842942237854, 0.06050671637058258, 0.13901741802692413, 0.21270085871219635, -0.30354106426239014, -0.4575555920600891, 0.11552409827709198, 0.003996454179286957, 0.036533091217279434, 0.210190549492836, 0.47650787234306335, -0.10227592289447784, -0.01642182096838951, 0.13883303105831146, -0.04884595796465874, -0.01501525193452835, -0.36023402214050293, -0.1267019808292389, -0.07747182250022888, 0.28332531452178955, 0.17267540097236633, 0.018309012055397034, 0.08852741122245789, -0.07895326614379883, -0.03752472624182701, -0.1869751363992691, -0.0011530667543411255, 0.04111644625663757, 0.055911835283041, 0.014769766479730606, -0.030774883925914764, 0.49709802865982056, 0.24993085861206055, 0.1996576488018036, -0.24892285466194153, 0.4527219533920288, 0.23444774746894836, -0.2242686003446579, -0.20983253419399261, 0.10955095291137695, 0.008454475551843643, 0.3211510479450226, -0.14076796174049377, -0.044610537588596344, -0.2302567958831787, 0.34050413966178894, -0.24390581250190735, -0.13162705302238464, 0.34953224658966064, 0.12281806766986847, -0.608566164970398, -0.038942232728004456, 0.5762242078781128, 0.13773098587989807, -0.166748508810997, 0.7921873927116394, 0.1936999261379242, 0.03886791318655014, 0.3351433277130127, 0.1550755351781845, 0.7207498550415039, -0.22439631819725037, 0.1250840574502945, 0.16308414936065674, 0.20523788034915924, 0.10592591017484665, 0.003946088254451752, 0.3836374282836914, -0.11262096464633942, -0.5553600192070007, 0.18568503856658936, 0.035248786211013794, 0.023766275495290756, 0.09184545278549194, -0.004682034254074097, 0.1362372636795044, 0.07428333163261414, -0.0986533910036087, -0.19719862937927246, -0.0632724016904831, 0.14040996134281158, -0.21264299750328064, -0.292108416557312, 0.12952835857868195, 0.14979082345962524, 0.0647125095129013, 0.12494246661663055, 0.24043701589107513, 0.051605403423309326, 0.1824212521314621, -0.1962435245513916, -0.03746901452541351, 0.17751051485538483, 0.10577866435050964, -0.16089405119419098, -0.10833466053009033, 0.00394691526889801, 0.15991391241550446, 0.017021972686052322, -0.03502056375145912, -0.1220763549208641, 0.533793568611145, 0.09993305802345276, 0.4421008825302124, 0.4906414747238159, -0.2781437933444977, 0.09345356374979019, -0.05620163679122925, 0.034975484013557434, -0.29339855909347534, 0.05343160778284073, -0.46894559264183044, -0.5654316544532776, 0.12619438767433167, -0.16549238562583923, 0.08837057650089264, 0.0353572815656662, 0.21985581517219543, 0.14084413647651672, -0.09947910904884338, 0.15305931866168976, -0.0012903865426778793, 0.14805364608764648, 0.6353698968887329, -0.35737213492393494, -0.22294685244560242, -0.09488368779420853, 0.568748950958252, 0.044762708246707916, 0.23752985894680023, 0.1097249984741211, 0.08760447055101395, -0.42932572960853577, -0.059729840606451035, 0.09203042089939117, 0.062377095222473145, -0.18496161699295044, 0.18841427564620972, -0.41494694352149963, 0.25324779748916626, 0.11257276684045792, 0.06829647719860077, 0.0018908476922661066, -0.36851292848587036, -0.26093482971191406, -0.1345691680908203, 0.03427752107381821, -0.03666628152132034, 0.3122583329677582, 0.1089235171675682, -0.2599240839481354, 0.1419363021850586, -0.15076744556427002, 0.06260613352060318, -0.28895121812820435, 0.08941300213336945, 0.0018144100904464722, 0.027666397392749786, -0.10993337631225586, 0.07371865957975388, 0.265921026468277, -0.022559702396392822, 0.002299003303050995, -0.05939656123518944, 0.046078652143478394, -0.24186277389526367, -0.0232464037835598, 0.03417979180812836, -0.05395396053791046, -0.32433071732521057, 0.09131249785423279, -0.20972001552581787, -0.2775398790836334, -0.3967199921607971, 0.15459933876991272, 0.42957594990730286, -0.01566021889448166, -0.13189752399921417, 0.1881830394268036, -0.1887531280517578, 0.01587013155221939, 0.296644926071167, -0.04253595694899559, -0.2096806764602661, 0.12640337646007538, 0.2769513428211212, -0.08817803859710693, -0.006305240094661713, 0.02743084728717804, 0.10021722316741943, 0.10397247225046158, -0.18629451096057892, 0.6015239357948303, -0.3279764652252197, -0.18344497680664062, 0.08289749175310135, 0.47525519132614136, 0.38572385907173157, -0.05258806049823761, -0.33165568113327026, -0.036347754299640656, 0.15838918089866638, -0.1611865907907486, -0.2619996666908264, 0.47803035378456116, 0.44473597407341003, -0.03475749120116234, -0.13993337750434875, -0.25799351930618286, 0.17928090691566467, 0.07717357575893402, 0.06258981674909592, 0.310463011264801, -0.47905433177948, 0.26739394664764404, 0.15568816661834717, 0.20644345879554749, -0.1291796863079071, 0.2983436584472656, -0.020944098010659218, -0.010445687919855118, 0.7147560715675354, -0.034346792846918106, 0.5142062306404114, -0.18368366360664368, 0.253136545419693, -0.06191418692469597, -0.298143208026886, -0.03240358456969261, 0.3592173755168915, -0.39955374598503113, -0.09516538679599762, 0.10274211317300797, 0.2232762724161148, -0.009821522980928421, -0.36004430055618286, -0.3035701811313629, 0.1259741336107254, -0.18197444081306458, 0.07750299572944641, 0.08926637470722198, -0.05979540944099426, 0.25042444467544556, 0.06839419901371002, 0.029226327314972878, 0.07657895982265472, 0.5702047944068909, 0.09093625098466873, -0.04783383011817932, -0.4539392590522766, 0.16582445800304413, -0.16754719614982605, 0.6524079442024231, 0.014046162366867065, -0.02260231040418148, 0.014041926711797714, -0.17973367869853973, -0.01501520723104477, 0.1491306871175766, 0.2102748304605484, 0.2983306348323822, 0.20103006064891815, -0.019507447257637978, -0.0027191992849111557, -0.044269729405641556, -0.0023591555655002594, 0.4249011278152466, -0.45216888189315796, 0.07072160392999649, 0.30450937151908875, 0.0441550686955452, -0.16439944505691528, 0.016657888889312744, -0.06744270026683807, 0.38747721910476685, -0.1830277144908905, 0.12591272592544556, -0.2110590934753418, -0.1485481709241867, -0.057351935654878616, -0.041950713843107224, 0.009186193346977234, -0.3294104039669037, 0.3046143054962158, -0.3151661455631256, 0.009883224964141846, -0.2868300676345825, 0.08545328676700592, -0.016311056911945343, 0.5051758885383606, 0.2802199423313141, -0.0022561075165867805, -0.0662328451871872, -0.19254574179649353, -0.516211986541748, -0.09490454196929932, -0.08057244122028351, 0.3852992653846741, 0.3645939528942108, 0.17615771293640137, -0.2316904366016388, -0.10778326541185379, -0.033766038715839386, -0.46457189321517944, -0.18188431859016418, 0.0938422679901123, -0.19233819842338562, 0.039845678955316544, -0.20145589113235474, -0.23095466196537018, -0.2336311936378479, -0.46336638927459717, 0.22405803203582764, -0.17036977410316467, 0.025145329535007477, -0.09012038260698318, 0.2293989360332489, 0.017141714692115784, 0.24752241373062134, -0.04256853461265564, 0.3537069857120514, 0.02673633024096489, 0.23142287135124207, 0.04120223969221115, -0.26319247484207153, -0.0427805595099926, -0.20676487684249878, 0.1299877166748047, -0.14254248142242432, 0.09143155813217163, -0.16919445991516113, -0.18901889026165009, -0.0029320642352104187, 0.14717769622802734, -0.1261337697505951, 0.24173550307750702, -0.16900306940078735, -0.038922712206840515, -0.11964774131774902, 0.5645756125450134, -0.06818558275699615, 0.2899303734302521, 0.1497611701488495, 0.22990252077579498, -0.1364302933216095, -0.17974728345870972, 0.4509126842021942, -0.5497795343399048, -0.06166495010256767, -0.07957375049591064, 0.06566991657018661, 0.26743265986442566, -0.06531534343957901, 0.13935904204845428, -0.2811267077922821, 0.30341219902038574, 0.1825440376996994, 0.13088887929916382, 0.486968994140625, -0.09395258873701096, 0.012975670397281647, -0.16522696614265442, 0.01685084030032158, 0.12417422980070114, -0.3565710783004761, 0.22251608967781067, -0.13558819890022278 ]
https://github.com/huggingface/datasets/issues/5908
Actually sharded iterable datasets are made of sub iterables that generally yield contiguous data no ? So in a way it's possible to shard an iterable dataset contiguously. If the dataset is made of one shard it's indeed not possible to shard it contiguously though
Unbearably slow sorting on big mapped datasets
### Describe the bug For me, with ~40k lines, sorting took 3.5 seconds on a flattened dataset (including the flatten operation) and 22.7 seconds on a mapped dataset (right after sharding), which is about x5 slowdown. Moreover, it seems like it slows down exponentially with bigger datasets (wasn't able to sort 700k lines at all, with flattening takes about a minute). ### Steps to reproduce the bug ```Python from datasets import load_dataset import time dataset = load_dataset("xnli", "en", split="train") dataset = dataset.shard(10, 0) print(len(dataset)) t = time.time() # dataset = dataset.flatten_indices() # uncomment this line and it's fast dataset = dataset.sort("label", reverse=True, load_from_cache_file=False) print(f"finished in {time.time() - t:.4f} seconds") ``` ### Expected behavior Expect sorting to take the same or less time than flattening and then sorting. ### Environment info - `datasets` version: 2.12.1.dev0 (same with 2.12.0 too) - Platform: Windows-10-10.0.22621-SP0 - Python version: 3.10.10 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.1
45
Unbearably slow sorting on big mapped datasets ### Describe the bug For me, with ~40k lines, sorting took 3.5 seconds on a flattened dataset (including the flatten operation) and 22.7 seconds on a mapped dataset (right after sharding), which is about x5 slowdown. Moreover, it seems like it slows down exponentially with bigger datasets (wasn't able to sort 700k lines at all, with flattening takes about a minute). ### Steps to reproduce the bug ```Python from datasets import load_dataset import time dataset = load_dataset("xnli", "en", split="train") dataset = dataset.shard(10, 0) print(len(dataset)) t = time.time() # dataset = dataset.flatten_indices() # uncomment this line and it's fast dataset = dataset.sort("label", reverse=True, load_from_cache_file=False) print(f"finished in {time.time() - t:.4f} seconds") ``` ### Expected behavior Expect sorting to take the same or less time than flattening and then sorting. ### Environment info - `datasets` version: 2.12.1.dev0 (same with 2.12.0 too) - Platform: Windows-10-10.0.22621-SP0 - Python version: 3.10.10 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.1 Actually sharded iterable datasets are made of sub iterables that generally yield contiguous data no ? So in a way it's possible to shard an iterable dataset contiguously. If the dataset is made of one shard it's indeed not possible to shard it contiguously though
[ -0.13646171987056732, -0.18474647402763367, -0.05922950431704521, 0.1945437639951706, 0.06869810074567795, 0.07122878730297089, 0.29514777660369873, 0.2420136034488678, -0.16331401467323303, 0.1213812381029129, -0.23810333013534546, 0.21294495463371277, 0.036136556416749954, -0.20064792037010193, -0.03800460696220398, -0.09161756932735443, 0.09013259410858154, -0.152484729886055, 0.05665969103574753, -0.052993293851614, -0.1506797820329666, -0.08560764789581299, -0.3279310464859009, -0.3508088290691376, -0.2805514931678772, -0.036744508892297745, -0.08409381657838821, 0.07888999581336975, -0.1045549139380455, -0.25400662422180176, 0.37665456533432007, 0.018810026347637177, -0.2518700063228607, 0.39793694019317627, -0.00011301617632852867, 0.04033243656158447, 0.22819262742996216, 0.29591482877731323, -0.03184567391872406, 0.34855884313583374, -0.12696155905723572, -0.31159117817878723, -0.3816390931606293, -0.1839791089296341, -0.05999220907688141, 0.10394200682640076, -0.03762705996632576, -0.053179554641246796, -0.12447915226221085, -0.0571662113070488, 0.13304999470710754, 0.14157810807228088, -0.15858350694179535, -0.059878185391426086, 0.3632982075214386, 0.014152010902762413, -0.2082415521144867, 0.014996577054262161, 0.23472069203853607, 0.05059678852558136, -0.22482015192508698, 0.15033113956451416, -0.21850766241550446, -0.080967478454113, 0.16958439350128174, 0.07600590586662292, -0.04683941230177879, -0.07172486931085587, 0.039506688714027405, 0.31909120082855225, -0.16652999818325043, -0.07478688657283783, -0.36727502942085266, -0.5235940217971802, -0.22081023454666138, -0.43008852005004883, 0.1229533702135086, -0.14183180034160614, -0.028515905141830444, -0.21610447764396667, -0.14440853893756866, 0.16115741431713104, 0.1902419924736023, 0.09680776298046112, -0.1398647576570511, 0.2610795497894287, 0.005657695233821869, -0.07039318978786469, 0.1344437599182129, -0.42348116636276245, 0.08649372309446335, -0.3159657418727875, 0.06717802584171295, 0.3219389319419861, -0.7342774868011475, -0.17481502890586853, 0.3409428894519806, 0.31001266837120056, 0.13325753808021545, 0.08374953269958496, -0.10838358104228973, 0.10403615236282349, 0.21026484668254852, -0.13602064549922943, 0.20240697264671326, 0.41372260451316833, -0.22760888934135437, 0.14583629369735718, 0.2453763335943222, -0.006316568702459335, 0.13725323975086212, 0.1396554708480835, 0.28521814942359924, -0.5839833617210388, -0.015826627612113953, -0.15100829303264618, 0.1545388549566269, -0.02802138775587082, -0.16583360731601715, -0.13018210232257843, 0.04010626673698425, -0.05594789981842041, 0.15725813806056976, 0.2664196491241455, 0.03767270967364311, -0.11049091815948486, -0.40980595350265503, -0.32589882612228394, -0.3049007058143616, 0.04720231518149376, -0.13040171563625336, -0.20030289888381958, -0.1139148399233818, 0.1631031483411789, 0.09500301629304886, -0.2968939542770386, -0.2606416642665863, 0.12313046306371689, 0.16244211792945862, 0.28750741481781006, -0.29582563042640686, -0.08780517429113388, 0.2739306390285492, 0.30563002824783325, -0.27047017216682434, 0.22772184014320374, -0.0416000559926033, 0.01909729093313217, -0.3600250780582428, 0.18536747992038727, -0.42691001296043396, -0.4233030080795288, 0.14692622423171997, 0.08055637031793594, -0.22455058991909027, -0.006470818072557449, -0.22854673862457275, 0.14471173286437988, 0.31216031312942505, -0.1443324089050293, -0.029620200395584106, -0.19743876159191132, -0.40590861439704895, 0.008579351007938385, 0.281622052192688, 0.02101503312587738, -0.16010522842407227, 0.1991388499736786, -0.5373950004577637, 0.3258516192436218, 0.2107929140329361, 0.6992548108100891, -0.06649553030729294, 0.0006621219217777252, -0.17951837182044983, 0.35013705492019653, 0.26949259638786316, 0.1987220197916031, -0.7017849683761597, 0.36909523606300354, -0.21520012617111206, 0.34626758098602295, -0.05244769528508186, 0.27067333459854126, 0.34482166171073914, -0.3176250755786896, 0.22093984484672546, 0.18951652944087982, -0.008637557737529278, -0.016487043350934982, -0.613579511642456, 0.10074840486049652, 0.09910863637924194, 0.32904160022735596, 0.0479874387383461, 0.04123914986848831, 0.11223237216472626, -0.22543160617351532, 0.33740195631980896, 0.09009922295808792, -0.005611389875411987, 0.23375338315963745, 0.06307606399059296, -0.08912523835897446, 0.43885213136672974, -0.25006794929504395, -0.2057395577430725, 0.3908499479293823, 0.04566413164138794, -0.15251074731349945, 0.02605799213051796, -0.22399836778640747, 0.15712133049964905, 0.06398136913776398, -0.32019302248954773, 0.06596381962299347, 0.03160692751407623, -0.306028813123703, 0.11918127536773682, -0.07738041132688522, -0.08682318031787872, -0.15119649469852448, -0.37125226855278015, -0.14944548904895782, -0.454231321811676, 0.2376452088356018, 0.1549481600522995, -0.044694822281599045, 0.021431952714920044, 0.0401812344789505, -0.033320218324661255, -0.06506703048944473, -0.10637691617012024, 0.13760116696357727, 0.13643141090869904, 0.12877823412418365, -0.04353373125195503, 0.4302283525466919, 0.026533259078860283, -0.07981010526418686, -0.07194024324417114, 0.09463173151016235, -0.06308797001838684, -0.1294599026441574, -0.28769373893737793, 0.4780876636505127, -0.526978075504303, 0.4239751696586609, -0.004775039851665497, -0.008310411125421524, 0.25395986437797546, 0.04176904261112213, -0.06546734273433685, 0.10908888280391693, 0.6315596699714661, 0.11839587241411209, 0.17446815967559814, 0.3218725025653839, 0.015884116291999817, 0.4154115617275238, 0.6297898292541504, -0.12499943375587463, -0.18276247382164001, 0.2691049873828888, 0.07820120453834534, 0.01488003134727478, 0.0980101004242897, 0.20474007725715637, 0.1510305106639862, 0.23240935802459717, 0.21185171604156494, -0.019068362191319466, 0.0279155895113945, -0.23650287091732025, 0.045278988778591156, 0.149643212556839, -0.021369844675064087, 0.2112247347831726, 0.13874958455562592, 0.2827887535095215, -0.36971187591552734, -0.17968858778476715, -0.0717700719833374, 0.14692386984825134, -0.2256157249212265, 0.027009710669517517, -0.18711422383785248, -0.04449794441461563, -0.05002473294734955, 0.006676886230707169, -0.3495992124080658, -0.3661971092224121, 0.07969783246517181, 0.1338755488395691, -0.05292760208249092, 0.11643155664205551, 0.13335299491882324, 0.3359717130661011, 0.21187978982925415, -0.27055421471595764, -0.4051970839500427, -0.13196422159671783, -0.05885464698076248, 0.07169319689273834, 0.40234649181365967, 0.08882822096347809, 0.1956092268228531, 0.0855785384774208, -0.12088194489479065, -0.16168922185897827, -0.29874396324157715, -0.20315562188625336, -0.2157994657754898, 0.13082347810268402, -0.09907260537147522, -0.040488146245479584, -0.17549237608909607, 0.10084070265293121, 0.11628956347703934, 0.0704558864235878, -0.07907912880182266, 0.29651427268981934, -0.2519087493419647, -0.3070008456707001, 0.00013172626495361328, 0.08245524019002914, -0.043928734958171844, -0.15769298374652863, 0.3441412150859833, -0.01081540435552597, 0.17277944087982178, -0.14241209626197815, -0.2744925320148468, 0.06339463591575623, -0.13386811316013336, -0.11183497309684753, 0.008648261427879333, -0.4328879714012146, 0.3696866035461426, -0.03216446191072464, -0.17425349354743958, -0.32196640968322754, 0.018177345395088196, -0.3581588566303253, 0.2885804772377014, -0.33282774686813354, 0.4285087585449219, -0.659030556678772, 0.3004530072212219, 0.24776628613471985, -0.26185569167137146, 0.6203377842903137, -0.0928659439086914, -0.007463376969099045, 0.04290276765823364, -0.23756469786167145, -0.09990695863962173, 0.032352887094020844, 0.059343572705984116, 0.012102948501706123, 0.35925257205963135, 0.4862736463546753, 0.6489958167076111, 0.44261035323143005, 0.30694496631622314, -0.02573414519429207, 0.0720958560705185, 0.09092247486114502, -0.3114241063594818, -0.34040454030036926, 0.25037527084350586, 0.13718122243881226, -0.3041282892227173, 0.1402817964553833, 0.27120715379714966, -0.15981760621070862, 0.18672916293144226, -0.3029526472091675, 0.37616610527038574, -0.2515256106853485, 0.0059095509350299835, -0.21210280060768127, -0.046239662915468216, 0.11379026621580124, 0.05464906990528107, -0.14860987663269043, -0.47762826085090637, 0.07196526974439621, -0.04267648234963417, 0.1040492057800293, -0.016275277361273766, -0.19863645732402802, -0.05504860728979111, -0.44272443652153015, 0.03306002914905548, 0.17227938771247864, 0.14901727437973022, -0.00937516987323761, -0.18126699328422546, 0.3542442321777344, 0.024839382618665695, 0.5583298802375793, 0.10257384181022644, 0.169921413064003, 0.2231331616640091, -0.34501659870147705, -0.4377247393131256, 0.13877147436141968, 0.0323231965303421, 0.07532061636447906, 0.2116786241531372, 0.3466896414756775, -0.08672172576189041, 0.010157246142625809, 0.10050275921821594, -0.017009835690259933, -0.04981406778097153, -0.3287278711795807, -0.13769681751728058, -0.06775376945734024, 0.2659362554550171, 0.17407634854316711, -0.0025091469287872314, 0.004307501018047333, -0.09054872393608093, -0.02294164150953293, -0.2638673484325409, 0.02208281308412552, 0.01652444899082184, -0.001262068748474121, 0.001608140766620636, -0.06333866715431213, 0.47193536162376404, 0.20531904697418213, 0.24465742707252502, -0.19513730704784393, 0.4790104329586029, 0.2726324498653412, -0.17516598105430603, -0.14148759841918945, 0.10241498053073883, 0.017714910209178925, 0.34020793437957764, -0.11149461567401886, -0.09905301779508591, -0.19866061210632324, 0.32221719622612, -0.27560144662857056, -0.17126479744911194, 0.3662261366844177, 0.056877002120018005, -0.6655893325805664, -0.016690146178007126, 0.5623851418495178, 0.10653677582740784, -0.14676052331924438, 0.6987226009368896, 0.20606721937656403, 0.05336413532495499, 0.36701980233192444, 0.21193914115428925, 0.7783380746841431, -0.3202725648880005, 0.1654183268547058, 0.17730122804641724, 0.42427486181259155, 0.16089043021202087, -0.06652562320232391, 0.382186621427536, -0.034840889275074005, -0.6019189953804016, 0.1202913373708725, 0.014585115015506744, -0.004368418827652931, 0.16334812343120575, 0.07044042646884918, 0.12438729405403137, 0.08031615614891052, -0.030518729239702225, -0.17914697527885437, -0.12769828736782074, 0.22096817195415497, -0.14664572477340698, -0.25404292345046997, 0.1260523945093155, 0.19410467147827148, 0.031133268028497696, 0.11007333546876907, 0.2500353455543518, 0.05619707703590393, 0.15210746228694916, -0.22721171379089355, -0.06065423786640167, 0.2737424969673157, 0.13138021528720856, -0.1843498945236206, -0.2302667200565338, -0.057888150215148926, 0.12032712996006012, -0.028385154902935028, -0.08833903819322586, -0.11718565970659256, 0.5538821816444397, 0.16492150723934174, 0.3670148551464081, 0.3925478458404541, -0.22251540422439575, 0.07998909801244736, -0.033773619681596756, 0.11319418251514435, -0.33125385642051697, 0.06687863916158676, -0.5443204641342163, -0.5170933604240417, 0.16681498289108276, -0.25878724455833435, 0.07652424275875092, -0.009385492652654648, 0.22449257969856262, 0.09663182497024536, -0.11486651003360748, 0.13560263812541962, -0.01714101806282997, 0.11716204881668091, 0.5853846669197083, -0.27428653836250305, -0.2033649981021881, -0.1304635852575302, 0.5696904063224792, 0.03716585040092468, 0.27162912487983704, 0.09524742513895035, 0.09035150706768036, -0.4637172818183899, -0.07447090744972229, 0.0840383917093277, 0.011146586388349533, -0.15474112331867218, 0.22642309963703156, -0.41331246495246887, 0.3312019109725952, 0.05578852817416191, 0.025687122717499733, 0.05548785626888275, -0.32451435923576355, -0.2998780608177185, -0.16803771257400513, 0.14117072522640228, -0.018812164664268494, 0.2951386868953705, 0.09586463868618011, -0.2673971652984619, 0.15708743035793304, -0.1470658928155899, 0.095033660531044, -0.27137428522109985, 0.07447997480630875, 0.005183368921279907, 0.03725197911262512, 0.02584189921617508, 0.12420331686735153, 0.20742452144622803, -0.04083462804555893, 0.010408904403448105, 0.02105550467967987, 0.09589093923568726, -0.23565205931663513, 0.01803690195083618, 0.027610033750534058, -0.002140376716852188, -0.2793852686882019, 0.10226839780807495, -0.1840408593416214, -0.2702319622039795, -0.4103657305240631, 0.11331090331077576, 0.43532878160476685, -0.005515981465578079, -0.13034772872924805, 0.19188186526298523, -0.16951707005500793, -0.004661776125431061, 0.29378828406333923, -0.05420030653476715, -0.1492072194814682, 0.13312150537967682, 0.2618948221206665, 0.00983918085694313, 0.05171157419681549, 0.012770619243383408, 0.09528078883886337, 0.13263681530952454, -0.2754553556442261, 0.6344696879386902, -0.3195580840110779, -0.12070069462060928, 0.0235547237098217, 0.526656448841095, 0.5484064817428589, -0.03890446200966835, -0.3056829571723938, 0.0026355385780334473, 0.1358787715435028, -0.17167028784751892, -0.24696241319179535, 0.4878843128681183, 0.4819420278072357, -0.034080907702445984, -0.12596797943115234, -0.27830082178115845, 0.16917386651039124, 0.071009561419487, 0.03694809973239899, 0.2784414291381836, -0.524708092212677, 0.2859970033168793, 0.15537762641906738, 0.3105347156524658, -0.11030661314725876, 0.24720428884029388, -0.01815010793507099, 0.015612460672855377, 0.6545003056526184, -0.09490951895713806, 0.5762236714363098, -0.22849653661251068, 0.19452492892742157, -0.09507603943347931, -0.3546963334083557, -0.09322154521942139, 0.40225839614868164, -0.3411238193511963, -0.07885462045669556, 0.08434996008872986, 0.20224688947200775, 0.08239872753620148, -0.3300333619117737, -0.36283552646636963, 0.17473821341991425, -0.12253931164741516, 0.04461895674467087, 0.008213095366954803, -0.07319975644350052, 0.2637946903705597, 0.09124822914600372, 0.027989355847239494, 0.14800363779067993, 0.652559757232666, 0.07685811817646027, 0.03648572787642479, -0.447986364364624, 0.21588166058063507, -0.2404879331588745, 0.5204710960388184, -0.02246682345867157, -0.012424497865140438, -0.02179642766714096, -0.16274790465831757, -0.0019365418702363968, 0.07463271170854568, 0.1811683624982834, 0.2837076187133789, 0.17674143612384796, -0.04833713918924332, -0.09906303882598877, -0.08525340259075165, -0.026332605630159378, 0.4685969054698944, -0.49855345487594604, 0.07398919016122818, 0.36311909556388855, 0.01749783754348755, -0.13387691974639893, 0.10291949659585953, -0.0558246374130249, 0.4207210838794708, -0.26927781105041504, 0.08276662975549698, -0.2551727890968323, -0.12431389093399048, -0.05462593212723732, -0.07816042751073837, -0.014801234006881714, -0.3250681459903717, 0.27775895595550537, -0.3320607841014862, 0.051930077373981476, -0.2581973373889923, 0.08747857809066772, -0.04268477112054825, 0.529748797416687, 0.2825997471809387, 0.07673998177051544, -0.004936395213007927, -0.13554035127162933, -0.46991413831710815, -0.08739148080348969, -0.2117767632007599, 0.3745605945587158, 0.33669957518577576, 0.23888300359249115, -0.2011587917804718, -0.03505740314722061, -0.046247243881225586, -0.6121612787246704, -0.28219032287597656, 0.16765156388282776, -0.13950052857398987, 0.053502157330513, -0.20459505915641785, -0.18555961549282074, -0.2128620147705078, -0.4651549160480499, 0.20895421504974365, -0.1718284785747528, 0.012636691331863403, -0.016749773174524307, 0.21056880056858063, 0.04277101159095764, 0.17667795717716217, -0.03097912296652794, 0.35667410492897034, 0.023209789767861366, 0.21353648602962494, 0.018788941204547882, -0.32950979471206665, -0.07670876383781433, -0.20023193955421448, 0.13357658684253693, -0.1445390284061432, 0.08794452250003815, -0.18928563594818115, -0.17058637738227844, 0.027120288461446762, 0.13274632394313812, -0.17798617482185364, 0.2810952365398407, -0.1860450655221939, -0.011134948581457138, -0.17039623856544495, 0.5897437334060669, -0.08609718084335327, 0.2484559416770935, 0.11047540605068207, 0.23521259427070618, -0.08829140663146973, -0.20047229528427124, 0.37231016159057617, -0.5740668177604675, -0.08537854254245758, -0.04914719983935356, 0.0568065270781517, 0.28303593397140503, -0.07372850924730301, 0.16196615993976593, -0.3039289712905884, 0.3276995122432709, 0.2144518494606018, 0.20646929740905762, 0.4148677885532379, -0.07652714848518372, -0.051878225058317184, -0.1680707335472107, 0.011197984218597412, 0.1121562048792839, -0.34630030393600464, 0.21819014847278595, -0.1943454146385193 ]
https://github.com/huggingface/datasets/issues/5908
> Actually sharded iterable datasets are made of sub iterables that generally yield contiguous data no ? So in a way it's possible to shard an iterable dataset contiguously. But sharding an iterable dataset by sharding its `gen_kwargs` would still yield approximate shards(not equal to `Dataset.shard`), no?
Unbearably slow sorting on big mapped datasets
### Describe the bug For me, with ~40k lines, sorting took 3.5 seconds on a flattened dataset (including the flatten operation) and 22.7 seconds on a mapped dataset (right after sharding), which is about x5 slowdown. Moreover, it seems like it slows down exponentially with bigger datasets (wasn't able to sort 700k lines at all, with flattening takes about a minute). ### Steps to reproduce the bug ```Python from datasets import load_dataset import time dataset = load_dataset("xnli", "en", split="train") dataset = dataset.shard(10, 0) print(len(dataset)) t = time.time() # dataset = dataset.flatten_indices() # uncomment this line and it's fast dataset = dataset.sort("label", reverse=True, load_from_cache_file=False) print(f"finished in {time.time() - t:.4f} seconds") ``` ### Expected behavior Expect sorting to take the same or less time than flattening and then sorting. ### Environment info - `datasets` version: 2.12.1.dev0 (same with 2.12.0 too) - Platform: Windows-10-10.0.22621-SP0 - Python version: 3.10.10 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.1
47
Unbearably slow sorting on big mapped datasets ### Describe the bug For me, with ~40k lines, sorting took 3.5 seconds on a flattened dataset (including the flatten operation) and 22.7 seconds on a mapped dataset (right after sharding), which is about x5 slowdown. Moreover, it seems like it slows down exponentially with bigger datasets (wasn't able to sort 700k lines at all, with flattening takes about a minute). ### Steps to reproduce the bug ```Python from datasets import load_dataset import time dataset = load_dataset("xnli", "en", split="train") dataset = dataset.shard(10, 0) print(len(dataset)) t = time.time() # dataset = dataset.flatten_indices() # uncomment this line and it's fast dataset = dataset.sort("label", reverse=True, load_from_cache_file=False) print(f"finished in {time.time() - t:.4f} seconds") ``` ### Expected behavior Expect sorting to take the same or less time than flattening and then sorting. ### Environment info - `datasets` version: 2.12.1.dev0 (same with 2.12.0 too) - Platform: Windows-10-10.0.22621-SP0 - Python version: 3.10.10 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.1 > Actually sharded iterable datasets are made of sub iterables that generally yield contiguous data no ? So in a way it's possible to shard an iterable dataset contiguously. But sharding an iterable dataset by sharding its `gen_kwargs` would still yield approximate shards(not equal to `Dataset.shard`), no?
[ -0.10304565727710724, -0.15983405709266663, -0.06594786047935486, 0.1930970847606659, 0.0723331868648529, 0.10899445414543152, 0.3095795214176178, 0.25084349513053894, -0.21566343307495117, 0.09753268957138062, -0.23364758491516113, 0.2107560932636261, 0.014982257038354874, -0.20181599259376526, -0.005467565730214119, -0.08930088579654694, 0.12339214235544205, -0.15036684274673462, 0.07980980724096298, -0.05554705858230591, -0.16306379437446594, -0.08846469223499298, -0.31708770990371704, -0.3101676106452942, -0.23929692804813385, -0.05917893350124359, -0.06566336750984192, 0.12090998888015747, -0.09713567048311234, -0.28741690516471863, 0.37205320596694946, 0.0014853435568511486, -0.2371809184551239, 0.3901064693927765, -0.00011537939280970022, 0.023903094232082367, 0.3133315443992615, 0.3077361583709717, -0.024238061159849167, 0.3534524738788605, -0.18366223573684692, -0.31963178515434265, -0.41917648911476135, -0.20977666974067688, -0.05991606414318085, 0.08120429515838623, -0.016175612807273865, -0.08969539403915405, -0.14495283365249634, -0.059893421828746796, 0.11368751525878906, 0.11279124766588211, -0.12375371158123016, -0.017051439732313156, 0.3806734085083008, 0.025497345253825188, -0.21908831596374512, 0.01536518707871437, 0.19646117091178894, 0.06388089060783386, -0.215079203248024, 0.15752267837524414, -0.22734670341014862, -0.08471882343292236, 0.18240277469158173, 0.08596639335155487, -0.03710665926337242, -0.09731517732143402, 0.05683629959821701, 0.3119330406188965, -0.20119260251522064, -0.10063953697681427, -0.3887324333190918, -0.544844388961792, -0.22233518958091736, -0.4618086814880371, 0.09914138168096542, -0.10438431054353714, -0.03438979387283325, -0.23226889967918396, -0.17310316860675812, 0.15330149233341217, 0.1755208969116211, 0.06113411858677864, -0.127154141664505, 0.3076073229312897, 0.01727880910038948, -0.05029584467411041, 0.1299767643213272, -0.3851289749145508, 0.13236725330352783, -0.3444747030735016, 0.04456532374024391, 0.3033008873462677, -0.7402025461196899, -0.1566244661808014, 0.3476628065109253, 0.36773020029067993, 0.17031782865524292, 0.08539563417434692, -0.16129156947135925, 0.08468595147132874, 0.22464123368263245, -0.15385057032108307, 0.21512579917907715, 0.3999319076538086, -0.16028761863708496, 0.1638784110546112, 0.2361895740032196, -0.013243306428194046, 0.13366356492042542, 0.14458194375038147, 0.2786673605442047, -0.5374171137809753, -0.0016575157642364502, -0.15634119510650635, 0.12397654354572296, -0.03888273984193802, -0.1580725610256195, -0.1203748807311058, 0.05743516981601715, -0.06258535385131836, 0.14234806597232819, 0.23816290497779846, 0.0035490021109580994, -0.11869009584188461, -0.47131580114364624, -0.32577982544898987, -0.29182174801826477, 0.05053498223423958, -0.11909715086221695, -0.23575270175933838, -0.1035631000995636, 0.19939583539962769, 0.043194010853767395, -0.32547304034233093, -0.25021064281463623, 0.11951746046543121, 0.13727688789367676, 0.28404510021209717, -0.2822634279727936, -0.08372005820274353, 0.22524668276309967, 0.30379706621170044, -0.2765299379825592, 0.24597075581550598, -0.027727941051125526, 0.0012251287698745728, -0.36645394563674927, 0.20649944245815277, -0.46070799231529236, -0.4563445448875427, 0.1769903153181076, 0.0646277442574501, -0.2848799228668213, -0.004971503280103207, -0.2669394314289093, 0.153543621301651, 0.3398272693157196, -0.20217442512512207, -0.054835375398397446, -0.19494399428367615, -0.4485434293746948, -0.017449449747800827, 0.282686322927475, 0.010652035474777222, -0.15916162729263306, 0.17185074090957642, -0.5709571242332458, 0.3217172920703888, 0.270729660987854, 0.6846755146980286, -0.06961623579263687, 0.03317601978778839, -0.17687669396400452, 0.3877839744091034, 0.2966742515563965, 0.23300190269947052, -0.7068326473236084, 0.37918025255203247, -0.1557987779378891, 0.3806716799736023, -0.008973691612482071, 0.27506279945373535, 0.3155832588672638, -0.30905377864837646, 0.17549893260002136, 0.20041418075561523, -0.026142336428165436, -0.015763871371746063, -0.6007302403450012, 0.08281417936086655, 0.11024138331413269, 0.30322766304016113, 0.06878870725631714, 0.06080245226621628, 0.1438976377248764, -0.22218358516693115, 0.3458160161972046, 0.07176953554153442, -0.00310622900724411, 0.20478451251983643, 0.06351102888584137, -0.07526038587093353, 0.4475303590297699, -0.22778239846229553, -0.17992788553237915, 0.4000598192214966, 0.005237489938735962, -0.14734867215156555, -0.014911681413650513, -0.23885121941566467, 0.11043770611286163, 0.06444916129112244, -0.31699973344802856, 0.054037321358919144, 0.011722683906555176, -0.3330669701099396, 0.0799623429775238, -0.04872879385948181, -0.08351441472768784, -0.14504343271255493, -0.38755545020103455, -0.16542482376098633, -0.4856538474559784, 0.26317298412323, 0.1415090411901474, -0.033844053745269775, -0.02895895019173622, 0.02885177731513977, -0.08010731637477875, -0.07150153815746307, -0.10879761725664139, 0.14960898458957672, 0.18756206333637238, 0.1423787623643875, -0.0633169487118721, 0.44398796558380127, 0.04824696481227875, -0.04246965050697327, -0.06810921430587769, 0.07084151357412338, -0.047965507954359055, -0.14508800208568573, -0.24075451493263245, 0.4591767191886902, -0.48472464084625244, 0.44219258427619934, 0.0016162320971488953, -0.039603300392627716, 0.2183932065963745, 0.0445413812994957, -0.05857699364423752, 0.11170798540115356, 0.5793768763542175, 0.03404303640127182, 0.1663796752691269, 0.3038661777973175, 0.04824994504451752, 0.3981921374797821, 0.6160441637039185, -0.13597659766674042, -0.17555224895477295, 0.2634691298007965, 0.06838417053222656, -0.0245404951274395, 0.12780028581619263, 0.27354931831359863, 0.22216619551181793, 0.20949891209602356, 0.24082247912883759, -0.017147831618785858, 0.03848382085561752, -0.22825774550437927, 0.0361441895365715, 0.17936764657497406, 0.0028676651418209076, 0.21861644089221954, 0.11678344756364822, 0.28165948390960693, -0.33461838960647583, -0.12588882446289062, -0.05835340544581413, 0.13992634415626526, -0.2388581782579422, 0.07609470933675766, -0.16715744137763977, -0.008437462151050568, -0.017962828278541565, 0.03158029541373253, -0.3573897182941437, -0.38146257400512695, 0.05933341383934021, 0.11592799425125122, -0.0347009114921093, 0.10832827538251877, 0.09817527234554291, 0.3163183033466339, 0.21236222982406616, -0.2692018151283264, -0.3966415822505951, -0.1594356745481491, -0.05740797519683838, 0.058307938277721405, 0.414824903011322, 0.09503371268510818, 0.18361325562000275, 0.0792650431394577, -0.09438644349575043, -0.19401098787784576, -0.3336103558540344, -0.2065398395061493, -0.2457898110151291, 0.18891264498233795, -0.0910196304321289, -0.061833254992961884, -0.1841958612203598, 0.057123374193906784, 0.11390206962823868, 0.05764705687761307, -0.08056861162185669, 0.2725919485092163, -0.2543465197086334, -0.2740345001220703, 0.010495215654373169, 0.11162048578262329, -0.0468018501996994, -0.14793410897254944, 0.31124329566955566, 0.01909005641937256, 0.18738171458244324, -0.10895480960607529, -0.2713366746902466, 0.04640138894319534, -0.08570730686187744, -0.11148907244205475, -0.00881604477763176, -0.4093327522277832, 0.379867821931839, -0.04221806675195694, -0.17495249211788177, -0.33101391792297363, 0.002209015190601349, -0.31119170784950256, 0.3072115182876587, -0.37715888023376465, 0.42484554648399353, -0.6378998160362244, 0.2898275852203369, 0.2479161024093628, -0.2508775591850281, 0.5992173552513123, -0.07641247659921646, 0.028205327689647675, 0.027805693447589874, -0.18384556472301483, -0.12704022228717804, -0.030710116028785706, 0.08740285784006119, 0.07834737002849579, 0.41515132784843445, 0.49037474393844604, 0.6896549463272095, 0.43335074186325073, 0.28386786580085754, -0.04743677377700806, 0.05693765729665756, 0.11232713609933853, -0.32026442885398865, -0.3353063762187958, 0.2397017478942871, 0.12054317444562912, -0.3125911355018616, 0.14084257185459137, 0.2783927917480469, -0.18947955965995789, 0.17729607224464417, -0.2706323266029358, 0.3976203203201294, -0.24810948967933655, -0.008023198693990707, -0.21934430301189423, -0.022914517670869827, 0.10482119023799896, 0.07934202253818512, -0.1479499638080597, -0.485036700963974, 0.0844002366065979, -0.03486200422048569, 0.1566389948129654, -0.016022836789488792, -0.17550775408744812, -0.060441482812166214, -0.42326420545578003, 0.018532678484916687, 0.19227518141269684, 0.1331702470779419, 0.006348103284835815, -0.19824227690696716, 0.36659520864486694, 0.040133994072675705, 0.5290414094924927, 0.08158548921346664, 0.18296203017234802, 0.20777824521064758, -0.30524539947509766, -0.4186778664588928, 0.13572660088539124, 0.0564824715256691, 0.04347643256187439, 0.19457347691059113, 0.3548503518104553, -0.11066317558288574, 0.025654997676610947, 0.07364671677350998, -0.009757351130247116, -0.041169874370098114, -0.35450613498687744, -0.14206412434577942, -0.04799351468682289, 0.27714771032333374, 0.1552547812461853, -0.028942380100488663, -0.010531678795814514, -0.1424688994884491, 0.007413290441036224, -0.3086012601852417, 0.035264067351818085, 0.016995951533317566, 0.019782479852437973, -0.00360700860619545, -0.07682817429304123, 0.4482315182685852, 0.20688891410827637, 0.20536908507347107, -0.22017492353916168, 0.4719164967536926, 0.29563236236572266, -0.1628701090812683, -0.16359111666679382, 0.1279621422290802, -0.018870607018470764, 0.3134212791919708, -0.15495765209197998, -0.1451011300086975, -0.19333602488040924, 0.2733571529388428, -0.2795456647872925, -0.16750890016555786, 0.3801928758621216, 0.056675199419260025, -0.6821708679199219, -0.07123558968305588, 0.6073253750801086, 0.12756824493408203, -0.17856785655021667, 0.6706851124763489, 0.23925872147083282, 0.0051888637244701385, 0.3729943037033081, 0.2236098349094391, 0.7701385617256165, -0.27134695649147034, 0.1810777187347412, 0.16721676290035248, 0.44469618797302246, 0.1879860758781433, -0.0525614358484745, 0.37879201769828796, -0.06748934090137482, -0.6182029843330383, 0.10425422340631485, 0.024040117859840393, 0.027769044041633606, 0.18354198336601257, 0.10203427821397781, 0.14246393740177155, 0.07029378414154053, -0.020957831293344498, -0.17008143663406372, -0.1375182569026947, 0.19581487774848938, -0.11187370121479034, -0.2390427142381668, 0.10937927663326263, 0.17753206193447113, 0.05063701421022415, 0.11161870509386063, 0.23085549473762512, 0.019563689827919006, 0.17101624608039856, -0.219651460647583, -0.05473356693983078, 0.3089693486690521, 0.1963607370853424, -0.19845150411128998, -0.26854467391967773, -0.021079521626234055, 0.16202694177627563, 0.0036592669785022736, -0.07519304752349854, -0.130560964345932, 0.5632489323616028, 0.1860959529876709, 0.3505057990550995, 0.42239922285079956, -0.19273751974105835, 0.08904639631509781, -0.042201101779937744, 0.1349027454853058, -0.3691808581352234, 0.04055976867675781, -0.5511794090270996, -0.5732946395874023, 0.19337710738182068, -0.2167331874370575, 0.04688330739736557, -0.027196308597922325, 0.22303086519241333, 0.08949628472328186, -0.0996536910533905, 0.11687111109495163, -0.02082693576812744, 0.13443362712860107, 0.6058043241500854, -0.2777402400970459, -0.19257241487503052, -0.10974374413490295, 0.5500984191894531, 0.05347796529531479, 0.24167844653129578, 0.11063919216394424, 0.032955825328826904, -0.4650961756706238, -0.03658109903335571, 0.12348467111587524, -0.0014765337109565735, -0.1513303816318512, 0.21696758270263672, -0.4111737012863159, 0.3465096354484558, 0.04346362128853798, -0.022200260311365128, 0.07793213427066803, -0.3094427287578583, -0.3220289349555969, -0.1609649360179901, 0.1528901755809784, 0.029452316462993622, 0.2835671603679657, 0.10748885571956635, -0.2929062843322754, 0.1077210083603859, -0.15901434421539307, 0.0915093868970871, -0.24571427702903748, 0.07952854037284851, 0.043014854192733765, 0.048116229474544525, 0.0694054365158081, 0.1449042707681656, 0.17991085350513458, -0.06088528782129288, -0.010610602796077728, -0.014862461015582085, 0.08079031109809875, -0.20402966439723969, -0.007955748587846756, 0.042566388845443726, 0.010034512728452682, -0.2792714834213257, 0.11661316454410553, -0.1731802523136139, -0.31144577264785767, -0.39060455560684204, 0.14149409532546997, 0.43283846974372864, -0.023564256727695465, -0.13002432882785797, 0.24222303926944733, -0.1126873791217804, -0.026514388620853424, 0.32901257276535034, -0.09462569653987885, -0.089194655418396, 0.13402727246284485, 0.2661100924015045, 0.02477860450744629, 0.05790172517299652, 0.03318219259381294, 0.10955865681171417, 0.15478193759918213, -0.25128108263015747, 0.7060396671295166, -0.3246394991874695, -0.10573552548885345, 0.0272042416036129, 0.5336607694625854, 0.540171205997467, -0.04071666672825813, -0.325919508934021, 0.026096299290657043, 0.11591175198554993, -0.14693555235862732, -0.27614232897758484, 0.4296853542327881, 0.4366227090358734, -0.04675842821598053, -0.10145139694213867, -0.23925510048866272, 0.1975676417350769, 0.03343183919787407, 0.014572344720363617, 0.3506711423397064, -0.5245566368103027, 0.29841893911361694, 0.18190354108810425, 0.2898785471916199, -0.12111391127109528, 0.24535739421844482, -0.05241146311163902, -0.03324942663311958, 0.6471070051193237, -0.0841846615076065, 0.6189448833465576, -0.1554461121559143, 0.19233693182468414, -0.07144667208194733, -0.3373275399208069, -0.10548943281173706, 0.38585811853408813, -0.3789622485637665, -0.05393150448799133, 0.0628734678030014, 0.2115020751953125, 0.06430528312921524, -0.29849234223365784, -0.3348981738090515, 0.1514960080385208, -0.06907854229211807, 0.01788104698061943, -0.007891431450843811, -0.08960482478141785, 0.23461119830608368, 0.047845594584941864, 0.01641666330397129, 0.12600378692150116, 0.6248142719268799, 0.06926843523979187, 0.039983175694942474, -0.41835030913352966, 0.19613072276115417, -0.19843855500221252, 0.5457296371459961, -0.03692198544740677, -0.01010962575674057, -0.026616405695676804, -0.14702573418617249, 0.007879863493144512, 0.02157328836619854, 0.20345520973205566, 0.30303245782852173, 0.1982407122850418, -0.07819259911775589, -0.09178660809993744, -0.07556766271591187, -0.014270029962062836, 0.5018706321716309, -0.49529871344566345, 0.05232439935207367, 0.3441815674304962, -0.002099372446537018, -0.11647355556488037, 0.07163012027740479, -0.03544645011425018, 0.41521286964416504, -0.27001407742500305, 0.13379770517349243, -0.3030425012111664, -0.17801162600517273, -0.006148095708340406, -0.049453817307949066, -0.016505882143974304, -0.2892509996891022, 0.2841590344905853, -0.32893767952919006, 0.043441567569971085, -0.24016930162906647, 0.07507114857435226, -0.04882192984223366, 0.5517526268959045, 0.24286998808383942, 0.06650382280349731, 0.012195315212011337, -0.12239895015954971, -0.4876386821269989, -0.12516528367996216, -0.1608544886112213, 0.36535996198654175, 0.334087997674942, 0.21481256186962128, -0.20054040849208832, -0.01246622670441866, -0.1112307608127594, -0.6007733941078186, -0.301940381526947, 0.1460219770669937, -0.12478648871183395, 0.013117089867591858, -0.22529354691505432, -0.17944850027561188, -0.24372392892837524, -0.45394814014434814, 0.20620176196098328, -0.14816637337207794, -0.00918036699295044, 0.008702598512172699, 0.1930307298898697, 0.07873427122831345, 0.17688050866127014, -0.037422940135002136, 0.3661472797393799, 0.08149082213640213, 0.21833713352680206, 0.028566822409629822, -0.3543565571308136, -0.11939243227243423, -0.20396408438682556, 0.14828819036483765, -0.1663242131471634, 0.09344714879989624, -0.14910008013248444, -0.2479197382926941, 0.0428336001932621, 0.17750184237957, -0.15413464605808258, 0.28535890579223633, -0.20628000795841217, -0.03505383059382439, -0.19701990485191345, 0.5603973269462585, -0.0717833936214447, 0.23669886589050293, 0.09125484526157379, 0.23271852731704712, -0.04156409949064255, -0.22903919219970703, 0.39411914348602295, -0.579882025718689, -0.05946165323257446, -0.05859203636646271, 0.039623573422431946, 0.2970746159553528, -0.0815001130104065, 0.1595260351896286, -0.30806270241737366, 0.3637416362762451, 0.1935322880744934, 0.2488775998353958, 0.43780046701431274, -0.05514625459909439, -0.06530171632766724, -0.16386279463768005, -0.012317799031734467, 0.07119537144899368, -0.3343498110771179, 0.2080744504928589, -0.19950783252716064 ]
https://github.com/huggingface/datasets/issues/5908
I understand the issue doesn't exist with non-mapped datasets, but if flattening is so much more efficient than sorting the indices, that's an issue in itself. There are plenty of issues people posted for which the root cause turns out to be the same. It seems like mapped datasets are terribly inefficient. I think I saw some issue like that somewhere (about the mapped datasets in general), but can't find it now. Maybe indices should be flattened before any additional processing, then.
Unbearably slow sorting on big mapped datasets
### Describe the bug For me, with ~40k lines, sorting took 3.5 seconds on a flattened dataset (including the flatten operation) and 22.7 seconds on a mapped dataset (right after sharding), which is about x5 slowdown. Moreover, it seems like it slows down exponentially with bigger datasets (wasn't able to sort 700k lines at all, with flattening takes about a minute). ### Steps to reproduce the bug ```Python from datasets import load_dataset import time dataset = load_dataset("xnli", "en", split="train") dataset = dataset.shard(10, 0) print(len(dataset)) t = time.time() # dataset = dataset.flatten_indices() # uncomment this line and it's fast dataset = dataset.sort("label", reverse=True, load_from_cache_file=False) print(f"finished in {time.time() - t:.4f} seconds") ``` ### Expected behavior Expect sorting to take the same or less time than flattening and then sorting. ### Environment info - `datasets` version: 2.12.1.dev0 (same with 2.12.0 too) - Platform: Windows-10-10.0.22621-SP0 - Python version: 3.10.10 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.1
82
Unbearably slow sorting on big mapped datasets ### Describe the bug For me, with ~40k lines, sorting took 3.5 seconds on a flattened dataset (including the flatten operation) and 22.7 seconds on a mapped dataset (right after sharding), which is about x5 slowdown. Moreover, it seems like it slows down exponentially with bigger datasets (wasn't able to sort 700k lines at all, with flattening takes about a minute). ### Steps to reproduce the bug ```Python from datasets import load_dataset import time dataset = load_dataset("xnli", "en", split="train") dataset = dataset.shard(10, 0) print(len(dataset)) t = time.time() # dataset = dataset.flatten_indices() # uncomment this line and it's fast dataset = dataset.sort("label", reverse=True, load_from_cache_file=False) print(f"finished in {time.time() - t:.4f} seconds") ``` ### Expected behavior Expect sorting to take the same or less time than flattening and then sorting. ### Environment info - `datasets` version: 2.12.1.dev0 (same with 2.12.0 too) - Platform: Windows-10-10.0.22621-SP0 - Python version: 3.10.10 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.1 I understand the issue doesn't exist with non-mapped datasets, but if flattening is so much more efficient than sorting the indices, that's an issue in itself. There are plenty of issues people posted for which the root cause turns out to be the same. It seems like mapped datasets are terribly inefficient. I think I saw some issue like that somewhere (about the mapped datasets in general), but can't find it now. Maybe indices should be flattened before any additional processing, then.
[ -0.10508766770362854, -0.149089515209198, -0.03252605348825455, 0.23066601157188416, 0.16614949703216553, 0.14026305079460144, 0.34868893027305603, 0.29994359612464905, 0.02588580548763275, 0.14756685495376587, -0.19592806696891785, 0.31414133310317993, -0.019622011110186577, -0.1105327382683754, -0.17484161257743835, -0.10323929786682129, 0.1291845142841339, -0.14931564033031464, 0.09787081182003021, -0.03395933657884598, -0.2692961096763611, -0.21041816473007202, -0.31382349133491516, -0.3132186830043793, -0.3649105727672577, -0.05138096958398819, -0.008492641150951385, 0.017324920743703842, -0.09268531948328018, -0.2053920030593872, 0.373417466878891, -0.024170812219381332, -0.2605389356613159, 0.4868568778038025, -0.00011316994641674682, 0.04571621119976044, 0.2700059413909912, 0.3583996295928955, 0.005526784807443619, 0.3621297776699066, -0.18639668822288513, -0.3493587076663971, -0.299507737159729, -0.2073734998703003, 0.030264750123023987, 0.0069205984473228455, -0.09894922375679016, -0.20655608177185059, -0.1287282407283783, -0.06926417350769043, 0.1386336237192154, 0.08832594007253647, -0.22747182846069336, 0.018015708774328232, 0.2677772641181946, -0.09839653968811035, -0.20038951933383942, 0.05054015293717384, 0.24548274278640747, -0.0775834396481514, -0.1762068271636963, 0.25472399592399597, -0.3371409773826599, -0.08278840780258179, 0.2609386146068573, 0.02808462083339691, 0.09876930713653564, -0.130067840218544, -0.00207264581695199, 0.3405355215072632, -0.11028769612312317, -0.006142258644104004, -0.38749924302101135, -0.615979790687561, -0.18161757290363312, -0.25574371218681335, 0.06318679451942444, -0.19733180105686188, -0.0008212067186832428, -0.18123294413089752, -0.24037839472293854, 0.192355215549469, 0.29651978611946106, 0.10092196613550186, -0.1564197838306427, 0.2653314173221588, 0.04699631780385971, -0.11756289005279541, 0.20221683382987976, -0.41262370347976685, 0.11893817782402039, -0.3678949177265167, 0.11814890801906586, 0.2808176875114441, -0.6183239221572876, -0.13962991535663605, 0.4242313504219055, 0.13762860000133514, -0.0422372967004776, -0.09244205802679062, -0.1012783795595169, 0.16231277585029602, 0.12400542199611664, -0.11323664337396622, 0.1437222808599472, 0.5610193014144897, -0.17681489884853363, 0.23742246627807617, 0.3419559895992279, -0.09004891663789749, 0.05798300355672836, 0.19601377844810486, 0.2593173682689667, -0.4606947898864746, -0.01576048880815506, -0.09515322744846344, 0.10269103944301605, -0.09574753791093826, -0.25706732273101807, -0.15556003153324127, -0.040090207010507584, -0.0424983873963356, 0.1501770168542862, 0.20960038900375366, -0.03166233375668526, 0.13366210460662842, -0.3108828663825989, -0.35880184173583984, -0.33148372173309326, 0.15378232300281525, -0.07752496004104614, -0.2785659730434418, -0.08019771426916122, 0.18919621407985687, 0.14013022184371948, -0.323113352060318, -0.23017765581607819, 0.16055193543434143, 0.15366238355636597, 0.28057196736335754, -0.2072414606809616, -0.0318351648747921, 0.1261288821697235, 0.28566837310791016, -0.3592562675476074, 0.2789791226387024, -0.009660216979682446, 0.1407628208398819, -0.29850518703460693, 0.28529906272888184, -0.5524976253509521, -0.49177026748657227, 0.19812966883182526, 0.09300513565540314, -0.16682055592536926, -0.005168032366782427, -0.21191057562828064, 0.22233636677265167, 0.22169819474220276, -0.058934278786182404, -0.14372515678405762, -0.20899559557437897, -0.3731177747249603, 0.00959693267941475, 0.22950711846351624, 0.003182530403137207, -0.1409124732017517, 0.16780538856983185, -0.4912309944629669, 0.4573025107383728, 0.25458770990371704, 0.6590548157691956, -0.20402978360652924, 0.12855514883995056, -0.021305114030838013, 0.10975192487239838, 0.14169879257678986, 0.13984085619449615, -0.6414336562156677, 0.22384732961654663, -0.15252503752708435, 0.3025190532207489, -0.10326430201530457, 0.25275567173957825, 0.37881314754486084, -0.276631623506546, 0.3530527949333191, 0.21846984326839447, 0.04146125167608261, 0.10569001734256744, -0.626656711101532, -0.03692764788866043, 0.20726434886455536, 0.35266125202178955, -0.058393534272909164, -0.004313621670007706, 0.012202385812997818, -0.17080029845237732, 0.18238770961761475, 0.014061410911381245, -0.09906846284866333, 0.27052080631256104, -0.06360189616680145, -0.06728197634220123, 0.3784806430339813, -0.2019692361354828, -0.2266293168067932, 0.39794203639030457, -0.023093514144420624, -0.0784020870923996, 0.017066551372408867, -0.19309885799884796, 0.06201083958148956, 0.019386030733585358, -0.23853935301303864, 0.13922086358070374, 0.009087029844522476, -0.4332278370857239, -0.050965361297130585, 0.0020587146282196045, -0.006600119173526764, -0.23460282385349274, -0.2809988260269165, -0.1656055748462677, -0.28444284200668335, 0.14573423564434052, 0.10478893667459488, -0.013841092586517334, 0.03864803910255432, -0.03335512802004814, 0.0063149593770504, -0.01673295348882675, -0.18605360388755798, 0.03898881748318672, 0.14399169385433197, 0.08127880841493607, -0.0012333046179264784, 0.47167521715164185, 0.04124945402145386, -0.10782688856124878, 0.06050947308540344, 0.280200332403183, -0.050447069108486176, -0.15225443243980408, -0.35555535554885864, 0.5346437096595764, -0.4556525647640228, 0.4061438739299774, -0.1517249196767807, -0.03276707977056503, 0.11034530401229858, 0.08700470626354218, 0.034237705171108246, 0.034998781979084015, 0.5691665410995483, -0.024034719914197922, 0.09119237959384918, 0.3532724976539612, 0.11272209882736206, 0.45786893367767334, 0.5958962440490723, -0.04174894466996193, -0.1849507838487625, 0.2565125524997711, 0.0899626687169075, 0.04746166616678238, 0.07113849371671677, 0.11906352639198303, 0.07286198437213898, 0.2796913683414459, 0.12223540246486664, -0.08016864955425262, 0.0873321145772934, -0.2024606615304947, 0.08396102488040924, 0.1754598319530487, 0.011536024510860443, 0.08227990567684174, 0.18264302611351013, 0.3318530321121216, -0.2894271910190582, -0.10283903777599335, -0.06113990768790245, 0.22527511417865753, -0.23748880624771118, 0.019000530242919922, -0.11710754781961441, -0.17111745476722717, 0.04392463341355324, -0.11370201408863068, -0.3221520185470581, -0.44640201330184937, 0.12963137030601501, 0.036923278123140335, -0.10057995468378067, 0.11337443441152573, -0.04632581025362015, 0.24890857934951782, 0.20837458968162537, -0.3056119978427887, -0.36828863620758057, -0.1278102993965149, -0.07996787130832672, 0.07324196398258209, 0.41785258054733276, 0.10981159657239914, 0.16496270895004272, 0.12624295055866241, 0.027491025626659393, -0.012178463861346245, -0.4090045094490051, -0.275383859872818, -0.2382635921239853, 0.09551209956407547, -0.23537567257881165, -0.039320267736911774, -0.27100682258605957, 0.05563021078705788, 0.13271039724349976, 0.06021346151828766, 0.03662887215614319, 0.28191855549812317, -0.19864389300346375, -0.26384207606315613, -0.07595893740653992, -0.0013825967907905579, -0.011170849204063416, -0.16871923208236694, 0.24599935114383698, -0.15293821692466736, 0.19030696153640747, -0.030282851308584213, -0.15050531923770905, 0.06953012943267822, -0.09498318284749985, -0.13073384761810303, 0.07003927230834961, -0.37661033868789673, 0.41239747405052185, 0.06301595270633698, -0.07834593951702118, -0.409032940864563, 0.003923848271369934, -0.5381731986999512, 0.17453010380268097, -0.30590564012527466, 0.4098717272281647, -0.6940380334854126, 0.3378733992576599, 0.25273633003234863, -0.13350676000118256, 0.6586076021194458, 0.07785093039274216, -0.015431329607963562, 0.05597373843193054, -0.27523672580718994, -0.08991473913192749, 0.142159566283226, 0.08344751596450806, -0.07386757433414459, 0.2641926109790802, 0.35229524970054626, 0.49680250883102417, 0.288310170173645, 0.3018811345100403, -0.06542812287807465, 0.22827085852622986, 0.15257138013839722, -0.368232786655426, -0.3791225552558899, 0.06979408860206604, 0.1589827835559845, -0.24740973114967346, 0.04072706773877144, 0.3116660416126251, -0.1769219934940338, 0.1793646216392517, -0.26734569668769836, 0.41525334119796753, -0.20518699288368225, 0.08255614340305328, -0.3499915301799774, -0.0672789067029953, 0.1214180737733841, 0.11992395669221878, -0.2802025079727173, -0.3982442617416382, 0.1770239770412445, -0.2009250521659851, 0.20835863053798676, -0.11832910776138306, -0.11745481938123703, -0.06552393734455109, -0.5221251845359802, 0.12481352686882019, 0.19857090711593628, 0.13583984971046448, -0.014375895261764526, -0.0715712234377861, 0.30141377449035645, 0.09924311935901642, 0.3545548915863037, 0.0006961524486541748, 0.12579819560050964, 0.29152488708496094, -0.22172871232032776, -0.5263475179672241, 0.05767787992954254, -0.02079707384109497, 0.07498329877853394, 0.1830417513847351, 0.6068570613861084, -0.05482005327939987, -0.023608218878507614, 0.048605840653181076, 0.05079147219657898, -0.02352330833673477, -0.3315196633338928, -0.12498114258050919, 0.017504967749118805, 0.3605194389820099, 0.16349002718925476, 0.017773985862731934, 0.05196923762559891, -0.13843068480491638, -0.08849179744720459, -0.22481109201908112, 0.17364321649074554, 0.11891767382621765, -0.012776363641023636, 0.036450788378715515, 0.02209010347723961, 0.5020772218704224, 0.23315125703811646, 0.2298203557729721, -0.2794323265552521, 0.4538253843784332, 0.06575710326433182, -0.13198556005954742, -0.19979506731033325, 0.08894425630569458, -0.04956100136041641, 0.32260623574256897, -0.04604071006178856, -0.08898773789405823, -0.21995463967323303, 0.2546968460083008, -0.25429052114486694, -0.1927308887243271, 0.4262714385986328, 0.1824151575565338, -0.6644421219825745, -0.19242238998413086, 0.5200478434562683, 0.10358577966690063, -0.16112306714057922, 0.7765868902206421, 0.12886592745780945, 0.07591598480939865, 0.41519132256507874, 0.2587045431137085, 0.7181975841522217, -0.3268555700778961, 0.10427431762218475, 0.13020917773246765, 0.27813130617141724, 0.07823982834815979, 0.07312370091676712, 0.36525851488113403, -0.06870416551828384, -0.5825372338294983, 0.17534759640693665, 0.007531307637691498, -0.07576911151409149, 0.138122096657753, 0.03401748836040497, 0.038537587970495224, -0.08338864147663116, -0.10390260070562363, -0.21413052082061768, -0.11047367751598358, 0.2765502333641052, -0.23875932395458221, -0.3346131145954132, 0.1339259296655655, 0.214467391371727, 0.06793573498725891, 0.1416018158197403, 0.1546742022037506, -0.1331484019756317, 0.18304502964019775, -0.11360522359609604, -0.0511222705245018, 0.17085295915603638, 0.2353643774986267, -0.2800220549106598, -0.02709285169839859, 0.044379688799381256, 0.0646112710237503, -0.09667553007602692, -0.04098324105143547, -0.1494278460741043, 0.38712021708488464, 0.12186261266469955, 0.3982498347759247, 0.5453234910964966, -0.2306111752986908, 0.13163574039936066, 0.015955671668052673, 0.021343782544136047, -0.35102415084838867, -0.004380732774734497, -0.49145713448524475, -0.5392001271247864, 0.20229782164096832, -0.2517080008983612, 0.04655994102358818, -0.030124297365546227, 0.22925183176994324, 0.1262792944908142, -0.07373709976673126, 0.1504858434200287, -0.03741800785064697, 0.24329333007335663, 0.7526090741157532, -0.24332106113433838, -0.24367180466651917, -0.004129798151552677, 0.5635338425636292, 0.15638840198516846, 0.2945345640182495, 0.14840537309646606, -0.003619365394115448, -0.41843900084495544, -0.05057663470506668, 0.2684934735298157, 0.00006290152668952942, -0.03101923316717148, 0.2720588743686676, -0.422206848859787, 0.18370214104652405, 0.14540210366249084, 0.020284324884414673, 0.05409002676606178, -0.3317789137363434, -0.2953717112541199, -0.09578675031661987, -0.004356507211923599, 0.04280577227473259, 0.32681983709335327, 0.05637167766690254, -0.33031874895095825, 0.09084803611040115, -0.16435058414936066, -0.017791518941521645, -0.2765514552593231, 0.12395786494016647, 0.08721005916595459, -0.03193148225545883, -0.03239673376083374, 0.06133570522069931, 0.27147531509399414, -0.14542189240455627, -0.03349567949771881, -0.16467565298080444, 0.03863038122653961, -0.22975407540798187, 0.0003014281392097473, 0.05096261203289032, -0.03613156080245972, -0.29149380326271057, 0.1301509290933609, -0.27621960639953613, -0.2964972257614136, -0.44350576400756836, 0.011632688343524933, 0.5318174958229065, -0.050988756120204926, -0.15058612823486328, 0.10793939977884293, -0.0671050027012825, 0.07196637988090515, 0.41909080743789673, -0.06037163734436035, -0.11803464591503143, 0.05342404544353485, 0.22034266591072083, 0.07750333100557327, 0.0374007374048233, -0.026510780677199364, 0.022373035550117493, 0.01931924559175968, -0.12053355574607849, 0.6809651851654053, -0.37386834621429443, -0.041519634425640106, 0.1808571070432663, 0.4064100682735443, 0.4106638431549072, -0.016671424731612206, -0.23646751046180725, -0.031865037977695465, 0.16232521831989288, -0.12897862493991852, -0.22074826061725616, 0.5588935017585754, 0.40795212984085083, -0.06616607308387756, -0.1687430441379547, -0.20340408384799957, 0.11707091331481934, 0.013695305213332176, -0.03335783630609512, 0.22014763951301575, -0.3452116847038269, 0.2957470417022705, 0.21945123374462128, 0.3496502637863159, -0.14028432965278625, 0.36453357338905334, -0.04651296138763428, 0.05978352949023247, 0.6051628589630127, 0.04592957720160484, 0.36199823021888733, -0.11392055451869965, 0.2804989218711853, -0.12840378284454346, -0.26790881156921387, 0.011650742962956429, 0.41529548168182373, -0.41705968976020813, -0.02515798807144165, 0.11631849408149719, 0.2885562777519226, -0.2023525834083557, -0.4602228105068207, -0.2728838622570038, 0.19724929332733154, -0.18832460045814514, 0.11039748787879944, 0.12817265093326569, -0.04929602891206741, 0.38457685708999634, 0.056698739528656006, -0.042901601642370224, 0.16805516183376312, 0.5128951072692871, 0.11961828172206879, -0.08679193258285522, -0.37860217690467834, 0.046905532479286194, -0.060694873332977295, 0.7053989171981812, 0.039202235639095306, -0.1274491548538208, -0.05576038360595703, -0.14386394619941711, -0.06295378506183624, 0.25311458110809326, 0.23485001921653748, 0.3261094093322754, 0.09521567821502686, 0.0006975755095481873, 0.05249415338039398, -0.02007278800010681, 0.057204484939575195, 0.39806488156318665, -0.41253337264060974, -0.06104198470711708, 0.26370546221733093, -0.0001934841275215149, -0.20627310872077942, -0.11993183195590973, -0.09616491198539734, 0.4292750358581543, -0.05845149978995323, -0.005941282957792282, -0.17577581107616425, -0.17756019532680511, -0.03151148930191994, -0.032427411526441574, 0.04105345904827118, -0.21216292679309845, 0.3163696229457855, -0.19623532891273499, -0.027689816430211067, -0.1731504499912262, 0.08565446734428406, -0.018879715353250504, 0.4744154214859009, 0.33368024230003357, -0.006198737770318985, -0.05541316419839859, -0.0606420561671257, -0.5336675643920898, -0.08005456626415253, -0.17004387080669403, 0.4145926535129547, 0.41062870621681213, 0.0478648841381073, -0.11475175619125366, -0.08593729138374329, -0.016732774674892426, -0.41956594586372375, -0.18328769505023956, 0.0057710628025233746, -0.27089744806289673, 0.05983542650938034, -0.27958106994628906, -0.24080966413021088, -0.21872709691524506, -0.44836926460266113, 0.23943206667900085, -0.08996183425188065, 0.01118151843547821, -0.10770667344331741, 0.2753807306289673, -0.12456842511892319, 0.30772003531455994, 0.08994513750076294, 0.35103219747543335, 0.0715269148349762, 0.31349802017211914, -0.0037042349576950073, -0.22423046827316284, -0.11346253752708435, -0.16229115426540375, 0.06314808875322342, -0.09062971919775009, 0.06969993561506271, -0.27856433391571045, -0.21530111134052277, 0.0004232749342918396, 0.218114972114563, -0.1326303631067276, 0.1607392281293869, -0.21840474009513855, -0.09006830304861069, -0.14558644592761993, 0.46418651938438416, -0.15959468483924866, 0.2398441731929779, 0.1691424548625946, 0.11543116718530655, -0.10514828562736511, -0.09606955945491791, 0.4097806215286255, -0.5118775963783264, -0.06989069283008575, -0.05978265404701233, 0.04562195762991905, 0.20665791630744934, -0.00542861595749855, 0.16103623807430267, -0.31282752752304077, 0.2791443467140198, 0.1847715824842453, 0.1622176468372345, 0.4200614094734192, -0.1907062977552414, -0.015506163239479065, -0.17396783828735352, -0.02159983664751053, 0.054094474762678146, -0.22721371054649353, 0.1877036988735199, -0.0024734288454055786 ]
https://github.com/huggingface/datasets/issues/5905
We plan to improve this eventually (see https://github.com/huggingface/datasets/issues/5454 and https://github.com/huggingface/datasets/issues/5380). > Is it possible to lazily load samples of a mapped dataset ? I'm used to [dataset scripts](https://huggingface.co/docs/datasets/dataset_script), maybe something can be done there. If not, I could do it using a plain Pytorch dataset. Then I would need to convert it to a datasets' dataset to get all the features of datasets. Is it something possible ? Yes, by creating a mapped dataset that stores audio URLs. Indexing a dataset in such format only downloads and decodes the bytes of the accessed samples (without storing them on disk). You can do the following to create this dataset: ```python def gen(): # Generator that yields (audio URL, text) pairs as dict ... yield {"audio": "audio_url", "text": "some text"} features = Features({"audio": datasets.Audio(), "text": datasets.Value("string")}) ds = Dataset.from_generator(gen, features=features) ds[2:5] # downloads and decodes the samples each time they are accessed ```
Offer an alternative to Iterable Dataset that allows lazy loading and processing while skipping batches efficiently
### Feature request I would like a way to resume training from a checkpoint without waiting for a very long time when using an iterable dataset. ### Motivation I am training models on the speech-recognition task. I have very large datasets that I can't comfortably store on a disk and also quite computationally intensive audio processing to do. As a result I want to load data from my remote when it is needed and perform all processing on the fly. I am currently using the iterable dataset feature of _datasets_. It does everything I need with one exception. My issue is that when resuming training at a step n, we have to download all the data and perform the processing of steps < n, just to get the iterable at the right step. In my case it takes almost as long as training for the same steps, which make resuming training from a checkpoint useless in practice. I understand that the nature of iterators make it probably nearly impossible to quickly resume training. I thought about a possible solution nonetheless : I could in fact index my large dataset and make it a mapped dataset. Then I could use set_transform to perform the processing on the fly. Finally, if I'm not mistaken, the _accelerate_ package allows to [skip steps efficiently](https://github.com/huggingface/accelerate/blob/a73898027a211c3f6dc4460351b0ec246aa824aa/src/accelerate/data_loader.py#L827) for a mapped dataset. Is it possible to lazily load samples of a mapped dataset ? I'm used to [dataset scripts](https://huggingface.co/docs/datasets/dataset_script), maybe something can be done there. If not, I could do it using a plain _Pytorch_ dataset. Then I would need to convert it to a _datasets_' dataset to get all the features of _datasets_. Is it something possible ? ### Your contribution I could provide a PR to allow lazy loading of mapped dataset or the conversion of a mapped _Pytorch_ dataset into a _Datasets_ dataset if you think it is an useful new feature.
151
Offer an alternative to Iterable Dataset that allows lazy loading and processing while skipping batches efficiently ### Feature request I would like a way to resume training from a checkpoint without waiting for a very long time when using an iterable dataset. ### Motivation I am training models on the speech-recognition task. I have very large datasets that I can't comfortably store on a disk and also quite computationally intensive audio processing to do. As a result I want to load data from my remote when it is needed and perform all processing on the fly. I am currently using the iterable dataset feature of _datasets_. It does everything I need with one exception. My issue is that when resuming training at a step n, we have to download all the data and perform the processing of steps < n, just to get the iterable at the right step. In my case it takes almost as long as training for the same steps, which make resuming training from a checkpoint useless in practice. I understand that the nature of iterators make it probably nearly impossible to quickly resume training. I thought about a possible solution nonetheless : I could in fact index my large dataset and make it a mapped dataset. Then I could use set_transform to perform the processing on the fly. Finally, if I'm not mistaken, the _accelerate_ package allows to [skip steps efficiently](https://github.com/huggingface/accelerate/blob/a73898027a211c3f6dc4460351b0ec246aa824aa/src/accelerate/data_loader.py#L827) for a mapped dataset. Is it possible to lazily load samples of a mapped dataset ? I'm used to [dataset scripts](https://huggingface.co/docs/datasets/dataset_script), maybe something can be done there. If not, I could do it using a plain _Pytorch_ dataset. Then I would need to convert it to a _datasets_' dataset to get all the features of _datasets_. Is it something possible ? ### Your contribution I could provide a PR to allow lazy loading of mapped dataset or the conversion of a mapped _Pytorch_ dataset into a _Datasets_ dataset if you think it is an useful new feature. We plan to improve this eventually (see https://github.com/huggingface/datasets/issues/5454 and https://github.com/huggingface/datasets/issues/5380). > Is it possible to lazily load samples of a mapped dataset ? I'm used to [dataset scripts](https://huggingface.co/docs/datasets/dataset_script), maybe something can be done there. If not, I could do it using a plain Pytorch dataset. Then I would need to convert it to a datasets' dataset to get all the features of datasets. Is it something possible ? Yes, by creating a mapped dataset that stores audio URLs. Indexing a dataset in such format only downloads and decodes the bytes of the accessed samples (without storing them on disk). You can do the following to create this dataset: ```python def gen(): # Generator that yields (audio URL, text) pairs as dict ... yield {"audio": "audio_url", "text": "some text"} features = Features({"audio": datasets.Audio(), "text": datasets.Value("string")}) ds = Dataset.from_generator(gen, features=features) ds[2:5] # downloads and decodes the samples each time they are accessed ```
[ -0.5211582183837891, -0.32580187916755676, -0.0443611741065979, -0.17003589868545532, 0.19427821040153503, 0.03587588667869568, 0.11266051977872849, 0.3389296531677246, 0.0867585837841034, 0.018579598516225815, 0.09652695804834366, 0.42274853587150574, -0.3746441602706909, 0.2918476164340973, 0.010705791413784027, -0.12577055394649506, -0.08972493559122086, 0.08675631880760193, -0.004491984844207764, 0.042898088693618774, -0.1454048603773117, -0.2956646978855133, -0.027635224163532257, -0.37590986490249634, 0.2567107379436493, -0.12815088033676147, 0.04247194528579712, -0.05495940521359444, 0.10584414005279541, -0.3406270146369934, 0.2840559184551239, 0.3582213819026947, 0.20864635705947876, 0.21960338950157166, -0.00011842425737995654, 0.03369700908660889, 0.08872979879379272, -0.04302807152271271, -0.38330772519111633, -0.06612402200698853, -0.008794888854026794, -0.07675620168447495, 0.0391111746430397, -0.21206383407115936, 0.005642913281917572, -0.16544923186302185, 0.20235656201839447, -0.3590533137321472, 0.3177779018878937, -0.22408367693424225, 0.03665107116103172, 0.2065376341342926, -0.6237926483154297, -0.00968187302350998, -0.2191244661808014, 0.20731854438781738, -0.12577927112579346, 0.33978158235549927, 0.4797629415988922, -0.02415306121110916, -0.16390016674995422, 0.14514832198619843, -0.32904013991355896, -0.04629497975111008, 0.39338839054107666, -0.2974362373352051, 0.042432934045791626, -0.20399218797683716, -0.07714497298002243, 0.18507255613803864, 0.24734245240688324, -0.06925519555807114, -0.2373281717300415, -0.6615225076675415, 0.1227819174528122, -0.47831472754478455, -0.21055927872657776, -0.025178546085953712, -0.16916701197624207, 0.2819756865501404, -0.41436442732810974, -0.4320458769798279, 0.021718516945838928, -0.12994630634784698, 0.1570589691400528, -0.45862099528312683, 0.1223565936088562, 0.0821637511253357, 0.16782274842262268, 0.19059030711650848, 0.46233198046684265, -0.08403818309307098, 0.3504470884799957, 0.3965757489204407, -0.39566001296043396, -0.26350870728492737, 0.0893435999751091, -0.03429420292377472, 0.26756900548934937, 0.39975211024284363, 0.2561038136482239, 0.09978598356246948, -0.04504561424255371, -0.05182753503322601, 0.013743653893470764, -0.1241833046078682, 0.031065288931131363, -0.07211484014987946, 0.027638645842671394, 0.20210379362106323, 0.09409932792186737, 0.16950830817222595, -0.18472766876220703, -0.041713543236255646, 0.15613985061645508, 0.14915446937084198, -0.12306229770183563, 0.06612904369831085, -0.18419578671455383, -0.10501401871442795, -0.381603479385376, -0.0621166005730629, 0.07307660579681396, 0.3168676495552063, -0.12641102075576782, 0.2591320872306824, -0.02828678861260414, 0.00316435843706131, -0.09715421497821808, -0.29473215341567993, 0.027724027633666992, -0.1113390177488327, -0.0857045128941536, 0.39649441838264465, 0.22151876986026764, -0.2656770348548889, 0.031123921275138855, -0.07133635878562927, -0.2262464016675949, 0.21255742013454437, 0.48868095874786377, -0.12132906913757324, 0.2029641568660736, -0.17062006890773773, -0.11836478114128113, 0.061424098908901215, 0.046612270176410675, 0.3373541533946991, -0.17943653464317322, 0.330795556306839, -0.03702235594391823, -0.325406551361084, 0.3697364628314972, 0.017885442823171616, -0.27127736806869507, -0.17406724393367767, -0.35866081714630127, 0.31985363364219666, -0.10726213455200195, -0.18569496273994446, 0.2732279896736145, -0.12984085083007812, -0.30728569626808167, -0.2248753011226654, 0.26051321625709534, 0.4456571340560913, -0.20605139434337616, -0.2756517827510834, 0.14109766483306885, 0.007322024554014206, 0.050409745424985886, 0.3759784996509552, -0.21362072229385376, 0.6210450530052185, -0.020090240985155106, -0.022812798619270325, 0.14139322936534882, -0.11950723826885223, -0.38930702209472656, 0.41989564895629883, -0.05707484111189842, 0.3504956066608429, -0.039603423327207565, 0.16159725189208984, 0.1949773132801056, -0.10110015422105789, 0.22338874638080597, 0.3974723517894745, -0.1447477489709854, -0.02520090714097023, -0.024383820593357086, -0.4700331389904022, 0.3314438462257385, 0.42312514781951904, 0.13667415082454681, -0.033224448561668396, -0.12145735323429108, -0.289498507976532, 0.38946276903152466, -0.2562345266342163, 0.08992069214582443, 0.24271245300769806, 0.05517655611038208, -0.046127721667289734, -0.2843184173107147, -0.28561848402023315, -0.3856063187122345, 0.20050455629825592, 0.1228308379650116, -0.22213022410869598, 0.05567343533039093, -0.14120912551879883, 0.10626225173473358, -0.034735940396785736, -0.17693403363227844, 0.03348333388566971, -0.0719967782497406, -0.017027270048856735, 0.1698712259531021, 0.013734892010688782, -0.39360663294792175, 0.24786056578159332, -0.27567416429519653, 0.01480327919125557, -0.41218096017837524, 0.27047520875930786, 0.7349912524223328, 0.05723830685019493, -0.11601769924163818, 0.2821839153766632, 0.019423754885792732, -0.3607061505317688, 0.20452606678009033, 0.21935275197029114, 0.032051242887973785, 0.232815220952034, 0.08132682740688324, 0.36673441529273987, 0.04432738572359085, -0.01708988845348358, -0.10568609833717346, 0.08155979216098785, 0.0501139871776104, -0.16721007227897644, -0.22914890944957733, 0.5030154585838318, -0.2007840871810913, 0.30280882120132446, 0.259033739566803, -0.000560171902179718, 0.190183624625206, -0.20629912614822388, -0.3787863552570343, 0.32270216941833496, 0.4353281557559967, -0.00021548010408878326, 0.34708598256111145, 0.025457678362727165, -0.48482611775398254, -0.008210614323616028, 0.151752769947052, -0.25390005111694336, -0.14601805806159973, -0.07836920768022537, -0.16926124691963196, 0.03928987681865692, 0.2639719545841217, 0.03422343730926514, 0.27157843112945557, -0.021461445838212967, -0.07329066097736359, -0.04235263168811798, 0.16753317415714264, 0.14189420640468597, 0.24876829981803894, -0.07879095524549484, 0.3766241669654846, 0.16653576493263245, 0.16913995146751404, -0.015565292909741402, -0.11178763210773468, -0.2976394593715668, 0.20458564162254333, -0.11747664213180542, 0.12901471555233002, -0.08554226905107498, -0.2752119302749634, -0.16194762289524078, 0.038272347301244736, -0.025555990636348724, 0.06152039021253586, -0.08613649010658264, -0.07605578005313873, 0.5357425212860107, 0.1115570142865181, 0.1644907295703888, -0.1941981315612793, 0.4730697274208069, 0.024514518678188324, -0.5958922505378723, 0.020764976739883423, -0.2232886552810669, 0.3023415803909302, -0.08634204417467117, 0.25178366899490356, -0.11183105409145355, 0.3597116768360138, 0.0007451549172401428, -0.37341421842575073, -0.4861032962799072, 0.2499392032623291, 0.3997115194797516, -0.025901230052113533, -0.0574498251080513, 0.13987326622009277, 0.2021854817867279, -0.21018946170806885, 0.011660449206829071, 0.08403117954730988, -0.2623496949672699, -0.10222002863883972, -0.10047729313373566, -0.08034995198249817, 0.17445407807826996, 0.15580210089683533, 0.09048214554786682, -0.3686037063598633, -0.30239883065223694, 0.37312600016593933, -0.004062354564666748, -0.09332748502492905, 0.2540610730648041, 0.051895249634981155, 0.04435915872454643, 0.06652690470218658, -0.179460808634758, -0.08321698009967804, -0.4686855673789978, 0.31682488322257996, -0.2054620385169983, -0.19813892245292664, -0.31721001863479614, -0.18721342086791992, 0.10791682451963425, 0.423744261264801, -0.5813741683959961, -0.03899992257356644, -0.17019471526145935, 0.5372665524482727, -0.3272952735424042, -0.16688977181911469, 0.22252070903778076, 0.1789497435092926, 0.17511484026908875, 0.04001946002244949, 0.024247966706752777, -0.035506490617990494, 0.22523944079875946, 0.08841299265623093, 0.24964205920696259, 0.15879517793655396, 0.212514728307724, 1.2698290348052979, 0.3089157044887543, 0.01659044809639454, 0.10433761775493622, -0.02367306314408779, 0.04566832259297371, -0.22938773036003113, -0.298819899559021, -0.07829540222883224, -0.4158206880092621, -0.15486828982830048, 0.17503246665000916, -0.23056934773921967, -0.19027569890022278, -0.1757366955280304, -0.24796578288078308, 0.2011391818523407, -0.3308200240135193, 0.14328345656394958, -0.26306119561195374, 0.4671482741832733, 0.09120334684848785, 0.3067586421966553, -0.5011712312698364, -0.045846305787563324, 0.3349473178386688, -0.01966601237654686, 0.6174255609512329, -0.09373107552528381, -0.5049653053283691, 0.1616438329219818, -0.6618967652320862, 0.13110487163066864, 0.22843360900878906, 0.053433291614055634, 0.20215055346488953, -0.2673007845878601, 0.06041736528277397, 0.032429784536361694, 0.7019933462142944, 0.005971396341919899, -0.05385628715157509, -0.012220796197652817, -0.2953534722328186, -0.15619763731956482, 0.016782686114311218, 0.10036996006965637, 0.5008976459503174, 0.1955508291721344, 0.25093987584114075, -0.2301892340183258, -0.09797030687332153, -0.0589204877614975, 0.3062029182910919, -0.2287992238998413, -0.2164817452430725, 0.1816003918647766, -0.1560211181640625, -0.36640501022338867, -0.09500101208686829, 0.19858050346374512, 0.11489437520503998, -0.1611258089542389, 0.033682458102703094, -0.31381848454475403, 0.20301374793052673, 0.2266215980052948, 0.0000818893313407898, 0.04988257586956024, 0.0005515702068805695, 0.46790599822998047, 0.23074883222579956, 0.15723568201065063, 0.14643073081970215, 0.5708297491073608, 0.011042043566703796, -0.44303545355796814, -0.01911972090601921, 0.033230554312467575, 0.49186375737190247, 0.5037779211997986, 0.01348140835762024, 0.4234135150909424, 0.19102662801742554, 0.10689479112625122, -0.5631385445594788, -0.023379087448120117, 0.02700081095099449, 0.13174694776535034, -0.47313717007637024, -0.5773106813430786, 0.11625797301530838, 0.11367687582969666, -0.09824226796627045, 0.27719002962112427, -0.3361293077468872, 0.04313405603170395, 0.31845682859420776, -0.04977590590715408, 0.8057478070259094, -0.013877542689442635, 0.31710192561149597, 0.31070223450660706, 0.6640700101852417, 0.34492239356040955, -0.12183989584445953, 0.3784960210323334, -0.10983436554670334, -0.7608097195625305, -0.014413610100746155, -0.17960387468338013, -0.21405357122421265, 0.12545153498649597, 0.004567727446556091, 0.5212290287017822, 0.3007894456386566, -0.0049413591623306274, -0.012984130531549454, 0.08630705624818802, 0.012899016961455345, -0.31069812178611755, -0.03748561069369316, -0.004372444003820419, 0.10981129854917526, 0.106930211186409, -0.14760169386863708, -0.1341250091791153, 0.2328644096851349, 0.16046415269374847, -0.10144282877445221, -0.04226209968328476, -0.3667263984680176, 0.09237799048423767, 0.10825656354427338, -0.22632162272930145, 0.16364073753356934, 0.008151907473802567, -0.03701034188270569, -0.16897740960121155, -0.21234694123268127, 0.030230514705181122, 0.18873503804206848, 0.06684748828411102, -0.14568346738815308, -0.06985744088888168, 0.48022931814193726, 0.1252593696117401, 0.17800430953502655, -0.02405291423201561, -0.18584679067134857, -0.4447951018810272, -0.010373160243034363, -0.1619376391172409, 0.1591065675020218, -0.2271961271762848, -0.3918769955635071, 0.23575472831726074, -0.06031618267297745, -0.18301662802696228, -0.056764498353004456, 0.12610305845737457, 0.04859436675906181, 0.2698856592178345, 0.04885195940732956, -0.04199477285146713, 0.049358054995536804, 0.35295915603637695, -0.22173114120960236, -0.3575547933578491, 0.5791332125663757, 0.14502310752868652, -0.2511390447616577, -0.07476335763931274, 0.03466671705245972, 0.12889464199543, -0.3607226610183716, 0.25717636942863464, -0.1642182171344757, 0.4707711935043335, -0.14143240451812744, 0.13320282101631165, 0.11011604219675064, -0.2908174395561218, -0.32998961210250854, -0.20198829472064972, -0.26169848442077637, 0.23883040249347687, 0.07893599569797516, 0.15369339287281036, 0.07529279589653015, 0.11845444142818451, -0.081504225730896, -0.006223516538739204, -0.1985355019569397, 0.10684027522802353, 0.04158139228820801, 0.0329061858355999, 0.19974957406520844, -0.11139962077140808, -0.02284359186887741, -0.04352635517716408, -0.03965301811695099, 0.22910025715827942, 0.026735566556453705, -0.12352339923381805, -0.1888222098350525, 0.19843795895576477, 0.04423065111041069, -0.07731202244758606, 0.3253917694091797, -0.26360127329826355, -0.10296628624200821, -0.3460562825202942, -0.03734981641173363, 0.11275508999824524, 0.003529457375407219, -0.165697380900383, 0.1155817061662674, 0.07689269632101059, -0.27768173813819885, 0.2264334261417389, 0.08430787920951843, 0.10732906311750412, -0.17443633079528809, 0.17788967490196228, 0.08058290183544159, -0.06325066834688187, 0.0013021156191825867, 0.09099216014146805, 0.6768099069595337, -0.05634230747818947, 0.44489264488220215, -0.17055962979793549, -0.17733271420001984, -0.031177539378404617, 0.26794421672821045, 0.45077142119407654, -0.39302462339401245, 0.2699466347694397, 0.45102423429489136, 0.10920076817274094, -0.23314924538135529, -0.05193807929754257, 0.2828068435192108, -0.10013286024332047, 0.21893778443336487, 0.30327993631362915, 0.10377926379442215, -0.024476446211338043, 0.12928742170333862, -0.12152042984962463, -0.05945026874542236, -0.197702556848526, -0.04345147684216499, 0.5206990838050842, 0.3055073916912079, -0.27933359146118164, 0.32387828826904297, 0.45241978764533997, 0.2728058099746704, 0.18597868084907532, -0.021257750689983368, 0.2276388555765152, 0.15861018002033234, 0.03877025470137596, -0.08297792077064514, -0.4800127148628235, -0.2019633650779724, 0.05175861343741417, 0.1812339425086975, 0.3428327739238739, -0.02224549651145935, 0.2149002104997635, 0.04954106733202934, -0.07053482532501221, -0.032790664583444595, 0.3263874053955078, 0.04599504545331001, -0.18103663623332977, -0.16709408164024353, -0.15463683009147644, -0.10903708636760712, 0.19193659722805023, -0.1421695053577423, -0.2861885726451874, 0.4562649726867676, 0.16082099080085754, 0.4220670461654663, -0.1945367008447647, 0.026808150112628937, 0.08728587627410889, 0.41555872559547424, -0.2089865505695343, -0.09897130727767944, -0.11495307832956314, -0.0707709789276123, -0.26810726523399353, 0.21590234339237213, 0.04627944156527519, 0.14357522130012512, -0.4845742881298065, 0.23093077540397644, -0.09394465386867523, 0.06051665544509888, -0.11405470967292786, 0.1551709771156311, -0.1443871259689331, -0.05231960862874985, 0.49046817421913147, -0.05054941028356552, 0.013130944222211838, 0.2930467426776886, -0.008865207433700562, -0.0849202498793602, -0.5735170841217041, 0.18869930505752563, 0.32184094190597534, -0.13722360134124756, -0.04575575515627861, 0.07617414742708206, -0.15952757000923157, 0.10702165216207504, 0.375146746635437, -0.3958037495613098, 0.16980385780334473, 0.08995074033737183, 0.06859453022480011, -0.4634840190410614, 0.2051025927066803, 0.30757156014442444, 0.218778595328331, -0.20027312636375427, 0.022621840238571167, -0.2810460031032562, -0.2126632183790207, -0.05194568261504173, 0.1563607156276703, 0.1576443463563919, 0.11675811558961868, 0.1881553828716278, 0.3587346374988556, -0.1459963321685791, -0.34349459409713745, 0.027378126978874207, 0.5123782157897949, -0.12928447127342224, -0.28999707102775574, 0.011911544017493725, 0.16886474192142487, 0.08529546856880188, -0.3965243697166443, 0.1442255675792694, -0.15289895236492157, -0.14949581027030945, -0.011711597442626953, -0.08234305679798126, -0.013917475938796997, -0.0812491700053215, 0.2898407578468323, -0.027113469317555428, -0.04467950761318207, -0.05780699849128723, -0.13603508472442627, 0.07726651430130005, 0.11178089678287506, -0.05590137839317322, 0.15761323273181915, 0.1401177942752838, 0.1166624128818512, -0.2362351417541504, 0.11545286327600479, -0.13724669814109802, -0.13967490196228027, 0.2136346846818924, 0.07127673178911209, -0.6055444478988647, 0.0803285539150238, -0.34706395864486694, 0.23681634664535522, -0.19180577993392944, 0.3476038873195648, -0.2872440814971924, 0.17385122179985046, -0.2641632556915283, 0.0024910569190979004, 0.44007518887519836, -0.6315680742263794, -0.23680850863456726, 0.0658387541770935, -0.16293184459209442, 0.19072487950325012, -0.012849307619035244, -0.2938203513622284, -0.011434853076934814, 0.27784040570259094, -0.1540614813566208, -0.01338399201631546, 0.2830432057380676, -0.11189830303192139, -0.06304991245269775, -0.12438277900218964, 0.3268682658672333, 0.0078120045363903046, -0.24437645077705383, -0.1485271453857422, -0.3554859757423401 ]
https://github.com/huggingface/datasets/issues/5895
Thanks for reporting, @DongHande. I think the issue is caused by the metadata in the dataset card: in the header of the `README.md`, they state that the dataset has 4 splits ("finetune", "reward", "rl", "evaluation"). ```yaml splits: - name: finetune num_bytes: 6674567576 num_examples: 3000000 - name: reward num_bytes: 6674341521 num_examples: 3000000 - name: rl num_bytes: 6679279968 num_examples: 3000000 - name: evaluation num_bytes: 4022714493 num_examples: 1807695 ``` I guess the user wanted to define these as configs, instead of splits. This is not yet supported for no-script datasets, but will be soon supported. See: - #5331 I think we should contact the dataset author to inform about the issue with the split names, as you already did: https://huggingface.co/datasets/ArmelR/stack-exchange-instruction/discussions/1 Let's continue the discussion there!
The dir name and split strings are confused when loading ArmelR/stack-exchange-instruction dataset
### Describe the bug When I load the ArmelR/stack-exchange-instruction dataset, I encounter a bug that may be raised by confusing the dir name string and the split string about the dataset. When I use the script "datasets.load_dataset('ArmelR/stack-exchange-instruction', data_dir="data/finetune", split="train", use_auth_token=True)", it fails. But it succeeds when I add the "streaming = True" parameter. The website of the dataset is https://huggingface.co/datasets/ArmelR/stack-exchange-instruction/ . The traceback logs are as below: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/xxx/miniconda3/envs/code/lib/python3.9/site-packages/datasets/load.py", line 1797, in load_dataset builder_instance.download_and_prepare( File "/home/xxx/miniconda3/envs/code/lib/python3.9/site-packages/datasets/builder.py", line 890, in download_and_prepare self._download_and_prepare( File "/home/xxx/miniconda3/envs/code/lib/python3.9/site-packages/datasets/builder.py", line 985, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/xxx/miniconda3/envs/code/lib/python3.9/site-packages/datasets/builder.py", line 1706, in _prepare_split split_info = self.info.splits[split_generator.name] File "/home/xxx/miniconda3/envs/code/lib/python3.9/site-packages/datasets/splits.py", line 530, in __getitem__ instructions = make_file_instructions( File "/home/xxx/miniconda3/envs/code/lib/python3.9/site-packages/datasets/arrow_reader.py", line 112, in make_file_instructions name2filenames = { File "/home/xxx/miniconda3/envs/code/lib/python3.9/site-packages/datasets/arrow_reader.py", line 113, in <dictcomp> info.name: filenames_for_dataset_split( File "/home/xxx/miniconda3/envs/code/lib/python3.9/site-packages/datasets/naming.py", line 70, in filenames_for_dataset_split prefix = filename_prefix_for_split(dataset_name, split) File "/home/xxx/miniconda3/envs/code/lib/python3.9/site-packages/datasets/naming.py", line 54, in filename_prefix_for_split if os.path.basename(name) != name: File "/home/xxx/miniconda3/envs/code/lib/python3.9/posixpath.py", line 142, in basename p = os.fspath(p) TypeError: expected str, bytes or os.PathLike object, not NoneType ### Steps to reproduce the bug 1. import datasets library function: ```from datasets import load_dataset``` 2. load dataset: ```ds=load_dataset('ArmelR/stack-exchange-instruction', data_dir="data/finetune", split="train", use_auth_token=True)``` ### Expected behavior The dataset can be loaded successfully without the streaming setting. ### Environment info Linux, python=3.9 datasets=2.12.0
122
The dir name and split strings are confused when loading ArmelR/stack-exchange-instruction dataset ### Describe the bug When I load the ArmelR/stack-exchange-instruction dataset, I encounter a bug that may be raised by confusing the dir name string and the split string about the dataset. When I use the script "datasets.load_dataset('ArmelR/stack-exchange-instruction', data_dir="data/finetune", split="train", use_auth_token=True)", it fails. But it succeeds when I add the "streaming = True" parameter. The website of the dataset is https://huggingface.co/datasets/ArmelR/stack-exchange-instruction/ . The traceback logs are as below: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/xxx/miniconda3/envs/code/lib/python3.9/site-packages/datasets/load.py", line 1797, in load_dataset builder_instance.download_and_prepare( File "/home/xxx/miniconda3/envs/code/lib/python3.9/site-packages/datasets/builder.py", line 890, in download_and_prepare self._download_and_prepare( File "/home/xxx/miniconda3/envs/code/lib/python3.9/site-packages/datasets/builder.py", line 985, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/xxx/miniconda3/envs/code/lib/python3.9/site-packages/datasets/builder.py", line 1706, in _prepare_split split_info = self.info.splits[split_generator.name] File "/home/xxx/miniconda3/envs/code/lib/python3.9/site-packages/datasets/splits.py", line 530, in __getitem__ instructions = make_file_instructions( File "/home/xxx/miniconda3/envs/code/lib/python3.9/site-packages/datasets/arrow_reader.py", line 112, in make_file_instructions name2filenames = { File "/home/xxx/miniconda3/envs/code/lib/python3.9/site-packages/datasets/arrow_reader.py", line 113, in <dictcomp> info.name: filenames_for_dataset_split( File "/home/xxx/miniconda3/envs/code/lib/python3.9/site-packages/datasets/naming.py", line 70, in filenames_for_dataset_split prefix = filename_prefix_for_split(dataset_name, split) File "/home/xxx/miniconda3/envs/code/lib/python3.9/site-packages/datasets/naming.py", line 54, in filename_prefix_for_split if os.path.basename(name) != name: File "/home/xxx/miniconda3/envs/code/lib/python3.9/posixpath.py", line 142, in basename p = os.fspath(p) TypeError: expected str, bytes or os.PathLike object, not NoneType ### Steps to reproduce the bug 1. import datasets library function: ```from datasets import load_dataset``` 2. load dataset: ```ds=load_dataset('ArmelR/stack-exchange-instruction', data_dir="data/finetune", split="train", use_auth_token=True)``` ### Expected behavior The dataset can be loaded successfully without the streaming setting. ### Environment info Linux, python=3.9 datasets=2.12.0 Thanks for reporting, @DongHande. I think the issue is caused by the metadata in the dataset card: in the header of the `README.md`, they state that the dataset has 4 splits ("finetune", "reward", "rl", "evaluation"). ```yaml splits: - name: finetune num_bytes: 6674567576 num_examples: 3000000 - name: reward num_bytes: 6674341521 num_examples: 3000000 - name: rl num_bytes: 6679279968 num_examples: 3000000 - name: evaluation num_bytes: 4022714493 num_examples: 1807695 ``` I guess the user wanted to define these as configs, instead of splits. This is not yet supported for no-script datasets, but will be soon supported. See: - #5331 I think we should contact the dataset author to inform about the issue with the split names, as you already did: https://huggingface.co/datasets/ArmelR/stack-exchange-instruction/discussions/1 Let's continue the discussion there!
[ -0.18878328800201416, 0.11666661500930786, -0.009306628257036209, 0.3903152644634247, 0.3031923174858093, 0.10729029774665833, 0.4822986125946045, 0.03589969873428345, -0.10991010069847107, 0.2267778515815735, -0.14854778349399567, 0.31327390670776367, 0.03887961432337761, 0.01273556798696518, 0.030958566814661026, -0.14826221764087677, 0.08923669904470444, -0.05253982171416283, 0.18203845620155334, 0.02456163614988327, -0.20450881123542786, 0.25665414333343506, -0.35187339782714844, 0.024639813229441643, 0.01639893278479576, 0.23725998401641846, -0.05754214525222778, 0.33849313855171204, 0.15382875502109528, -0.26845479011535645, 0.2021138072013855, -0.0710909515619278, 0.05932313948869705, 0.6375648975372314, -0.00012400261766742915, 0.09443458914756775, 0.37021297216415405, -0.11195312440395355, -0.7896526455879211, -0.3783535063266754, -0.34405648708343506, 0.14566615223884583, 0.19730837643146515, -0.2638493776321411, 0.11205054819583893, 0.010168612003326416, 0.12436908483505249, -0.44937074184417725, 0.3260076344013214, 0.4373878240585327, 0.09370442479848862, -0.048222124576568604, -0.1167335957288742, 0.052408814430236816, 0.21235059201717377, 0.49498191475868225, -0.08155835419893265, 0.10093407332897186, 0.010362723842263222, 0.39489391446113586, -0.23845842480659485, 0.12269431352615356, -0.06575454771518707, 0.01891806349158287, 0.24423742294311523, 0.3117596507072449, -0.2983168959617615, -0.16325178742408752, 0.11339303851127625, 0.1399373561143875, 0.4036963880062103, -0.08559544384479523, -0.1633283495903015, -0.4167027473449707, -0.0666263997554779, -0.17229506373405457, 0.33453601598739624, 0.1642185002565384, -0.2591831088066101, 0.12836626172065735, -0.12939642369747162, -0.16640117764472961, -0.20155297219753265, 0.33546119928359985, -0.02119075506925583, 0.5980279445648193, -0.034893009811639786, 0.22749245166778564, -0.06711164116859436, 0.015709711238741875, 0.47840073704719543, -0.2284843623638153, 0.034375209361314774, 0.19599170982837677, -0.1884099245071411, 0.3124566376209259, -0.4121398627758026, 0.22140370309352875, -0.02056640386581421, 0.2065574824810028, 0.10067790746688843, -0.08763112127780914, 0.07788245379924774, 0.12271392345428467, 0.18732140958309174, 0.23208163678646088, 0.1368110030889511, 0.4653362035751343, 0.18960268795490265, 0.38569867610931396, -0.16117209196090698, 0.021178925409913063, -0.21708226203918457, 0.06945249438285828, -0.19098472595214844, -0.05796448886394501, 0.10351324081420898, -0.1951223760843277, -0.4615960121154785, -0.1965492069721222, -0.3501743674278259, -0.17816129326820374, 0.23526446521282196, 0.279500812292099, 0.15140241384506226, 0.13652102649211884, 0.13558247685432434, 0.3424913287162781, -0.12776416540145874, -0.07357273250818253, -0.19095350801944733, -0.3190755844116211, -0.2363974153995514, 0.03187823295593262, 0.23272177577018738, -0.23173308372497559, 0.29081234335899353, -0.07506095618009567, 0.16089457273483276, -0.2264196276664734, -0.27319738268852234, 0.11617907136678696, -0.05575069412589073, 0.04223012924194336, 0.0528111606836319, 0.2730571925640106, -0.06278864294290543, -0.016245439648628235, 0.012737616896629333, 0.20728793740272522, -0.49444517493247986, -0.34028035402297974, 0.13778886198997498, 0.08927203714847565, 0.034598320722579956, 0.0438026562333107, -0.13758859038352966, 0.008245245553553104, 0.19308556616306305, -0.03314592316746712, -0.0308116115629673, -0.1750948578119278, -0.06616173684597015, -0.16581295430660248, 0.2980254888534546, 0.2201932817697525, -0.3749351501464844, -0.315674364566803, -0.2820948362350464, -0.09544110298156738, 0.23350098729133606, 0.08956485986709595, -0.1070488691329956, 0.08014954626560211, -0.29861700534820557, 0.08037903904914856, 0.3401455283164978, -0.611150860786438, -0.22462263703346252, 0.573430061340332, -0.06737601011991501, 0.07862566411495209, 0.301643431186676, -0.062209177762269974, 0.17568348348140717, -0.17603525519371033, 0.10383739322423935, 0.6382597088813782, -0.19493107497692108, 0.07270046323537827, -0.04910773038864136, -0.06678088009357452, -0.0783357322216034, 0.2553640305995941, -0.10426735132932663, -0.04391954094171524, 0.010239318013191223, 0.1904635727405548, 0.467016339302063, 0.025744564831256866, 0.157966747879982, 0.04254952073097229, -0.12204690277576447, 0.2628263235092163, 0.12734533846378326, 0.360069215297699, -0.6816455125808716, 0.033994726836681366, 0.3738153278827667, -0.0353536531329155, -0.22356891632080078, 0.045626915991306305, -0.24989211559295654, -0.1330292969942093, -0.2979794144630432, -0.07193223387002945, 0.0033090487122535706, 0.22230164706707, -0.01734662428498268, -0.14006838202476501, -0.018702752888202667, 0.522127091884613, -0.1657474935054779, 0.3391280174255371, -0.37154823541641235, 0.2709959149360657, 0.036507800221443176, -0.00469629094004631, -0.2453957051038742, 0.0257810577750206, 0.16976405680179596, -0.061058368533849716, -0.3243613839149475, 0.6344674229621887, 0.08196278661489487, 0.06955786049365997, -0.34309810400009155, -0.22686374187469482, 0.019596276804804802, -0.1320926994085312, 0.23115602135658264, 0.13676817715168, 0.004140108823776245, -0.13246892392635345, -0.011420078575611115, 0.033789269626140594, -0.17965179681777954, 0.580644965171814, 0.024864643812179565, -0.15104392170906067, 0.2396533191204071, -0.08161944150924683, -0.007606472820043564, -0.4316070079803467, 0.2904961109161377, -0.26565149426460266, 0.5850098133087158, -0.14478807151317596, -0.16698244214057922, -0.07554499804973602, 0.250990629196167, -0.10485352575778961, -0.03447272628545761, 0.11266598850488663, -0.170852929353714, -0.09754481911659241, -0.17130354046821594, 0.4388330578804016, 0.5016593933105469, 0.09075349569320679, 0.006749737076461315, -0.0010316800326108932, 0.04292668402194977, -0.2966381013393402, 0.36755651235580444, 0.33317700028419495, 0.061477866023778915, 0.09895522892475128, -0.06244409829378128, -0.28876858949661255, -0.16036319732666016, -0.45632144808769226, 0.18508169054985046, 0.05733778327703476, -0.4662603735923767, 0.2816912829875946, -0.1756550520658493, -0.1490931361913681, -0.41974109411239624, -0.4147944450378418, -0.0959625095129013, -0.4139900207519531, -0.0512368381023407, 0.15676318109035492, -0.11145727336406708, 0.1429421305656433, -0.3322109878063202, 0.06773893535137177, -0.3074793219566345, -0.04745446890592575, -0.2911362946033478, 0.07086991518735886, -0.37895467877388, -0.09743457287549973, 0.34616997838020325, -0.022304652258753777, 0.06332837790250778, -0.30645185708999634, -0.13959719240665436, -0.2501695454120636, 0.008621662855148315, 0.31840041279792786, -0.26850926876068115, 0.20755809545516968, -0.006457511335611343, -0.13094332814216614, 0.22538170218467712, -0.40984398126602173, 0.13709259033203125, -0.3059955835342407, -0.16784164309501648, 0.1208009421825409, 0.26586490869522095, 0.03664989769458771, -0.11454759538173676, -0.3370259702205658, -0.26848742365837097, -0.24404755234718323, -0.0411844439804554, -0.02895767241716385, 0.14393772184848785, -0.09642675518989563, -0.3267342448234558, -0.08648762106895447, -0.1439233422279358, -0.12345679104328156, -0.21880096197128296, -0.24032853543758392, 0.11014176905155182, -0.21368330717086792, 0.10879239439964294, -0.028203077614307404, 0.16298604011535645, 0.12031519412994385, 0.09682980179786682, -0.3108755052089691, 0.24344651401042938, -0.057818710803985596, -0.11297718435525894, -0.2577749490737915, -0.058325789868831635, -0.07545560598373413, -0.055966734886169434, 0.12010695040225983, -0.2894507944583893, -0.10756239295005798, 0.3072803020477295, -0.13407734036445618, 0.23494455218315125, 0.03164183348417282, 0.4830384850502014, -0.347982794046402, 0.45036792755126953, 0.14290958642959595, -0.13570339977741241, 0.1369512975215912, 0.06864002346992493, 0.05256636068224907, -0.1225752905011177, -0.025713223963975906, 0.20197901129722595, 0.00991910696029663, -0.24353012442588806, 0.5022016167640686, 0.05521395057439804, -0.14752274751663208, -0.2683432698249817, 0.17812737822532654, -0.2779921293258667, -0.3298816382884979, 0.1011074036359787, -0.18633395433425903, -0.00035140663385391235, -0.013027366250753403, 0.29436296224594116, 0.0981651246547699, -0.40849512815475464, -0.0884554386138916, 0.12440221011638641, 0.048078566789627075, -0.011521469801664352, -0.120099276304245, -0.2036992460489273, -0.24591325223445892, 0.33395516872406006, 0.18066105246543884, 0.45333144068717957, -0.07662887871265411, -0.19633786380290985, 0.2951483130455017, 0.3799111843109131, 0.6764718890190125, -0.2165420949459076, 0.017972804605960846, 0.07807314395904541, 0.49417513608932495, -0.1785023808479309, -0.13051201403141022, -0.35327890515327454, 0.13623498380184174, 0.18698152899742126, 0.13489346206188202, -0.35685497522354126, -0.17913007736206055, 0.2803082764148712, 0.23505833745002747, -0.2012774497270584, -0.20564688742160797, -0.12739281356334686, -0.07058794796466827, -0.02885492891073227, -0.17458471655845642, 0.1874333918094635, 0.1022593230009079, 0.0397738516330719, 0.09377266466617584, 0.004981080070137978, -0.07332362234592438, 0.19427625834941864, 0.051280226558446884, 0.3382464647293091, -0.15787319839000702, 0.12880972027778625, 0.17600439488887787, 0.15035180747509003, 0.6482643485069275, 0.7501967549324036, -0.3680453896522522, -0.22634966671466827, 0.29982873797416687, -0.08971194177865982, 0.2602224051952362, 0.4361383318901062, -0.09860574454069138, 0.027194466441869736, 0.010776776820421219, 0.3444571793079376, 0.0208621546626091, -0.03236757218837738, 0.38284242153167725, -0.13044552505016327, -0.6438276767730713, -0.5825425982475281, 0.3090601861476898, 0.031008005142211914, -0.07759612798690796, 0.29197561740875244, 0.1042521744966507, -0.564700722694397, 0.4392770230770111, -0.1614859700202942, 0.9716904759407043, 0.1664864420890808, 0.1452917605638504, 0.16673226654529572, -0.23501406610012054, 0.3395170569419861, -0.2525433301925659, 0.15825796127319336, -0.3739648461341858, 0.06343632936477661, -0.14803102612495422, -0.1378529667854309, -0.13263723254203796, 0.34874290227890015, -0.30099284648895264, 0.39458364248275757, -0.3586537539958954, 0.26066169142723083, -0.09272247552871704, 0.3308112621307373, -0.39494115114212036, -0.22826217114925385, -0.3178224563598633, -0.017582684755325317, 0.0014486946165561676, 0.17953959107398987, 0.15882238745689392, 0.01990959420800209, -0.15037155151367188, -0.17030881345272064, -0.1468603014945984, 0.37879160046577454, -0.17670288681983948, 0.08425112068653107, -0.20152845978736877, -0.3409910202026367, 0.11065611988306046, 0.05320551246404648, 0.37123599648475647, -0.13684645295143127, 0.04009387642145157, 0.36251935362815857, 0.14699144661426544, 0.26917344331741333, 0.04780034348368645, -0.11028186231851578, 0.3752152919769287, 0.1208779588341713, 0.031332194805145264, -0.10357639193534851, -0.03620435297489166, -0.2787296772003174, -0.3857332468032837, -0.020359143614768982, 0.3126566410064697, -0.46620118618011475, 0.03218405321240425, -0.07258923351764679, 0.21367870271205902, -0.18446943163871765, -0.010118473321199417, -0.05235960707068443, 0.0698067843914032, -0.11400704085826874, -0.11054757982492447, -0.47986555099487305, -0.1321730613708496, 0.17193399369716644, 0.0726630836725235, -0.0018516778945922852, 0.6035215854644775, 0.1803174614906311, -0.06400632113218307, -0.1047491803765297, 0.19508561491966248, 0.34974992275238037, -0.7611278891563416, 0.13850194215774536, -0.05968525633215904, 0.00012969970703125, 0.009183436632156372, -0.0852281004190445, 0.04982055351138115, 0.3014867603778839, -0.3401702046394348, -0.39285293221473694, -0.06917877495288849, 0.08869870007038116, 0.07063339650630951, 0.021746817976236343, -0.06802095472812653, -0.04721839725971222, -0.03597908839583397, -0.1917278915643692, -0.1550961434841156, 0.1363706886768341, 0.11976486444473267, 0.11621493101119995, -0.16704612970352173, 0.21179959177970886, 0.6425046920776367, 0.048622988164424896, 0.05329662561416626, -0.16059350967407227, 0.030950233340263367, -0.013853341341018677, -0.1538970172405243, 0.19322289526462555, 0.09205484390258789, 0.03747575730085373, -0.3413282632827759, -0.2000354379415512, 0.08535608649253845, -0.17676684260368347, 0.370846152305603, 0.3040395975112915, 0.1753331422805786, -0.1130603700876236, 0.19170498847961426, 0.13528989255428314, 0.009812690317630768, 0.09032007306814194, -0.18760040402412415, 0.32942113280296326, 0.14075863361358643, 0.17486917972564697, -0.15136323869228363, -0.16095022857189178, -0.24313288927078247, 0.1209564059972763, 0.1740928590297699, 0.4366360008716583, -0.0012976918369531631, -0.3410966396331787, 0.036606818437576294, -0.10732167214155197, 0.2439917027950287, 0.7205314636230469, -0.12093541771173477, -0.34701597690582275, 0.253168523311615, 0.08216553926467896, 0.1538029909133911, -0.1465826779603958, -0.0765087902545929, -0.01862303353846073, -0.06542810797691345, 0.3679443597793579, -0.23172497749328613, -0.06095649302005768, -0.5161129236221313, -0.04675281420350075, 0.5843291282653809, 0.29708313941955566, 0.15186235308647156, 0.7732347846031189, -0.06180783733725548, 0.22726647555828094, 0.10127972066402435, -0.22897641360759735, 0.22485631704330444, 0.4315159022808075, -0.1141766905784607, 0.4503194987773895, 0.0995449498295784, 0.10061635822057724, 0.287059485912323, -0.21019499003887177, -0.4316627085208893, 0.04898294433951378, -0.2263430953025818, 0.18740399181842804, 0.044415999203920364, 0.4223369359970093, -0.17450545728206635, -0.05123462527990341, -0.35552212595939636, -0.14188243448734283, 0.017719486728310585, -0.13132509589195251, -0.27137166261672974, -0.256399005651474, -0.15919983386993408, -0.11779341846704483, -0.20697841048240662, -0.1605442762374878, 0.26962515711784363, 0.2272251546382904, 0.010973714292049408, -0.19239073991775513, -0.01211780309677124, 0.10267754644155502, -0.10529275238513947, -0.20531544089317322, 0.4793514311313629, -0.036732885986566544, 0.04132456332445145, 0.6600422263145447, -0.22101281583309174, 0.4893927276134491, 0.30292433500289917, 0.14424975216388702, -0.2339218258857727, 0.16391873359680176, -0.031044311821460724, 0.1109761893749237, 0.2777020037174225, 0.0003393404185771942, 0.0743875503540039, 0.34548670053482056, 0.07129988819360733, -0.08171069622039795, -0.02307017147541046, 0.37322184443473816, 0.20933347940444946, 0.16107195615768433, 0.5450443029403687, -0.22403964400291443, 0.2804173231124878, -0.2941155433654785, -0.038092099130153656, -0.5196766257286072, -0.15533356368541718, 0.12195369601249695, -0.379965215921402, 0.08723483979701996, 0.17444738745689392, -0.010199513286352158, 0.09253282845020294, 0.41977208852767944, 0.2715425491333008, -0.1087900772690773, -0.28338688611984253, -0.2313648760318756, -0.405874103307724, 0.17689746618270874, -0.11475534737110138, -0.2551940083503723, -0.23314788937568665, 0.11234992742538452, 0.04201231896877289, -0.11981857568025589, 0.42449429631233215, 0.17179524898529053, -0.13964420557022095, 0.3868151009082794, -0.3085651099681854, -0.2117956280708313, -0.05810331180691719, 0.24439135193824768, -0.043046846985816956, -0.33443379402160645, 0.022030066698789597, 0.04782240092754364, -0.1773078739643097, 0.2265436053276062, 0.03631681203842163, 0.32692113518714905, -0.16762994229793549, 0.2983805537223816, -0.16853010654449463, 0.5052242875099182, 0.006292901933193207, -0.11164531111717224, -0.21571683883666992, -0.28684359788894653, -0.2922140061855316, 0.32860541343688965, -0.0792747288942337, 0.2066926658153534, -0.1929628998041153, -0.05382966995239258, -0.45321205258369446, 0.05836961418390274, -0.11315827071666718, 0.21938462555408478, -0.3524712324142456, 0.3001827895641327, -0.17593693733215332, 0.38433003425598145, 0.3714943528175354, 0.11174905300140381, 0.060105159878730774, 0.0680164024233818, -0.22630614042282104, -0.5560832619667053, 0.70414137840271, -0.19397595524787903, -0.1607607901096344, -0.05911973863840103, 0.24583178758621216, 0.23954233527183533, 0.00023649074137210846, -0.653779149055481, 0.08018936216831207, 0.31409165263175964, -0.13775616884231567, -0.20834900438785553, -0.11316706985235214, 0.1814725548028946, 0.165480837225914, 0.008821293711662292, 0.06491203606128693, 0.3470689654350281, -0.3898201584815979, 0.25193867087364197, -0.16102334856987 ]
https://github.com/huggingface/datasets/issues/5892
I think this has been addressed. Please open a new issue if you are still not getting notified.
User access requests with manual review do not notify the dataset owner
### Describe the bug When a user access requests are enabled, and new requests are set to Manual Review, the dataset owner should be notified of the pending requests. However, instead, currently nothing happens, and so the dataset request can go unanswered for quite some time until the owner happens to check that particular dataset's Settings pane. ### Steps to reproduce the bug 1. Enable a dataset's user access requests 2. Set to Manual Review 3. Ask another HF user to request access to the dataset 4. Dataset owner is not notified ### Expected behavior The dataset owner should receive some kind of notification, perhaps in their HF site inbox, or by email, when a dataset access request is made and manual review is enabled. ### Environment info n/a
18
User access requests with manual review do not notify the dataset owner ### Describe the bug When a user access requests are enabled, and new requests are set to Manual Review, the dataset owner should be notified of the pending requests. However, instead, currently nothing happens, and so the dataset request can go unanswered for quite some time until the owner happens to check that particular dataset's Settings pane. ### Steps to reproduce the bug 1. Enable a dataset's user access requests 2. Set to Manual Review 3. Ask another HF user to request access to the dataset 4. Dataset owner is not notified ### Expected behavior The dataset owner should receive some kind of notification, perhaps in their HF site inbox, or by email, when a dataset access request is made and manual review is enabled. ### Environment info n/a I think this has been addressed. Please open a new issue if you are still not getting notified.
[ -0.015170745551586151, 0.013870760798454285, -0.007105253636837006, 0.15382573008537292, -0.14253036677837372, -0.041337259113788605, 0.38325169682502747, -0.012454977259039879, -0.03740346059203148, 0.10050451010465622, -0.056549251079559326, 0.2397032529115677, 0.003187377005815506, 0.007138922810554504, -0.23258978128433228, 0.38948187232017517, 0.01550723984837532, -0.009640738368034363, 0.12926889955997467, -0.29553449153900146, -0.19276773929595947, -0.18492531776428223, -0.32179027795791626, 0.04191790148615837, 0.033944349735975266, -0.005153895355761051, -0.22920536994934082, 0.16724547743797302, 0.1878775954246521, -0.18703539669513702, 0.26191896200180054, 0.5171238780021667, 0.14659442007541656, 0.5993876457214355, -0.00011084823927376419, -0.014796622097492218, 0.46881961822509766, 0.19372627139091492, -0.20245088636875153, 0.1535424441099167, -0.298596054315567, -0.3745060861110687, -0.027559205889701843, -0.07556487619876862, -0.23566889762878418, -0.12480808794498444, 0.0797116756439209, -0.08654093742370605, -0.016561519354581833, -0.12670814990997314, 0.19809263944625854, 0.2794165313243866, -0.0913054421544075, -0.11224184930324554, 0.18513037264347076, 0.35249242186546326, -0.19726422429084778, 0.0468507744371891, 0.23593996465206146, -0.2108156979084015, -0.29218679666519165, 0.24657335877418518, 0.27261781692504883, 0.2180136740207672, 0.20411190390586853, -0.11653980612754822, -0.262063205242157, -0.15883755683898926, 0.04135975241661072, 0.41728636622428894, 0.7982909083366394, 0.008974806405603886, -0.34646937251091003, -0.16929373145103455, 0.12936115264892578, 0.3066677451133728, 0.17559632658958435, 0.19533878564834595, -0.1577540785074234, 0.10790890455245972, -0.34864306449890137, -0.05340062454342842, -0.22665533423423767, -0.09353367984294891, -0.03446716070175171, -0.08174110949039459, -0.06365558505058289, -0.09806941449642181, -0.3758331835269928, -0.05310166999697685, 0.5856699347496033, -0.2926523983478546, -0.1241837739944458, 0.2529577612876892, -0.3123246729373932, -0.09909515082836151, 0.3611239194869995, 0.2241070419549942, 0.182857945561409, 0.24573832750320435, 0.1690828502178192, 0.2985812723636627, -0.32630306482315063, 0.25866156816482544, 0.2620348632335663, -0.20256644487380981, 0.12225641310214996, 0.409371554851532, 0.4208657741546631, 0.26884883642196655, 0.11360543966293335, -0.04213493689894676, 0.0619811937212944, 0.12421354651451111, 0.3030996322631836, -0.24387753009796143, 0.11116355657577515, -0.4027932286262512, -0.11514583230018616, 0.20098379254341125, -0.3449021875858307, -0.020449670031666756, -0.09171845018863678, 0.3381158411502838, -0.3302984833717346, -0.11340493708848953, 0.09070473909378052, -0.09501535445451736, 0.039546869695186615, -0.043087251484394073, -0.27265268564224243, -0.4631364643573761, -0.3162245750427246, 0.2871531844139099, -0.02125043421983719, -0.12746213376522064, -0.017696578055620193, 0.17583128809928894, -0.045351818203926086, -0.10885098576545715, 0.10230331122875214, 0.016583681106567383, -0.11416681855916977, 0.23915810883045197, 0.028950460255146027, 0.08492361009120941, -0.010203385725617409, 0.06984347105026245, 0.04764606058597565, 0.07695415616035461, -0.018417593091726303, -0.007418535649776459, 0.18589864671230316, 0.14828111231327057, -0.0018138810992240906, -0.04847292974591255, -0.18736781179904938, 0.1809326708316803, 0.04635908827185631, -0.1238333061337471, -0.18571525812149048, 0.15245583653450012, 0.007846713066101074, -0.2024286389350891, 0.0325503796339035, 0.5673789978027344, -0.016396380960941315, 0.10218188166618347, -0.3164370656013489, -0.03211980685591698, 0.1998981088399887, 0.2663853168487549, -0.10794398933649063, 0.08916471153497696, -0.3119305670261383, 0.039399489760398865, 0.07085967808961868, -0.20268869400024414, -0.37598809599876404, 0.19678112864494324, -0.1727585792541504, 0.031425148248672485, 0.08723174035549164, -0.05527753755450249, -0.3908301591873169, -0.27155882120132446, -0.1946103572845459, -0.03361888602375984, -0.18826104700565338, -0.004703313112258911, -0.3929538130760193, -0.23716408014297485, -0.13558954000473022, 0.253823459148407, 0.45114240050315857, 0.2728126049041748, 0.42582497000694275, -0.3209715187549591, 0.5614646077156067, 0.041083961725234985, 0.01725560799241066, 0.303861141204834, 0.48787108063697815, 0.4843992590904236, -0.08449703454971313, 0.05860546976327896, 0.13493438065052032, 0.06927289068698883, -0.285976380109787, 0.0618884414434433, 0.3361714482307434, -0.26380378007888794, -0.46851086616516113, -0.0005089938640594482, -0.27518242597579956, -0.07196591794490814, 0.1314219832420349, 0.5419979691505432, -0.5203124284744263, 0.18402381241321564, 0.23956383764743805, 0.2310737818479538, -0.5155330896377563, 0.0934518575668335, -0.03774397075176239, 0.03349081426858902, -0.07814054936170578, 0.0899880975484848, 0.2421812117099762, 0.12727394700050354, 0.2264874428510666, 0.25518593192100525, -0.09817297756671906, 0.05552896112203598, -0.08080796897411346, 0.1321108639240265, 0.25240516662597656, -0.0764240026473999, -0.01753094792366028, -0.11869814246892929, 0.12915652990341187, 0.14836008846759796, 0.10732738673686981, -0.17930522561073303, -0.2779066264629364, 0.18425780534744263, 0.1164761632680893, 0.034413307905197144, -0.2164512276649475, 0.20024804770946503, -0.010250173509120941, -0.1846158504486084, -0.007888253778219223, 0.0006721392273902893, -0.3154883086681366, -0.010845627635717392, 0.08889225125312805, -0.1507045328617096, -0.40258049964904785, 0.13978368043899536, 0.6920819878578186, 0.16085103154182434, -0.11449036747217178, 0.09076201915740967, -0.17856889963150024, -0.0746796578168869, 0.6369655132293701, -0.024786271154880524, 0.19108295440673828, 0.32090187072753906, 0.07151663303375244, 0.027145178988575935, 0.06107236444950104, -0.07231399416923523, -0.24935081601142883, -0.06910502910614014, -0.0804801881313324, -0.023273084312677383, 0.14321091771125793, 0.2745370864868164, -0.12626495957374573, -0.023754816502332687, -0.05994657427072525, 0.0011662915349006653, -0.3546087145805359, -0.1324194222688675, -0.12812498211860657, -0.12384033203125, 0.11884461343288422, 0.11915800720453262, -0.10830218344926834, -0.4076288342475891, -0.08280716836452484, 0.13246788084506989, -0.05147503316402435, 0.16550399363040924, -0.4566539525985718, 0.15338975191116333, -0.096773162484169, 0.25396910309791565, -0.12155161798000336, 0.29297879338264465, -0.3749641180038452, 0.11788498610258102, 0.13710014522075653, -0.24371415376663208, 0.5462786555290222, 0.07450608909130096, 0.5367006063461304, -0.48081105947494507, -0.2538726329803467, 0.02117268182337284, 0.03199944272637367, 0.08777040243148804, -0.24071606993675232, -0.28379181027412415, 0.09646125137805939, 0.09376943856477737, 0.011134590953588486, 0.22599706053733826, -0.19615039229393005, 0.1804879903793335, 0.07847702503204346, 0.05294646695256233, 0.011421039700508118, -0.01879676803946495, -0.12214607000350952, -0.22686901688575745, -0.013408105820417404, -0.16864123940467834, 0.2467435598373413, 0.35894906520843506, -0.20310980081558228, 0.19516925513744354, -0.5042201280593872, 0.024319395422935486, -0.09994401782751083, -0.17524239420890808, 0.21062807738780975, -0.25396665930747986, -0.45072323083877563, 0.06980905681848526, -0.05385502427816391, 0.06641223281621933, -0.05157472565770149, -0.39291059970855713, -0.13376601040363312, -0.29324135184288025, 0.36359700560569763, -0.1534939408302307, 0.038697801530361176, 0.22980132699012756, -0.14607027173042297, -0.06585446000099182, -0.10978839546442032, -0.08956187218427658, 0.10739202052354813, -0.3459782600402832, 0.24756400287151337, -0.07261165976524353, 0.13201212882995605, 0.19257992506027222, 0.4439671039581299, 0.43816155195236206, 0.313506156206131, 0.5400363206863403, 0.27220118045806885, 0.32399117946624756, 0.2926408052444458, -0.35055652260780334, 0.17292878031730652, 0.18694937229156494, 0.24855837225914001, 0.262912392616272, 0.04494193196296692, -0.42550015449523926, -0.01169278472661972, -0.4542267918586731, -0.32080012559890747, -0.29196077585220337, -0.35624754428863525, -0.3640263080596924, 0.23240652680397034, 0.21728019416332245, 0.12797720730304718, -0.04650792479515076, -0.15755695104599, 0.03906319662928581, 0.34826719760894775, 0.23824632167816162, -0.030649375170469284, 0.09813128411769867, 0.007969614118337631, 0.05511053651571274, 0.24975727498531342, -0.20635539293289185, 0.4106742739677429, -0.24814121425151825, -0.20068442821502686, 0.12482047080993652, 0.08750484883785248, -0.0029305443167686462, -0.6042155623435974, 0.12245813012123108, 0.0209842249751091, 0.18871387839317322, 0.2682206928730011, -0.177897110581398, -0.19490088522434235, 0.24816566705703735, 0.20456592738628387, 0.17016692459583282, 0.02316446602344513, -0.2389376163482666, 0.04540695995092392, -0.5294280052185059, -0.11605068296194077, -0.36104586720466614, -0.020667865872383118, -0.03096279501914978, 0.16034191846847534, 0.380327045917511, -0.08981253206729889, -0.0005985759198665619, -0.304618775844574, -0.4387980103492737, -0.2625434100627899, 0.2793348431587219, 0.021895647048950195, 0.037700194865465164, 0.0013431496918201447, -0.02237977273762226, 0.058681339025497437, 0.09995826333761215, 0.18850989639759064, 0.38604801893234253, 0.3142535388469696, 0.3102286458015442, -0.21017441153526306, 0.17264996469020844, -0.3691960871219635, 0.3322697579860687, 0.28535738587379456, 0.015557527542114258, 0.06729470938444138, 0.29919564723968506, 0.5044933557510376, -0.1765611469745636, -0.27961939573287964, 0.2423630803823471, -0.22179052233695984, -0.2913203537464142, -0.5132523775100708, 0.10668519884347916, -0.025149017572402954, -0.20892763137817383, 0.2246723473072052, 0.5418403148651123, -0.11430616676807404, 0.06913278996944427, 0.1620882749557495, 0.8357702493667603, 0.29816314578056335, -0.02330547757446766, 0.0722978413105011, -0.4921603798866272, -0.07885003089904785, -0.1975458264350891, -0.18791168928146362, -0.2652950882911682, -0.05593017861247063, -0.07624570280313492, -0.061793968081474304, 0.12958785891532898, 0.09218977391719818, 0.00560365617275238, 0.2064492404460907, -0.04133293777704239, 0.12397800385951996, 0.20464351773262024, 0.2363087385892868, -0.41377100348472595, 0.00742083415389061, 0.17736248672008514, 0.2134866714477539, 0.09669800102710724, 0.2663128077983856, 0.07762233912944794, -0.37781819701194763, -0.09253636002540588, 0.05506880581378937, -0.24267688393592834, 0.14919398725032806, -0.17823922634124756, -0.4383753538131714, 0.01545536145567894, -0.12524938583374023, 0.6564000248908997, -0.1325777918100357, 0.2757125794887543, 0.2839372158050537, -0.219633087515831, -0.022319478914141655, 0.2977958023548126, 0.2196839153766632, -0.06235171854496002, -0.037885092198848724, 0.41805633902549744, -0.0605500303208828, -0.23199152946472168, -0.08657495677471161, -0.08045390248298645, 0.010361716151237488, -0.22820347547531128, 0.20673441886901855, -0.28844544291496277, -0.3252265453338623, 0.3137792646884918, -0.1327797919511795, 0.04136035591363907, -0.014510713517665863, 0.1871057152748108, 0.24949181079864502, -0.02832379937171936, 0.5023131370544434, -0.017851199954748154, -0.10458970069885254, -0.20254553854465485, 0.4394463896751404, -0.12657058238983154, 0.19517888128757477, 0.4142518639564514, -0.13505485653877258, -0.21088425815105438, -0.21755638718605042, 0.1017950028181076, 0.3257749378681183, -0.5971252918243408, -0.23068757355213165, 0.007752314209938049, 0.12015308439731598, 0.41157266497612, -0.02487942948937416, -0.14237917959690094, -0.3172455430030823, -0.37087368965148926, -0.1791377067565918, -0.13284097611904144, -0.1270759254693985, -0.47368934750556946, -0.1013541966676712, -0.41017788648605347, 0.15984252095222473, 0.32470035552978516, 0.028365494683384895, -0.37512218952178955, -0.22913135588169098, -0.3209492564201355, -0.15802907943725586, -0.19020749628543854, -0.06793460994958878, -0.04517882689833641, -0.14859607815742493, 0.09141834080219269, -0.10783828794956207, -0.10334257781505585, -0.15483975410461426, -0.06069200113415718, 0.11987079679965973, 0.18077021837234497, 0.33269667625427246, -0.20546647906303406, -0.14932537078857422, -0.23082908987998962, 0.12738174200057983, 0.04117180407047272, -0.048292484134435654, 0.2178608626127243, 0.10715802758932114, 0.12730619311332703, 0.05905358865857124, -0.0346168614923954, 0.13446740806102753, -0.025692254304885864, -0.23104962706565857, -0.32028597593307495, -0.14212368428707123, 0.05755326524376869, -0.05648902803659439, 0.2982953190803528, 0.14991314709186554, 0.26797500252723694, -0.1536908894777298, 0.33656567335128784, -0.11024734377861023, 0.15038348734378815, 0.12150116264820099, 0.3417656123638153, -0.20742836594581604, 0.2130010724067688, -0.4378805160522461, 0.12765149772167206, 0.2524777352809906, -0.2889356315135956, -0.041335444897413254, -0.054160088300704956, 0.13334780931472778, -0.04791828989982605, 0.13236846029758453, 0.13430434465408325, 0.24165664613246918, 0.2496686577796936, 0.1160094365477562, 0.10154086351394653, -0.2598768174648285, -0.06567198038101196, 0.27633097767829895, 0.03832419216632843, 0.3996341824531555, 0.5244901776313782, 0.09504096210002899, -0.05797154828906059, 0.1892538070678711, 0.4168250858783722, -0.004452038556337357, -0.04827398806810379, -0.1258261650800705, 0.02044859156012535, -0.8772369027137756, -0.017053773626685143, -0.06832768023014069, -0.015221409499645233, 0.14316296577453613, -0.2887880206108093, 0.28373652696609497, 0.03379172459244728, 0.16717976331710815, -0.3481222689151764, -0.09291065484285355, -0.21466681361198425, 0.19054841995239258, -0.1143830418586731, -0.15432830154895782, -0.26196497678756714, -0.3757683336734772, 0.15586607158184052, 0.2043275386095047, -0.30890318751335144, -0.2827722430229187, -0.14507034420967102, -0.4426596760749817, -0.09422702342271805, 0.23836442828178406, 0.28084465861320496, -0.18079239130020142, -0.08656428009271622, -0.0561385452747345, 0.02086609974503517, 0.08707256615161896, 0.4126647412776947, 0.08900685608386993, 0.09010739624500275, 0.10677982121706009, 0.09169550240039825, 0.3389497399330139, -0.11658428609371185, 0.004622399806976318, 0.3683949410915375, 0.06931987404823303, -0.1165197566151619, 0.10635653138160706, 0.0793531984090805, -0.11294220387935638, 0.4834354817867279, -0.29530400037765503, 0.14732801914215088, -0.36175736784935, 0.5952883362770081, -0.18888336420059204, -0.324796199798584, -0.07724906504154205, -0.18768717348575592, -0.06758257001638412, 0.2827419638633728, 0.5909059643745422, 0.026170119643211365, 0.1592126190662384, -0.7515343427658081, 0.10093767940998077, 0.04935532808303833, 0.12059325724840164, 0.5032603740692139, 0.04955671355128288, -0.10593131184577942, -0.04207939654588699, -0.6208114624023438, 0.2733610272407532, 0.028284162282943726, -0.08891661465167999, 0.3546295166015625, -0.0432317852973938, -0.020982015877962112, -0.2950189411640167, 0.27442753314971924, 0.06945953518152237, 0.20432578027248383, 0.58572918176651, -0.40392789244651794, -0.12405771762132645, -0.21296042203903198, -0.34335851669311523, -0.06646905839443207, -0.2024763971567154, 0.387038916349411, 0.011850211769342422, 0.10039735585451126, -0.06531272828578949, -0.004947073757648468, 0.2917710542678833, 0.2531403601169586, 0.3069057762622833, 0.14013563096523285, 0.05496687814593315, 0.05191478878259659, -0.031017232686281204, -0.4834621250629425, 0.08017752319574356, -0.3536421060562134, -0.05137735232710838, -0.06008305773139, 0.4208143353462219, 0.015301540493965149, -0.1975792646408081, 0.0737835094332695, 0.1983167827129364, 0.06195276975631714, 0.10656822472810745, 0.036760181188583374, 0.04088250547647476, -0.2110077440738678, -0.057588472962379456, 0.2541993260383606, -0.011661989614367485, 0.17822110652923584, 0.23083935678005219, -0.3706403970718384, -0.3682342767715454, 0.44043365120887756, -0.1902601718902588, -0.11997240781784058, 0.05849093943834305, 0.2953961491584778, -0.21250653266906738, -0.40231290459632874, -0.12333910167217255, -0.12561389803886414, 0.4051193594932556, 0.04131940007209778, 0.47498399019241333, 0.15635822713375092, -0.033917706459760666, 0.08235065639019012, -0.05010490119457245, 0.15857252478599548, -0.2357005625963211, 0.007333077490329742, 0.02496756613254547, 0.0497269481420517 ]
https://github.com/huggingface/datasets/issues/5887
Nice catch @donhuvy, that's because some models don't need the `token_type_ids`, as in this case, as the example is using `distilbert-base-cased`, and according to the DistilBert documentation at https://huggingface.co/transformers/v3.0.2/model_doc/distilbert.html, `DistilBert doesn’t have token_type_ids, you don’t need to indicate which token belongs to which segment. Just separate your segments with the separation token tokenizer.sep_token (or [SEP])`. `token_type_ids` are neither required in some other well known models such as RoBERTa. Here the issue comes due to a mismatch between the tokenizer and the model, as the Colab is using a BERT tokenizer (`bert-base-cased`), while the model is a DistilBERT (`distilbert-base-cased`), so aligning the tokenizer and the model solves it!
HuggingsFace dataset example give error
### Describe the bug ![image](https://github.com/huggingface/datasets/assets/1328316/1f4f0086-3db9-4c79-906b-05a375357cce) ![image](https://github.com/huggingface/datasets/assets/1328316/733ebd3d-89b9-4ece-b80a-00ab5b0a4122) ### Steps to reproduce the bug Use link as reference document written https://colab.research.google.com/github/huggingface/datasets/blob/main/notebooks/Overview.ipynb#scrollTo=biqDH9vpvSVz ```python # Now let's train our model device = 'cuda' if torch.cuda.is_available() else 'cpu' model.train().to(device) for i, batch in enumerate(dataloader): batch.to(device) outputs = model(**batch) loss = outputs.loss loss.backward() optimizer.step() model.zero_grad() print(f'Step {i} - loss: {loss:.3}') if i > 5: break ``` Error ```python --------------------------------------------------------------------------- TypeError Traceback (most recent call last) [<ipython-input-44-7040b885f382>](https://localhost:8080/#) in <cell line: 5>() 5 for i, batch in enumerate(dataloader): 6 batch.to(device) ----> 7 outputs = model(**batch) 8 loss = outputs.loss 9 loss.backward() [/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py](https://localhost:8080/#) in _call_impl(self, *args, **kwargs) 1499 or _global_backward_pre_hooks or _global_backward_hooks 1500 or _global_forward_hooks or _global_forward_pre_hooks): -> 1501 return forward_call(*args, **kwargs) 1502 # Do not call functions when jit is used 1503 full_backward_hooks, non_full_backward_hooks = [], [] TypeError: DistilBertForQuestionAnswering.forward() got an unexpected keyword argument 'token_type_ids' ``` https://github.com/huggingface/datasets/assets/1328316/5d8b1d61-9337-4d59-8423-4f37f834c156 ### Expected behavior Run success on Google Colab (free) ### Environment info Windows 11 x64, Google Colab free (my Google Drive just empty about 200 MB, but I don't think it cause problem)
107
HuggingsFace dataset example give error ### Describe the bug ![image](https://github.com/huggingface/datasets/assets/1328316/1f4f0086-3db9-4c79-906b-05a375357cce) ![image](https://github.com/huggingface/datasets/assets/1328316/733ebd3d-89b9-4ece-b80a-00ab5b0a4122) ### Steps to reproduce the bug Use link as reference document written https://colab.research.google.com/github/huggingface/datasets/blob/main/notebooks/Overview.ipynb#scrollTo=biqDH9vpvSVz ```python # Now let's train our model device = 'cuda' if torch.cuda.is_available() else 'cpu' model.train().to(device) for i, batch in enumerate(dataloader): batch.to(device) outputs = model(**batch) loss = outputs.loss loss.backward() optimizer.step() model.zero_grad() print(f'Step {i} - loss: {loss:.3}') if i > 5: break ``` Error ```python --------------------------------------------------------------------------- TypeError Traceback (most recent call last) [<ipython-input-44-7040b885f382>](https://localhost:8080/#) in <cell line: 5>() 5 for i, batch in enumerate(dataloader): 6 batch.to(device) ----> 7 outputs = model(**batch) 8 loss = outputs.loss 9 loss.backward() [/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py](https://localhost:8080/#) in _call_impl(self, *args, **kwargs) 1499 or _global_backward_pre_hooks or _global_backward_hooks 1500 or _global_forward_hooks or _global_forward_pre_hooks): -> 1501 return forward_call(*args, **kwargs) 1502 # Do not call functions when jit is used 1503 full_backward_hooks, non_full_backward_hooks = [], [] TypeError: DistilBertForQuestionAnswering.forward() got an unexpected keyword argument 'token_type_ids' ``` https://github.com/huggingface/datasets/assets/1328316/5d8b1d61-9337-4d59-8423-4f37f834c156 ### Expected behavior Run success on Google Colab (free) ### Environment info Windows 11 x64, Google Colab free (my Google Drive just empty about 200 MB, but I don't think it cause problem) Nice catch @donhuvy, that's because some models don't need the `token_type_ids`, as in this case, as the example is using `distilbert-base-cased`, and according to the DistilBert documentation at https://huggingface.co/transformers/v3.0.2/model_doc/distilbert.html, `DistilBert doesn’t have token_type_ids, you don’t need to indicate which token belongs to which segment. Just separate your segments with the separation token tokenizer.sep_token (or [SEP])`. `token_type_ids` are neither required in some other well known models such as RoBERTa. Here the issue comes due to a mismatch between the tokenizer and the model, as the Colab is using a BERT tokenizer (`bert-base-cased`), while the model is a DistilBERT (`distilbert-base-cased`), so aligning the tokenizer and the model solves it!
[ -0.30471837520599365, -0.32953858375549316, -0.009535536170005798, 0.2454974353313446, 0.3616688549518585, 0.02109256386756897, 0.3034208416938782, 0.3132304549217224, 0.1804969310760498, 0.2697404623031616, -0.23079945147037506, 0.147871732711792, -0.008146129548549652, 0.0014945566654205322, 0.2533906102180481, -0.2232588529586792, 0.22204220294952393, 0.034082673490047455, -0.24735602736473083, 0.08468643575906754, -0.2194196879863739, 0.24315033853054047, -0.2144913375377655, 0.12572112679481506, -0.33748260140419006, -0.26493754982948303, -0.08250977098941803, 0.18090024590492249, -0.002349095419049263, -0.22224704921245575, 0.4075224697589874, -0.1621578335762024, 0.05694962292909622, 0.5712966918945312, -0.00010737985576270148, 0.18537917733192444, 0.05671737715601921, -0.0663822814822197, -0.2814676761627197, -0.3967335820198059, -0.20207825303077698, -0.005885664373636246, -0.03230300918221474, -0.3069216012954712, -0.1904270052909851, 0.2768350839614868, 0.15258660912513733, -0.2082713097333908, 0.46039777994155884, 0.476431280374527, 0.2854526937007904, 0.5695676803588867, 0.055732131004333496, -0.3264327347278595, 0.11757241189479828, 0.1713205873966217, -0.13330940902233124, 0.3727336525917053, 0.14921975135803223, 0.09792882949113846, -0.1788368821144104, 0.2959122657775879, 0.12298966199159622, 0.0055068135261535645, 0.2027856856584549, 0.16181030869483948, -0.15249283611774445, -0.21830511093139648, -0.040861014276742935, 0.06015626713633537, -0.25200724601745605, -0.37466320395469666, -0.4092445969581604, -0.15050190687179565, 0.009018640965223312, -0.4481402635574341, 0.12598787248134613, 0.22889944911003113, -0.2305193990468979, 0.07562403380870819, -0.18498285114765167, 0.2177339643239975, -0.22783435881137848, -0.03157737851142883, 0.15885625779628754, 0.2771545946598053, -0.23715566098690033, 0.04386995732784271, 0.051115483045578, -0.006920307874679565, -0.2406824231147766, 0.12847626209259033, 0.15165044367313385, 0.011333927512168884, -0.40269899368286133, -0.059537965804338455, -0.05831216275691986, 0.20769602060317993, 0.2547951340675354, 0.1026834100484848, 0.08287246525287628, -0.17632700502872467, 0.19091299176216125, 0.11480745673179626, -0.0911136120557785, 0.13121101260185242, -0.17797908186912537, -0.06084227189421654, 0.16309630870819092, 0.5013557076454163, -0.08106887340545654, -0.22061796486377716, 0.11621364951133728, -0.2443234771490097, -0.1384405940771103, -0.004950644448399544, 0.4049028754234314, -0.0007503107190132141, -0.6411136388778687, 0.20811279118061066, -0.015437796711921692, 0.1883162260055542, 0.22465072572231293, 0.35210755467414856, -0.0006317459046840668, -0.14616429805755615, 0.24106374382972717, 0.06864534318447113, -0.2875653803348541, -0.06172418221831322, -0.2757868766784668, 0.1406949758529663, -0.2868667244911194, -0.04664846509695053, 0.015363551676273346, -0.1446150690317154, 0.5104774236679077, 0.14757494628429413, 0.3004833459854126, 0.060335107147693634, -0.04472697526216507, -0.10756196081638336, 0.10611161589622498, 0.28224053978919983, -0.07430233061313629, -0.1411464512348175, 0.24184627830982208, -0.13485437631607056, 0.0016351491212844849, -0.0901714637875557, -0.06067172437906265, -0.25461265444755554, -0.12279316782951355, 0.24346494674682617, 0.19706182181835175, 0.20012721419334412, -0.1556900143623352, -0.023534677922725677, 0.06073550134897232, 0.1373114436864853, 0.2820998728275299, 0.0005053095519542694, -0.3176594078540802, -0.11969257891178131, 0.48974066972732544, 0.48018962144851685, -0.03429156169295311, -0.22130244970321655, 0.17354035377502441, -0.14873239398002625, 0.24374555051326752, 0.3892907500267029, 0.05406714975833893, 0.02733808197081089, -0.36052966117858887, 0.06854720413684845, 0.24331428110599518, -0.2745325565338135, -0.42908045649528503, 0.12821970880031586, -0.22281140089035034, -0.03992307186126709, 0.21432429552078247, 0.07884451746940613, 0.0567980594933033, 0.07119990140199661, 0.40063899755477905, 0.009355142712593079, -0.1498478502035141, -0.03988419845700264, -0.39099279046058655, -0.0019269511103630066, 0.09834001213312149, 0.06866516917943954, -0.03952588513493538, -0.0214003324508667, -0.05355936661362648, 0.05744504928588867, 0.3767531216144562, -0.04941635578870773, -0.13276290893554688, 0.05175744369626045, 0.47979483008384705, -0.041020411998033524, -0.05203980952501297, -0.3155537247657776, -0.35933372378349304, 0.19366346299648285, -0.12246580421924591, 0.01266382448375225, -0.08677411079406738, -0.1539306938648224, -0.32735905051231384, 0.22569219768047333, -0.13379019498825073, -0.3461163640022278, 0.18283694982528687, 0.020199250429868698, 0.12479579448699951, -0.03221069648861885, -0.19840335845947266, 0.3880007863044739, -0.3456605076789856, 0.2975676357746124, -0.4891377389431, 0.2564907670021057, -0.2531178295612335, -0.18537288904190063, -0.1083843857049942, 0.23812547326087952, 0.1423606276512146, -0.1874060183763504, -0.06718902289867401, 0.45984867215156555, 0.1257464587688446, 0.13088399171829224, -0.06472370028495789, -0.07540401816368103, 0.26951372623443604, -0.0008210018277168274, -0.0944349467754364, 0.1486072987318039, 0.20624828338623047, 0.14329953491687775, -0.06973563879728317, 0.46161162853240967, -0.15878388285636902, 0.03181363642215729, 0.03437378257513046, 0.16502460837364197, 0.18501384556293488, -0.033033836632966995, -0.03741762042045593, -0.2082791030406952, 0.40588003396987915, 0.06813034415245056, 0.38000932335853577, -0.12563718855381012, -0.5219778418540955, -0.1186949759721756, 0.1595800220966339, 0.07762478291988373, 0.11634566634893417, 0.20061883330345154, -0.09631423652172089, 0.08267049491405487, 0.19535455107688904, 0.00949764996767044, 0.3352101147174835, 0.11370301246643066, -0.09449570626020432, 0.20948167145252228, 0.003934256732463837, -0.24910449981689453, 0.2369612753391266, -0.0352315753698349, -0.05361674726009369, -0.05465191975235939, 0.09992076456546783, 0.16023215651512146, -0.3999495208263397, -0.15719899535179138, -0.2895469665527344, 0.1484519988298416, -0.3665701150894165, 0.1852048933506012, -0.03698062524199486, -0.20495153963565826, -0.3594385087490082, -0.16671185195446014, -0.026567727327346802, -0.19468200206756592, -0.06178626790642738, 0.2448631078004837, -0.07959852367639542, 0.3181817829608917, -0.04628831148147583, 0.20972900092601776, 0.14787466824054718, 0.27244651317596436, -0.33463597297668457, 0.10188965499401093, -0.13007687032222748, 0.10628458857536316, 0.10660742223262787, -0.009712491184473038, 0.4773467183113098, -0.21913063526153564, -0.0676010474562645, -0.30531227588653564, -0.3413487374782562, 0.0020112181082367897, -0.15198339521884918, 0.43873220682144165, 0.3594605028629303, 0.1085154265165329, -0.16942283511161804, -0.3538494408130646, 0.2673024535179138, -0.25565382838249207, -0.37990498542785645, 0.029193952679634094, -0.1237555742263794, -0.02212192676961422, -0.2617957293987274, -0.19680532813072205, -0.19277071952819824, -0.35108327865600586, 0.34006816148757935, -0.021107297390699387, 0.03897981718182564, 0.21400339901447296, 0.059802182018756866, 0.3567044138908386, -0.030779941007494926, -0.001164272427558899, -0.04976821690797806, -0.4891887605190277, 0.09759394079446793, -0.22850121557712555, -0.3937070369720459, -0.10271964222192764, -0.02189565822482109, 0.2735018730163574, -0.006342355161905289, -0.4813700318336487, -0.18051207065582275, -0.26336660981178284, 0.3366602659225464, -0.007055221125483513, 0.061780862510204315, 0.13994330167770386, -0.08642764389514923, -0.15736868977546692, -0.18159818649291992, -0.13692709803581238, 0.12307241559028625, -0.15643107891082764, 0.10568304359912872, -0.11981721222400665, 0.4651150107383728, 0.1404581069946289, 0.6162562370300293, 0.2889656722545624, -0.25933167338371277, 0.42899924516677856, -0.19801358878612518, 0.21416404843330383, -0.28670284152030945, -0.587646484375, 0.31257033348083496, -0.14062701165676117, -0.05604534596204758, -0.04749050736427307, -0.15053509175777435, 0.20661593973636627, -0.04657331109046936, -0.2971497178077698, -0.0449012853205204, -0.28654128313064575, -0.060029931366443634, -0.041968490928411484, 0.11846976727247238, -0.09181396663188934, -0.0059902966022491455, -0.07570977509021759, 0.09965723752975464, 0.1404370367527008, 0.13497281074523926, 0.1445898711681366, -0.08613011240959167, 0.112052321434021, -0.0005282610654830933, -0.666012704372406, 0.24218159914016724, -0.06589889526367188, 0.16239406168460846, -0.09032009541988373, -0.09211583435535431, -0.11774557828903198, 0.008046142756938934, 0.6948617696762085, 0.42467421293258667, 0.16008558869361877, -0.05682753026485443, -0.3110896348953247, -0.3670850396156311, 0.0668533518910408, -0.3145301043987274, 0.21381263434886932, 0.4534813463687897, 0.5972145199775696, -0.16355746984481812, -0.138764426112175, 0.252652108669281, -0.10505898296833038, 0.0026333406567573547, 0.0468568429350853, -0.2393399178981781, -0.1829519271850586, -0.24512016773223877, 0.39938390254974365, 0.08101233094930649, 0.1911430060863495, 0.1621691882610321, -0.09107396006584167, -0.0638057142496109, -0.10045376420021057, -0.0042654722929000854, 0.07172656059265137, 0.1635465770959854, 0.0025835633277893066, 0.22745491564273834, -0.084365114569664, 0.4089740812778473, 0.1912335604429245, 0.2942390739917755, -0.030913231894373894, -0.3231457471847534, -0.08002887666225433, 0.07989121973514557, 0.1420852541923523, 0.2409801483154297, -0.1378726214170456, 0.03607745096087456, 0.10527901351451874, 0.4718235731124878, -0.2444819062948227, 0.15979567170143127, 0.38517555594444275, 0.24025152623653412, -0.09048131108283997, -0.07389142364263535, 0.2586476504802704, -0.1039341539144516, 0.1535448133945465, 0.2453656643629074, 0.41161438822746277, -0.308349072933197, 0.16606895625591278, 0.34678855538368225, 0.8504579663276672, 0.3074460029602051, 0.2133956402540207, 0.5961291790008545, -0.1745390146970749, 0.4362622797489166, 0.1774471253156662, 0.030262712389230728, -0.1932079792022705, -0.3917984962463379, -0.037886761128902435, -0.09337767958641052, 0.21428868174552917, -0.1737721860408783, -0.2573467493057251, 0.13565444946289062, 0.003797873854637146, -0.0014250405365601182, -0.13571977615356445, -0.26334521174430847, -0.2468786984682083, -0.1997673213481903, -0.47216492891311646, 0.15168353915214539, 0.0521300844848156, 0.08231677114963531, -0.10094423592090607, -0.16038747131824493, -0.05270557105541229, -0.14235012233257294, -0.2749837040901184, -0.004248946905136108, -0.4886910617351532, 0.1869443953037262, 0.14764404296875, -0.4809607267379761, 0.15507358312606812, 0.16912642121315002, 0.5276753902435303, 0.06047079339623451, -0.15167711675167084, 0.07410141825675964, -0.07287314534187317, 0.04419446736574173, -0.07695213705301285, -0.005174767225980759, 0.26588496565818787, -0.17318609356880188, -0.1069846898317337, -0.18719837069511414, 0.08800175786018372, -0.045370541512966156, 0.1339363008737564, 0.03188301622867584, -0.11908738315105438, -0.25610655546188354, -0.2899339199066162, -0.1839219182729721, -0.054268695414066315, -0.4391443133354187, 0.16450442373752594, 0.04872727021574974, -0.23847058415412903, -0.13084368407726288, 0.00013625292922370136, -0.20090125501155853, -0.18382199108600616, 0.44492197036743164, -0.15241976082324982, 0.19770261645317078, 0.47952789068222046, 0.15830382704734802, -0.256869912147522, -0.19342367351055145, 0.09505875408649445, 0.37641167640686035, -0.4694076180458069, 0.23367223143577576, -0.01726645417511463, 0.13332101702690125, -0.1966545432806015, 0.27956587076187134, 0.2029331773519516, -0.06036483123898506, 0.08035261929035187, -0.3381457030773163, -0.5751748085021973, 0.0812559723854065, -0.0906047523021698, 0.2529439330101013, 0.18420082330703735, 0.24866652488708496, 0.011439613997936249, 0.03055415488779545, -0.3655773997306824, 0.04564375430345535, -0.512373685836792, 0.04710138961672783, 0.022560659795999527, -0.08726358413696289, 0.22896520793437958, 0.11494851112365723, 0.18791422247886658, 0.31880566477775574, -0.1740749329328537, -0.2829175591468811, -0.24387770891189575, 0.05384209007024765, 0.016868319362401962, -0.20033752918243408, 0.11919544637203217, 0.28475362062454224, -0.07757389545440674, -0.12615495920181274, 0.24389265477657318, 0.2751813530921936, 0.07629765570163727, 0.2768286466598511, 0.1914052963256836, 0.0757611021399498, 0.06352744251489639, -0.15325698256492615, 0.15333549678325653, 0.04197897017002106, 0.08956828713417053, -0.013138100504875183, -0.3230597674846649, -0.1447993516921997, -0.10893478989601135, 0.028283754363656044, 0.10196606814861298, 0.06194800138473511, 0.2576119601726532, -0.23997998237609863, -0.26627689599990845, 0.07749336957931519, 0.32812976837158203, 0.05384370684623718, -0.1686011701822281, 0.06481847167015076, 0.053301069885492325, 0.27249640226364136, -0.48606714606285095, 0.004470556974411011, 0.16581349074840546, -0.054345615208148956, 0.20366476476192474, 0.18789663910865784, -0.18285202980041504, 0.042864128947257996, 0.07119379937648773, 0.09441535174846649, 0.11517705023288727, -0.2050560861825943, 0.15190060436725616, 0.028104152530431747, 0.09989145398139954, 0.18741410970687866, 0.15073905885219574, 0.12045862525701523, 0.3901149034500122, 0.28915706276893616, -0.2028135061264038, 0.4441412091255188, -0.16364657878875732, 0.00028613582253456116, 0.21130988001823425, -0.3380160331726074, -0.15988101065158844, 0.015796735882759094, -0.3121018409729004, 0.021473027765750885, -0.14262855052947998, 0.3188471496105194, -0.239236980676651, -0.1949435919523239, -0.09636981785297394, 0.19258081912994385, -0.35290563106536865, -0.06698719412088394, -0.11369168758392334, -0.054939597845077515, 0.05445697903633118, -0.07710471004247665, 0.03570284694433212, 0.023564297705888748, 0.32934334874153137, -0.00935649499297142, -0.09649588167667389, -0.18228334188461304, -0.04179523140192032, 0.2830899953842163, 0.1631859391927719, -0.19728395342826843, 0.22741268575191498, 0.4433188736438751, -0.05257158726453781, -0.16723515093326569, 0.5591176152229309, 0.5641908049583435, 0.20515795052051544, 0.1511877030134201, 0.28727269172668457, 0.1018664538860321, -0.15640026330947876, -0.16159223020076752, 0.0503288097679615, 0.03136885166168213, 0.2811160981655121, 0.4380173683166504, 0.20948758721351624, -0.22525069117546082, 0.21232487261295319, 0.14007273316383362, 0.24730277061462402, -0.43123969435691833, 0.28295913338661194, -0.39490029215812683, -0.16229148209095, -0.24347257614135742, 0.0004802979528903961, -0.4199225604534149, 0.2610582113265991, 0.06125311926007271, -0.14132267236709595, 0.14803946018218994, -0.13209261000156403, 0.1155034601688385, 0.019513193517923355, 0.5679847002029419, 0.20012091100215912, 0.15351635217666626, -0.4728584587574005, -0.259694367647171, -0.3751959502696991, 0.251250684261322, 0.12600253522396088, 0.20645979046821594, -0.014637820422649384, -0.019149426370859146, -0.1681060492992401, -0.06699199974536896, 0.17709940671920776, -0.22468598186969757, -0.07247520983219147, 0.20283134281635284, -0.3309668302536011, -0.11072243750095367, -0.26686662435531616, -0.1950078308582306, 0.16236378252506256, -0.13166967034339905, 0.1644747257232666, 0.048172835260629654, 0.07664521783590317, -0.0011422764509916306, 0.1574135273694992, -0.08100540190935135, 0.15063585340976715, 0.2004275918006897, 0.17346248030662537, -0.07567286491394043, -0.18302488327026367, -0.1345176249742508, -0.12218435108661652, -0.14887788891792297, -0.2645806670188904, 0.010129584930837154, 0.10401815176010132, 0.44008341431617737, -0.06952470541000366, -0.5535539388656616, -0.25007569789886475, 0.51006680727005, 0.17991352081298828, -0.3464169502258301, -0.05943362042307854, 0.35322117805480957, -0.14342784881591797, -0.14528986811637878, 0.2007436901330948, 0.43928879499435425, -0.11220797896385193, 0.21384717524051666, -0.32077842950820923, -0.45523133873939514, 0.5414049029350281, -0.5261780619621277, -0.12039265781641006, -0.10822023451328278, 0.12998415529727936, 0.06044448912143707, -0.29072076082229614, -0.6871923804283142, 0.01835942268371582, 0.26166558265686035, -0.03735896199941635, -0.287323534488678, 0.19537751376628876, -0.0012424997985363007, 0.06137744337320328, 0.025549523532390594, 0.6861677169799805, 0.1847480833530426, -0.23433290421962738, 0.45932966470718384, -0.3806535601615906 ]
https://github.com/huggingface/datasets/issues/5887
This has been addressed in #5902. The Quicktour notebook is deprecated now - please use the notebook version of the [Quickstart doc page](https://huggingface.co/docs/datasets/main/en/quickstart) instead ("Open in Colab" button).
HuggingsFace dataset example give error
### Describe the bug ![image](https://github.com/huggingface/datasets/assets/1328316/1f4f0086-3db9-4c79-906b-05a375357cce) ![image](https://github.com/huggingface/datasets/assets/1328316/733ebd3d-89b9-4ece-b80a-00ab5b0a4122) ### Steps to reproduce the bug Use link as reference document written https://colab.research.google.com/github/huggingface/datasets/blob/main/notebooks/Overview.ipynb#scrollTo=biqDH9vpvSVz ```python # Now let's train our model device = 'cuda' if torch.cuda.is_available() else 'cpu' model.train().to(device) for i, batch in enumerate(dataloader): batch.to(device) outputs = model(**batch) loss = outputs.loss loss.backward() optimizer.step() model.zero_grad() print(f'Step {i} - loss: {loss:.3}') if i > 5: break ``` Error ```python --------------------------------------------------------------------------- TypeError Traceback (most recent call last) [<ipython-input-44-7040b885f382>](https://localhost:8080/#) in <cell line: 5>() 5 for i, batch in enumerate(dataloader): 6 batch.to(device) ----> 7 outputs = model(**batch) 8 loss = outputs.loss 9 loss.backward() [/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py](https://localhost:8080/#) in _call_impl(self, *args, **kwargs) 1499 or _global_backward_pre_hooks or _global_backward_hooks 1500 or _global_forward_hooks or _global_forward_pre_hooks): -> 1501 return forward_call(*args, **kwargs) 1502 # Do not call functions when jit is used 1503 full_backward_hooks, non_full_backward_hooks = [], [] TypeError: DistilBertForQuestionAnswering.forward() got an unexpected keyword argument 'token_type_ids' ``` https://github.com/huggingface/datasets/assets/1328316/5d8b1d61-9337-4d59-8423-4f37f834c156 ### Expected behavior Run success on Google Colab (free) ### Environment info Windows 11 x64, Google Colab free (my Google Drive just empty about 200 MB, but I don't think it cause problem)
28
HuggingsFace dataset example give error ### Describe the bug ![image](https://github.com/huggingface/datasets/assets/1328316/1f4f0086-3db9-4c79-906b-05a375357cce) ![image](https://github.com/huggingface/datasets/assets/1328316/733ebd3d-89b9-4ece-b80a-00ab5b0a4122) ### Steps to reproduce the bug Use link as reference document written https://colab.research.google.com/github/huggingface/datasets/blob/main/notebooks/Overview.ipynb#scrollTo=biqDH9vpvSVz ```python # Now let's train our model device = 'cuda' if torch.cuda.is_available() else 'cpu' model.train().to(device) for i, batch in enumerate(dataloader): batch.to(device) outputs = model(**batch) loss = outputs.loss loss.backward() optimizer.step() model.zero_grad() print(f'Step {i} - loss: {loss:.3}') if i > 5: break ``` Error ```python --------------------------------------------------------------------------- TypeError Traceback (most recent call last) [<ipython-input-44-7040b885f382>](https://localhost:8080/#) in <cell line: 5>() 5 for i, batch in enumerate(dataloader): 6 batch.to(device) ----> 7 outputs = model(**batch) 8 loss = outputs.loss 9 loss.backward() [/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py](https://localhost:8080/#) in _call_impl(self, *args, **kwargs) 1499 or _global_backward_pre_hooks or _global_backward_hooks 1500 or _global_forward_hooks or _global_forward_pre_hooks): -> 1501 return forward_call(*args, **kwargs) 1502 # Do not call functions when jit is used 1503 full_backward_hooks, non_full_backward_hooks = [], [] TypeError: DistilBertForQuestionAnswering.forward() got an unexpected keyword argument 'token_type_ids' ``` https://github.com/huggingface/datasets/assets/1328316/5d8b1d61-9337-4d59-8423-4f37f834c156 ### Expected behavior Run success on Google Colab (free) ### Environment info Windows 11 x64, Google Colab free (my Google Drive just empty about 200 MB, but I don't think it cause problem) This has been addressed in #5902. The Quicktour notebook is deprecated now - please use the notebook version of the [Quickstart doc page](https://huggingface.co/docs/datasets/main/en/quickstart) instead ("Open in Colab" button).
[ -0.30471837520599365, -0.32953858375549316, -0.009535536170005798, 0.2454974353313446, 0.3616688549518585, 0.02109256386756897, 0.3034208416938782, 0.3132304549217224, 0.1804969310760498, 0.2697404623031616, -0.23079945147037506, 0.147871732711792, -0.008146129548549652, 0.0014945566654205322, 0.2533906102180481, -0.2232588529586792, 0.22204220294952393, 0.034082673490047455, -0.24735602736473083, 0.08468643575906754, -0.2194196879863739, 0.24315033853054047, -0.2144913375377655, 0.12572112679481506, -0.33748260140419006, -0.26493754982948303, -0.08250977098941803, 0.18090024590492249, -0.002349095419049263, -0.22224704921245575, 0.4075224697589874, -0.1621578335762024, 0.05694962292909622, 0.5712966918945312, -0.00010737985576270148, 0.18537917733192444, 0.05671737715601921, -0.0663822814822197, -0.2814676761627197, -0.3967335820198059, -0.20207825303077698, -0.005885664373636246, -0.03230300918221474, -0.3069216012954712, -0.1904270052909851, 0.2768350839614868, 0.15258660912513733, -0.2082713097333908, 0.46039777994155884, 0.476431280374527, 0.2854526937007904, 0.5695676803588867, 0.055732131004333496, -0.3264327347278595, 0.11757241189479828, 0.1713205873966217, -0.13330940902233124, 0.3727336525917053, 0.14921975135803223, 0.09792882949113846, -0.1788368821144104, 0.2959122657775879, 0.12298966199159622, 0.0055068135261535645, 0.2027856856584549, 0.16181030869483948, -0.15249283611774445, -0.21830511093139648, -0.040861014276742935, 0.06015626713633537, -0.25200724601745605, -0.37466320395469666, -0.4092445969581604, -0.15050190687179565, 0.009018640965223312, -0.4481402635574341, 0.12598787248134613, 0.22889944911003113, -0.2305193990468979, 0.07562403380870819, -0.18498285114765167, 0.2177339643239975, -0.22783435881137848, -0.03157737851142883, 0.15885625779628754, 0.2771545946598053, -0.23715566098690033, 0.04386995732784271, 0.051115483045578, -0.006920307874679565, -0.2406824231147766, 0.12847626209259033, 0.15165044367313385, 0.011333927512168884, -0.40269899368286133, -0.059537965804338455, -0.05831216275691986, 0.20769602060317993, 0.2547951340675354, 0.1026834100484848, 0.08287246525287628, -0.17632700502872467, 0.19091299176216125, 0.11480745673179626, -0.0911136120557785, 0.13121101260185242, -0.17797908186912537, -0.06084227189421654, 0.16309630870819092, 0.5013557076454163, -0.08106887340545654, -0.22061796486377716, 0.11621364951133728, -0.2443234771490097, -0.1384405940771103, -0.004950644448399544, 0.4049028754234314, -0.0007503107190132141, -0.6411136388778687, 0.20811279118061066, -0.015437796711921692, 0.1883162260055542, 0.22465072572231293, 0.35210755467414856, -0.0006317459046840668, -0.14616429805755615, 0.24106374382972717, 0.06864534318447113, -0.2875653803348541, -0.06172418221831322, -0.2757868766784668, 0.1406949758529663, -0.2868667244911194, -0.04664846509695053, 0.015363551676273346, -0.1446150690317154, 0.5104774236679077, 0.14757494628429413, 0.3004833459854126, 0.060335107147693634, -0.04472697526216507, -0.10756196081638336, 0.10611161589622498, 0.28224053978919983, -0.07430233061313629, -0.1411464512348175, 0.24184627830982208, -0.13485437631607056, 0.0016351491212844849, -0.0901714637875557, -0.06067172437906265, -0.25461265444755554, -0.12279316782951355, 0.24346494674682617, 0.19706182181835175, 0.20012721419334412, -0.1556900143623352, -0.023534677922725677, 0.06073550134897232, 0.1373114436864853, 0.2820998728275299, 0.0005053095519542694, -0.3176594078540802, -0.11969257891178131, 0.48974066972732544, 0.48018962144851685, -0.03429156169295311, -0.22130244970321655, 0.17354035377502441, -0.14873239398002625, 0.24374555051326752, 0.3892907500267029, 0.05406714975833893, 0.02733808197081089, -0.36052966117858887, 0.06854720413684845, 0.24331428110599518, -0.2745325565338135, -0.42908045649528503, 0.12821970880031586, -0.22281140089035034, -0.03992307186126709, 0.21432429552078247, 0.07884451746940613, 0.0567980594933033, 0.07119990140199661, 0.40063899755477905, 0.009355142712593079, -0.1498478502035141, -0.03988419845700264, -0.39099279046058655, -0.0019269511103630066, 0.09834001213312149, 0.06866516917943954, -0.03952588513493538, -0.0214003324508667, -0.05355936661362648, 0.05744504928588867, 0.3767531216144562, -0.04941635578870773, -0.13276290893554688, 0.05175744369626045, 0.47979483008384705, -0.041020411998033524, -0.05203980952501297, -0.3155537247657776, -0.35933372378349304, 0.19366346299648285, -0.12246580421924591, 0.01266382448375225, -0.08677411079406738, -0.1539306938648224, -0.32735905051231384, 0.22569219768047333, -0.13379019498825073, -0.3461163640022278, 0.18283694982528687, 0.020199250429868698, 0.12479579448699951, -0.03221069648861885, -0.19840335845947266, 0.3880007863044739, -0.3456605076789856, 0.2975676357746124, -0.4891377389431, 0.2564907670021057, -0.2531178295612335, -0.18537288904190063, -0.1083843857049942, 0.23812547326087952, 0.1423606276512146, -0.1874060183763504, -0.06718902289867401, 0.45984867215156555, 0.1257464587688446, 0.13088399171829224, -0.06472370028495789, -0.07540401816368103, 0.26951372623443604, -0.0008210018277168274, -0.0944349467754364, 0.1486072987318039, 0.20624828338623047, 0.14329953491687775, -0.06973563879728317, 0.46161162853240967, -0.15878388285636902, 0.03181363642215729, 0.03437378257513046, 0.16502460837364197, 0.18501384556293488, -0.033033836632966995, -0.03741762042045593, -0.2082791030406952, 0.40588003396987915, 0.06813034415245056, 0.38000932335853577, -0.12563718855381012, -0.5219778418540955, -0.1186949759721756, 0.1595800220966339, 0.07762478291988373, 0.11634566634893417, 0.20061883330345154, -0.09631423652172089, 0.08267049491405487, 0.19535455107688904, 0.00949764996767044, 0.3352101147174835, 0.11370301246643066, -0.09449570626020432, 0.20948167145252228, 0.003934256732463837, -0.24910449981689453, 0.2369612753391266, -0.0352315753698349, -0.05361674726009369, -0.05465191975235939, 0.09992076456546783, 0.16023215651512146, -0.3999495208263397, -0.15719899535179138, -0.2895469665527344, 0.1484519988298416, -0.3665701150894165, 0.1852048933506012, -0.03698062524199486, -0.20495153963565826, -0.3594385087490082, -0.16671185195446014, -0.026567727327346802, -0.19468200206756592, -0.06178626790642738, 0.2448631078004837, -0.07959852367639542, 0.3181817829608917, -0.04628831148147583, 0.20972900092601776, 0.14787466824054718, 0.27244651317596436, -0.33463597297668457, 0.10188965499401093, -0.13007687032222748, 0.10628458857536316, 0.10660742223262787, -0.009712491184473038, 0.4773467183113098, -0.21913063526153564, -0.0676010474562645, -0.30531227588653564, -0.3413487374782562, 0.0020112181082367897, -0.15198339521884918, 0.43873220682144165, 0.3594605028629303, 0.1085154265165329, -0.16942283511161804, -0.3538494408130646, 0.2673024535179138, -0.25565382838249207, -0.37990498542785645, 0.029193952679634094, -0.1237555742263794, -0.02212192676961422, -0.2617957293987274, -0.19680532813072205, -0.19277071952819824, -0.35108327865600586, 0.34006816148757935, -0.021107297390699387, 0.03897981718182564, 0.21400339901447296, 0.059802182018756866, 0.3567044138908386, -0.030779941007494926, -0.001164272427558899, -0.04976821690797806, -0.4891887605190277, 0.09759394079446793, -0.22850121557712555, -0.3937070369720459, -0.10271964222192764, -0.02189565822482109, 0.2735018730163574, -0.006342355161905289, -0.4813700318336487, -0.18051207065582275, -0.26336660981178284, 0.3366602659225464, -0.007055221125483513, 0.061780862510204315, 0.13994330167770386, -0.08642764389514923, -0.15736868977546692, -0.18159818649291992, -0.13692709803581238, 0.12307241559028625, -0.15643107891082764, 0.10568304359912872, -0.11981721222400665, 0.4651150107383728, 0.1404581069946289, 0.6162562370300293, 0.2889656722545624, -0.25933167338371277, 0.42899924516677856, -0.19801358878612518, 0.21416404843330383, -0.28670284152030945, -0.587646484375, 0.31257033348083496, -0.14062701165676117, -0.05604534596204758, -0.04749050736427307, -0.15053509175777435, 0.20661593973636627, -0.04657331109046936, -0.2971497178077698, -0.0449012853205204, -0.28654128313064575, -0.060029931366443634, -0.041968490928411484, 0.11846976727247238, -0.09181396663188934, -0.0059902966022491455, -0.07570977509021759, 0.09965723752975464, 0.1404370367527008, 0.13497281074523926, 0.1445898711681366, -0.08613011240959167, 0.112052321434021, -0.0005282610654830933, -0.666012704372406, 0.24218159914016724, -0.06589889526367188, 0.16239406168460846, -0.09032009541988373, -0.09211583435535431, -0.11774557828903198, 0.008046142756938934, 0.6948617696762085, 0.42467421293258667, 0.16008558869361877, -0.05682753026485443, -0.3110896348953247, -0.3670850396156311, 0.0668533518910408, -0.3145301043987274, 0.21381263434886932, 0.4534813463687897, 0.5972145199775696, -0.16355746984481812, -0.138764426112175, 0.252652108669281, -0.10505898296833038, 0.0026333406567573547, 0.0468568429350853, -0.2393399178981781, -0.1829519271850586, -0.24512016773223877, 0.39938390254974365, 0.08101233094930649, 0.1911430060863495, 0.1621691882610321, -0.09107396006584167, -0.0638057142496109, -0.10045376420021057, -0.0042654722929000854, 0.07172656059265137, 0.1635465770959854, 0.0025835633277893066, 0.22745491564273834, -0.084365114569664, 0.4089740812778473, 0.1912335604429245, 0.2942390739917755, -0.030913231894373894, -0.3231457471847534, -0.08002887666225433, 0.07989121973514557, 0.1420852541923523, 0.2409801483154297, -0.1378726214170456, 0.03607745096087456, 0.10527901351451874, 0.4718235731124878, -0.2444819062948227, 0.15979567170143127, 0.38517555594444275, 0.24025152623653412, -0.09048131108283997, -0.07389142364263535, 0.2586476504802704, -0.1039341539144516, 0.1535448133945465, 0.2453656643629074, 0.41161438822746277, -0.308349072933197, 0.16606895625591278, 0.34678855538368225, 0.8504579663276672, 0.3074460029602051, 0.2133956402540207, 0.5961291790008545, -0.1745390146970749, 0.4362622797489166, 0.1774471253156662, 0.030262712389230728, -0.1932079792022705, -0.3917984962463379, -0.037886761128902435, -0.09337767958641052, 0.21428868174552917, -0.1737721860408783, -0.2573467493057251, 0.13565444946289062, 0.003797873854637146, -0.0014250405365601182, -0.13571977615356445, -0.26334521174430847, -0.2468786984682083, -0.1997673213481903, -0.47216492891311646, 0.15168353915214539, 0.0521300844848156, 0.08231677114963531, -0.10094423592090607, -0.16038747131824493, -0.05270557105541229, -0.14235012233257294, -0.2749837040901184, -0.004248946905136108, -0.4886910617351532, 0.1869443953037262, 0.14764404296875, -0.4809607267379761, 0.15507358312606812, 0.16912642121315002, 0.5276753902435303, 0.06047079339623451, -0.15167711675167084, 0.07410141825675964, -0.07287314534187317, 0.04419446736574173, -0.07695213705301285, -0.005174767225980759, 0.26588496565818787, -0.17318609356880188, -0.1069846898317337, -0.18719837069511414, 0.08800175786018372, -0.045370541512966156, 0.1339363008737564, 0.03188301622867584, -0.11908738315105438, -0.25610655546188354, -0.2899339199066162, -0.1839219182729721, -0.054268695414066315, -0.4391443133354187, 0.16450442373752594, 0.04872727021574974, -0.23847058415412903, -0.13084368407726288, 0.00013625292922370136, -0.20090125501155853, -0.18382199108600616, 0.44492197036743164, -0.15241976082324982, 0.19770261645317078, 0.47952789068222046, 0.15830382704734802, -0.256869912147522, -0.19342367351055145, 0.09505875408649445, 0.37641167640686035, -0.4694076180458069, 0.23367223143577576, -0.01726645417511463, 0.13332101702690125, -0.1966545432806015, 0.27956587076187134, 0.2029331773519516, -0.06036483123898506, 0.08035261929035187, -0.3381457030773163, -0.5751748085021973, 0.0812559723854065, -0.0906047523021698, 0.2529439330101013, 0.18420082330703735, 0.24866652488708496, 0.011439613997936249, 0.03055415488779545, -0.3655773997306824, 0.04564375430345535, -0.512373685836792, 0.04710138961672783, 0.022560659795999527, -0.08726358413696289, 0.22896520793437958, 0.11494851112365723, 0.18791422247886658, 0.31880566477775574, -0.1740749329328537, -0.2829175591468811, -0.24387770891189575, 0.05384209007024765, 0.016868319362401962, -0.20033752918243408, 0.11919544637203217, 0.28475362062454224, -0.07757389545440674, -0.12615495920181274, 0.24389265477657318, 0.2751813530921936, 0.07629765570163727, 0.2768286466598511, 0.1914052963256836, 0.0757611021399498, 0.06352744251489639, -0.15325698256492615, 0.15333549678325653, 0.04197897017002106, 0.08956828713417053, -0.013138100504875183, -0.3230597674846649, -0.1447993516921997, -0.10893478989601135, 0.028283754363656044, 0.10196606814861298, 0.06194800138473511, 0.2576119601726532, -0.23997998237609863, -0.26627689599990845, 0.07749336957931519, 0.32812976837158203, 0.05384370684623718, -0.1686011701822281, 0.06481847167015076, 0.053301069885492325, 0.27249640226364136, -0.48606714606285095, 0.004470556974411011, 0.16581349074840546, -0.054345615208148956, 0.20366476476192474, 0.18789663910865784, -0.18285202980041504, 0.042864128947257996, 0.07119379937648773, 0.09441535174846649, 0.11517705023288727, -0.2050560861825943, 0.15190060436725616, 0.028104152530431747, 0.09989145398139954, 0.18741410970687866, 0.15073905885219574, 0.12045862525701523, 0.3901149034500122, 0.28915706276893616, -0.2028135061264038, 0.4441412091255188, -0.16364657878875732, 0.00028613582253456116, 0.21130988001823425, -0.3380160331726074, -0.15988101065158844, 0.015796735882759094, -0.3121018409729004, 0.021473027765750885, -0.14262855052947998, 0.3188471496105194, -0.239236980676651, -0.1949435919523239, -0.09636981785297394, 0.19258081912994385, -0.35290563106536865, -0.06698719412088394, -0.11369168758392334, -0.054939597845077515, 0.05445697903633118, -0.07710471004247665, 0.03570284694433212, 0.023564297705888748, 0.32934334874153137, -0.00935649499297142, -0.09649588167667389, -0.18228334188461304, -0.04179523140192032, 0.2830899953842163, 0.1631859391927719, -0.19728395342826843, 0.22741268575191498, 0.4433188736438751, -0.05257158726453781, -0.16723515093326569, 0.5591176152229309, 0.5641908049583435, 0.20515795052051544, 0.1511877030134201, 0.28727269172668457, 0.1018664538860321, -0.15640026330947876, -0.16159223020076752, 0.0503288097679615, 0.03136885166168213, 0.2811160981655121, 0.4380173683166504, 0.20948758721351624, -0.22525069117546082, 0.21232487261295319, 0.14007273316383362, 0.24730277061462402, -0.43123969435691833, 0.28295913338661194, -0.39490029215812683, -0.16229148209095, -0.24347257614135742, 0.0004802979528903961, -0.4199225604534149, 0.2610582113265991, 0.06125311926007271, -0.14132267236709595, 0.14803946018218994, -0.13209261000156403, 0.1155034601688385, 0.019513193517923355, 0.5679847002029419, 0.20012091100215912, 0.15351635217666626, -0.4728584587574005, -0.259694367647171, -0.3751959502696991, 0.251250684261322, 0.12600253522396088, 0.20645979046821594, -0.014637820422649384, -0.019149426370859146, -0.1681060492992401, -0.06699199974536896, 0.17709940671920776, -0.22468598186969757, -0.07247520983219147, 0.20283134281635284, -0.3309668302536011, -0.11072243750095367, -0.26686662435531616, -0.1950078308582306, 0.16236378252506256, -0.13166967034339905, 0.1644747257232666, 0.048172835260629654, 0.07664521783590317, -0.0011422764509916306, 0.1574135273694992, -0.08100540190935135, 0.15063585340976715, 0.2004275918006897, 0.17346248030662537, -0.07567286491394043, -0.18302488327026367, -0.1345176249742508, -0.12218435108661652, -0.14887788891792297, -0.2645806670188904, 0.010129584930837154, 0.10401815176010132, 0.44008341431617737, -0.06952470541000366, -0.5535539388656616, -0.25007569789886475, 0.51006680727005, 0.17991352081298828, -0.3464169502258301, -0.05943362042307854, 0.35322117805480957, -0.14342784881591797, -0.14528986811637878, 0.2007436901330948, 0.43928879499435425, -0.11220797896385193, 0.21384717524051666, -0.32077842950820923, -0.45523133873939514, 0.5414049029350281, -0.5261780619621277, -0.12039265781641006, -0.10822023451328278, 0.12998415529727936, 0.06044448912143707, -0.29072076082229614, -0.6871923804283142, 0.01835942268371582, 0.26166558265686035, -0.03735896199941635, -0.287323534488678, 0.19537751376628876, -0.0012424997985363007, 0.06137744337320328, 0.025549523532390594, 0.6861677169799805, 0.1847480833530426, -0.23433290421962738, 0.45932966470718384, -0.3806535601615906 ]
https://github.com/huggingface/datasets/issues/5886
Alternatively we could set the number of shards to be a factor than the number of processes (current they're equal) - this way it will be less likely to end up with a shard that is significantly slower than all the other ones.
Use work-stealing algorithm when parallel computing
### Feature request when i used Dataset.map api to process data concurrently, i found that it gets slower and slower as it gets closer to completion. Then i read the source code of arrow_dataset.py and found that it shard the dataset and use multiprocessing pool to execute each shard.It may cause the slowest task to drag out the entire program's execution time,especially when processing huge dataset. ### Motivation using work-stealing algorithm instead of sharding and parallel computing to optimize performance. ### Your contribution just an idea.
43
Use work-stealing algorithm when parallel computing ### Feature request when i used Dataset.map api to process data concurrently, i found that it gets slower and slower as it gets closer to completion. Then i read the source code of arrow_dataset.py and found that it shard the dataset and use multiprocessing pool to execute each shard.It may cause the slowest task to drag out the entire program's execution time,especially when processing huge dataset. ### Motivation using work-stealing algorithm instead of sharding and parallel computing to optimize performance. ### Your contribution just an idea. Alternatively we could set the number of shards to be a factor than the number of processes (current they're equal) - this way it will be less likely to end up with a shard that is significantly slower than all the other ones.
[ -0.46819764375686646, -0.012245208024978638, -0.2587614357471466, 0.03908589482307434, -0.22621271014213562, -0.154657781124115, 0.3446865379810333, 0.3786158263683319, 0.008455149829387665, 0.285952627658844, 0.12465023249387741, 0.5204822421073914, -0.09565358608961105, 0.08089741319417953, -0.17351198196411133, 0.07665441185235977, -0.04652627557516098, 0.13030841946601868, -0.10221628844738007, 0.058071643114089966, -0.16704297065734863, -0.09022984653711319, 0.050290241837501526, -0.14248771965503693, -0.14752459526062012, -0.16795752942562103, 0.11833208799362183, 0.03557039797306061, 0.1128145381808281, -0.18903306126594543, 0.10403259098529816, 0.2788589596748352, -0.30998367071151733, 0.437997967004776, -0.00009894189133774489, -0.08760105073451996, 0.19685275852680206, 0.2546272873878479, -0.0037994608283042908, 0.19507934153079987, -0.2370142936706543, -0.35308846831321716, 0.09009430557489395, -0.3694378137588501, 0.09812042117118835, -0.059612445533275604, 0.0710047110915184, -0.33093202114105225, 0.4957822859287262, -0.3494437634944916, 0.25495994091033936, 0.387387216091156, -0.17793434858322144, 0.07355672121047974, -0.04442593827843666, -0.17495641112327576, -0.14420217275619507, 0.09382960200309753, 0.1903979480266571, -0.021389812231063843, -0.10960293561220169, 0.454485148191452, -0.23831510543823242, 0.39146652817726135, 0.014927206560969353, -0.08900728821754456, -0.14259901642799377, -0.2417406439781189, 0.05483878776431084, 0.26019397377967834, -0.10473749786615372, -0.18215782940387726, -0.32057684659957886, -0.41111329197883606, -0.07899056375026703, -0.25813984870910645, -0.18103843927383423, 0.13337334990501404, -0.11257506906986237, 0.14787720143795013, -0.17740193009376526, 0.002262793481349945, 0.06864193081855774, -0.18147796392440796, 0.36714401841163635, 0.019280491396784782, 0.09025487303733826, 0.10484996438026428, 0.37291839718818665, 0.1760832816362381, 0.06682756543159485, -0.135701984167099, 0.1226935163140297, -0.14898063242435455, -0.39926809072494507, -0.025854557752609253, -0.2120506465435028, -0.1289834976196289, 0.22833985090255737, 0.08546489477157593, 0.2519083023071289, 0.4021984934806824, 0.3264893591403961, 0.27657827734947205, 0.07416556775569916, -0.3306472897529602, -0.17624904215335846, -0.08450240641832352, 0.03712824732065201, -0.30044037103652954, -0.29842251539230347, 0.04470003396272659, 0.1328093707561493, -0.21167168021202087, 0.1353135108947754, 0.035533707588911057, 0.01344204694032669, 0.09065625071525574, 0.013268992304801941, -0.3016301989555359, 0.11188295483589172, -0.1587885320186615, -0.07447594404220581, 0.34272751212120056, 0.06602281332015991, 0.1005132794380188, -0.2630617618560791, -0.01250794529914856, -0.19610154628753662, -0.01318962499499321, -0.16792599856853485, -0.05422288551926613, -0.02606114000082016, 0.18370190262794495, -0.01613827794790268, 0.11198174208402634, 0.004081122577190399, 0.018729317933321, 0.0784144252538681, 0.03940115123987198, 0.43731939792633057, -0.20865187048912048, 0.07684555649757385, 0.0701686218380928, -0.15318386256694794, -0.14497652649879456, -0.14747491478919983, 0.3573474586009979, -0.37017083168029785, 0.11960911750793457, -0.30381861329078674, -0.3154924511909485, 0.2121259570121765, 0.25656694173812866, 0.0855000764131546, 0.07933227717876434, -0.4278617799282074, 0.15096032619476318, 0.14671184122562408, -0.006068713963031769, -0.015253499150276184, -0.003203979693353176, -0.3388412892818451, -0.2144685685634613, 0.26187142729759216, 0.28653913736343384, 0.02677818387746811, 0.028476223349571228, -0.22533905506134033, -0.014458592981100082, 0.044081661850214005, 0.44448012113571167, -0.21904072165489197, -0.08157162368297577, -0.033557675778865814, 0.3623191714286804, 0.3621160387992859, -0.09772154688835144, -0.42352163791656494, 0.25501126050949097, -0.24243521690368652, -0.1819193959236145, 0.3930356800556183, 0.33648157119750977, 0.3860325217247009, -0.0880766287446022, -0.11952576041221619, 0.37167006731033325, -0.044693589210510254, 0.23277828097343445, -0.38421007990837097, -0.44876402616500854, 0.01510067842900753, 0.4202779233455658, -0.033746905624866486, -0.13228043913841248, 0.1420549750328064, -0.6382392048835754, 0.36667829751968384, -0.0037997066974639893, 0.0853680744767189, -0.19968320429325104, 0.0991402268409729, -0.18480980396270752, -0.07385960221290588, -0.1284734308719635, -0.03307650238275528, 0.28219324350357056, -0.024587225168943405, -0.22112919390201569, -0.02420245110988617, -0.3569974899291992, 0.29344865679740906, 0.10770867019891739, -0.06908909976482391, 0.04559025913476944, 0.17551806569099426, -0.16502445936203003, 0.12028190493583679, -0.17467257380485535, -0.18539869785308838, 0.23988114297389984, -0.4048719108104706, -0.09737241268157959, -0.06832358986139297, 0.059981562197208405, 0.08270591497421265, 0.014431487768888474, -0.0389915369451046, -0.016123950481414795, -0.16497212648391724, 0.022889014333486557, 0.08387152850627899, 0.0748097151517868, 0.02997252717614174, 0.442280650138855, 0.4688442647457123, 0.3528924584388733, 0.022759003564715385, -0.08574876189231873, 0.12739220261573792, 0.12108831852674484, 0.022761687636375427, 0.0012999624013900757, 0.06760258227586746, 0.293051540851593, -0.028915926814079285, 0.2577010989189148, 0.0366295725107193, -0.023234304040670395, 0.07370925694704056, -0.050927694886922836, 0.023389331996440887, 0.1051689088344574, 0.12489328533411026, -0.0354837104678154, 0.2497059404850006, 0.2886701226234436, -0.08197638392448425, 0.33607912063598633, 0.4942712187767029, 0.02469807118177414, 0.12016850709915161, 0.036301251500844955, 0.07384882867336273, 0.028056688606739044, 0.14161762595176697, 0.573642909526825, 0.15996554493904114, 0.3094250559806824, 0.06942631304264069, -0.06379831582307816, 0.09880796819925308, -0.2582528293132782, 0.07008548825979233, 0.3602362871170044, 0.417511522769928, -0.1568581759929657, 0.05364217981696129, -0.15142469108104706, -0.051743827760219574, -0.37640589475631714, -0.030187005177140236, -0.11916287988424301, 0.17626884579658508, 0.06111261993646622, -0.11623067408800125, 0.19318677484989166, -0.2802804410457611, 0.16534994542598724, 0.06488604843616486, -0.11508939415216446, 0.09163111448287964, 0.2455238401889801, -0.3329799771308899, 0.25832727551460266, -0.07554373145103455, 0.13099218904972076, -0.23876097798347473, -0.17322367429733276, -0.21985386312007904, -0.20894798636436462, 0.30865582823753357, 0.14143776893615723, 0.3505927324295044, 0.323371022939682, 0.3616916835308075, -0.027672767639160156, -0.1259031891822815, -0.24234363436698914, 0.08679930865764618, -0.13466008007526398, 0.04109441488981247, 0.0008559990674257278, -0.09253554791212082, -0.1381085216999054, -0.2837463319301605, -0.21925316751003265, 0.006859391927719116, -0.4936651587486267, -0.06566648185253143, -0.06554199755191803, 0.002783149480819702, -0.0779576301574707, 0.03737460821866989, -0.1524205058813095, -0.45258334279060364, -0.48946666717529297, 0.5615909099578857, 0.03701838105916977, 0.24594374001026154, -0.3631691038608551, 0.06178021803498268, 0.0045055486261844635, -0.045826178044080734, 0.05577473342418671, -0.06838233768939972, -0.32162541151046753, 0.09039150178432465, -0.05507783591747284, -0.09339091181755066, -0.2265259325504303, -0.19774529337882996, 0.09859436750411987, 0.3700493574142456, -0.09584052115678787, -0.09052332490682602, -0.2572938799858093, 0.32843977212905884, -0.0667436495423317, 0.09313809871673584, 0.4488564729690552, 0.11233627796173096, -0.23002326488494873, 0.1721273809671402, 0.1518779993057251, 0.12511968612670898, -0.13765427470207214, -0.30328959226608276, 0.2516697347164154, 0.21676760911941528, 0.26865482330322266, 1.0115498304367065, 0.16097334027290344, -0.036361679434776306, 0.1610737442970276, 0.06715886294841766, -0.12589895725250244, -0.05738486722111702, -0.18438315391540527, -0.09989035129547119, -0.029816828668117523, -0.07842906564474106, 0.07945459336042404, -0.13173933327198029, -0.13464821875095367, 0.06672684103250504, -0.32967713475227356, -0.35318446159362793, -0.18374109268188477, 0.22842787206172943, 0.022847140207886696, 0.18715053796768188, 0.02069612592458725, 0.060632362961769104, -0.025485552847385406, 0.011080458760261536, 0.09788118302822113, -0.0658474788069725, 0.3210574686527252, -0.2359776794910431, -0.12608976662158966, 0.12354385852813721, -0.7360514998435974, 0.3259945511817932, -0.0626613199710846, -0.03175513818860054, 0.07115337252616882, -0.2060539871454239, 0.09771253913640976, -0.12988583743572235, 0.503869354724884, 0.08841964602470398, -0.09873214364051819, -0.1095302402973175, -0.35528433322906494, -0.07176084816455841, 0.17742130160331726, -0.10678155720233917, 0.16366064548492432, -0.037049420177936554, 0.038150541484355927, -0.24168901145458221, -0.1300869584083557, -0.06513485312461853, 0.09903614223003387, -0.05613028630614281, -0.14950254559516907, -0.26172852516174316, -0.20368394255638123, -0.38545337319374084, 0.33056047558784485, 0.014237403869628906, 0.02646513283252716, -0.1362604796886444, -0.21539169549942017, -0.2642441391944885, 0.05256657302379608, 0.16162195801734924, 0.06358298659324646, 0.1666249781847, -0.27322760224342346, 0.504568874835968, -0.00633079232648015, -0.19004985690116882, 0.24691344797611237, 0.15748795866966248, 0.11978766322135925, -0.01660839095711708, -0.16417330503463745, -0.058542635291814804, 0.3098265528678894, 0.12303873896598816, -0.031225375831127167, 0.3421638011932373, 0.11024224013090134, 0.3478296399116516, -0.25957682728767395, -0.3527812361717224, -0.06286665797233582, 0.15538328886032104, -0.0037342868745326996, -0.31704649329185486, 0.29458853602409363, 0.12384212762117386, -0.1535443216562271, 0.32219669222831726, -0.2834968566894531, -0.04900573194026947, 0.45935219526290894, 0.32320064306259155, 0.7707089781761169, -0.28150445222854614, 0.15424951910972595, -0.13626304268836975, -0.01914074271917343, 0.27532902359962463, -0.2363239824771881, 0.12219437956809998, -0.26370882987976074, -0.2864161729812622, 0.11936280131340027, -0.13538824021816254, 0.16371186077594757, 0.27402833104133606, 0.07814916223287582, 0.1988762617111206, 0.13673365116119385, -0.0021058120764791965, -0.265885591506958, 0.45266640186309814, -0.1907859444618225, -0.47529271245002747, -0.008574947714805603, 0.19758832454681396, 0.06737972795963287, -0.2210736870765686, -0.020344682037830353, -0.09400506317615509, -0.039447709918022156, 0.0017142146825790405, -0.08630973845720291, -0.09866894036531448, 0.04180982708930969, 0.45268553495407104, -0.36748215556144714, -0.3324176073074341, 0.08717505633831024, -0.06762267649173737, 0.02466355450451374, 0.08899203687906265, -0.036139801144599915, 0.17233704030513763, -0.020390935242176056, 0.27242305874824524, 0.1982501596212387, -0.2818109095096588, 0.011803274974226952, -0.18850597739219666, -0.20307934284210205, -0.15308429300785065, 0.25287064909935, -0.6448290944099426, -0.18949811160564423, 0.17217959463596344, 0.08398692309856415, 0.22301219403743744, -0.16860534250736237, 0.12372281402349472, -0.5628836154937744, -0.23790335655212402, 0.19639979302883148, 0.2414485514163971, -0.24652239680290222, 0.5911046266555786, -0.0059954579919576645, -0.18885347247123718, -0.17208336293697357, 0.09836573898792267, 0.17977134883403778, 0.27331623435020447, 0.2315777987241745, -0.10363060235977173, -0.11864899098873138, -0.3623026907444, -0.0488472655415535, 0.07745230197906494, -0.14186623692512512, 0.027568764984607697, -0.14290335774421692, -0.10211233794689178, -0.021526522934436798, -0.11640051007270813, -0.08211298286914825, 0.19389809668064117, -0.32480305433273315, -0.2651248872280121, -0.21836057305335999, 0.3229556977748871, 0.0054931421764194965, 0.16967934370040894, 0.011783063411712646, 0.022127795964479446, -0.1978006660938263, 0.2853832542896271, -0.41413331031799316, 0.23299339413642883, -0.13225802779197693, 0.015427559614181519, 0.054472777992486954, -0.0997275784611702, 0.1902293562889099, 0.12759065628051758, 0.11660680174827576, 0.33244556188583374, -0.396610289812088, -0.3622898757457733, 0.11293111741542816, 0.05815580487251282, -0.2353190779685974, 0.03275870531797409, -0.13256539404392242, -0.10600968450307846, -0.22570282220840454, -0.2112349569797516, -0.09810231626033783, -0.11481603980064392, -0.1679077446460724, -0.12912923097610474, 0.4024331569671631, -0.037323255091905594, -0.34649333357810974, 0.28489911556243896, -0.19258356094360352, -0.06539266556501389, -0.2328444868326187, 0.2821428179740906, 0.21780598163604736, -0.02487742155790329, 0.18994641304016113, -0.09882280230522156, 0.24817007780075073, 0.06544022262096405, 0.19994863867759705, 0.14010074734687805, -0.22354499995708466, 0.03227661922574043, 0.5941371917724609, 0.2790865898132324, 0.17475348711013794, -0.0866503193974495, 0.17298613488674164, 0.3231401741504669, -0.1447022706270218, -0.24100589752197266, 0.5923663377761841, -0.21172550320625305, 0.23029550909996033, 0.23821739852428436, 0.2023700773715973, 0.37027692794799805, -0.2206687182188034, 0.055233534425497055, 0.18641701340675354, -0.673270583152771, 0.15560293197631836, -0.16779592633247375, 0.11336523294448853, -0.08212524652481079, 0.25867530703544617, 0.17875126004219055, 0.3241860568523407, 0.37613266706466675, -0.30304116010665894, 0.8342882394790649, 0.15994517505168915, -0.0512089803814888, -0.011069409549236298, -0.10089389234781265, 0.08953430503606796, 0.1645471602678299, -0.0849817544221878, 0.20601870119571686, 0.10041916370391846, 0.3860222399234772, -0.012247655540704727, -0.22367896139621735, -0.12250624597072601, 0.20305168628692627, -0.09668586403131485, 0.016834497451782227, 0.1184663474559784, -0.008712559938430786, 0.1359364241361618, 0.012221366167068481, 0.14802072942256927, 0.00668962299823761, 0.8235563635826111, 0.1672637164592743, 0.17660127580165863, 0.12007144093513489, -0.0018016789108514786, 0.06726023554801941, 0.5089690685272217, -0.35057103633880615, -0.25357502698898315, -0.033897146582603455, 0.19037878513336182, -0.17001980543136597, 0.13308069109916687, 0.14694857597351074, -0.02790810912847519, -0.10963365435600281, 0.18579934537410736, -0.10175523161888123, -0.0056062303483486176, -0.4043337404727936, 0.2766282260417938, -0.04335292801260948, 0.11776264011859894, 0.29046162962913513, 0.20629307627677917, -0.2986469566822052, -0.3131551742553711, 0.04842229187488556, -0.05301908403635025, -0.43010789155960083, 0.010390419512987137, 0.19065359234809875, -0.4865112602710724, -0.005935288034379482, 0.26646292209625244, -0.1584548056125641, -0.1063593178987503, 0.24277052283287048, -0.47586989402770996, -0.11571359634399414, -0.17211271822452545, 0.13504408299922943, -0.11136339604854584, 0.5770463943481445, 0.02360326424241066, 0.43107882142066956, -0.2654631733894348, -0.0033636540174484253, -0.5327019691467285, 0.021107591688632965, -0.31951090693473816, 0.18348106741905212, 0.027143459767103195, 0.31478384137153625, 0.12328650057315826, 0.2877553403377533, 0.20752543210983276, -0.03045417182147503, -0.05889924243092537, 0.22074639797210693, -0.18485677242279053, 0.2604929208755493, -0.17598050832748413, -0.32689169049263, 0.23311279714107513, -0.5024991631507874, 0.3083679676055908, -0.015422273427248001, 0.13112902641296387, 0.08556746691465378, 0.12333928048610687, 0.33394625782966614, -0.32353857159614563, 0.46985918283462524, 0.12249045073986053, 0.06485772877931595, -0.18810756504535675, -0.031931981444358826, 0.010543905198574066, -0.08578147739171982, -0.2160390466451645, 0.21264182031154633, 0.01347658596932888, 0.16177108883857727, -0.034358445554971695, 0.007914546877145767, -0.1441282331943512, 0.15223464369773865, -0.17837859690189362, 0.08729156851768494, 0.13284733891487122, 0.0842888355255127, 0.13616639375686646, 0.2888334393501282, -0.15028537809848785, 0.31579193472862244, 0.04018072038888931, -0.06089314445853233, -0.2641730308532715, -0.19961340725421906, 0.2594931125640869, -0.30574628710746765, -0.20611247420310974, -0.29103708267211914, 0.3816968500614166, 0.21211954951286316, 0.061833031475543976, -0.360312819480896, -0.2700846791267395, 0.1209941953420639, -0.06892265379428864, -0.02445899322628975, 0.34358733892440796, 0.08626486361026764, -0.14561113715171814, -0.06573916971683502, 0.07699082791805267, -0.3475337326526642, -0.2819136679172516, 0.11356928944587708, -0.3276796340942383 ]
https://github.com/huggingface/datasets/issues/5888
Hi! You want to use `push_to_hub` (creates Parquet files) instead of `save_to_disk` (creates Arrow files) when creating a Hub dataset. Parquet is designed for long-term storage and takes less space than the Arrow format, and, most importantly, `load_dataset` can parse it, which should fix the viewer. Regarding the dataset generation, `Dataset.from_generator` with the video data represented as `datasets.Value("binary")` followed by `push_to_hub` should work (if the `push_to_hub` step times out, restart it to resume uploading) PS: Once the dataset is uploaded, to make working with the dataset easier, it's a good idea to add a [transform](https://huggingface.co/docs/datasets/main/en/process#format-transform) to the README that shows how to decode the binary video data into something a model can understand. Also, if you get an `ArrowInvalid` error (can happen when working with large binary data) in `Dataset.from_generator`, reduce the value of `writer_batch_size` (the default is 1000) to fix it.
A way to upload and visualize .mp4 files (millions of them) as part of a dataset
**Is your feature request related to a problem? Please describe.** I recently chose to use huggingface hub as the home for a large multi modal dataset I've been building. https://huggingface.co/datasets/Antreas/TALI It combines images, text, audio and video. Now, I could very easily upload a dataset made via datasets.Dataset.from_generator, as long as it did not include video files. I found that including .mp4 files in the entries would not auto-upload those files. Hence I tried to upload them myself. I quickly found out that uploading many small files is a very bad way to use git lfs, and that it would take ages, so, I resorted to using 7z to pack them all up. But then I had a new problem. My dataset had a size of 1.9TB. Trying to upload such a large file with the default huggingface_hub API always resulted in time outs etc. So I decided to split the large files into chunks of 5GB each and reupload. So, eventually it all worked out. But now the dataset can't be properly and natively used by the datasets API because of all the needed preprocessing -- and furthermore the hub is unable to visualize things. **Describe the solution you'd like** A native way to upload large datasets that include .mp4 or other video types. **Describe alternatives you've considered** Already explained earlier **Additional context** https://huggingface.co/datasets/Antreas/TALI
142
A way to upload and visualize .mp4 files (millions of them) as part of a dataset **Is your feature request related to a problem? Please describe.** I recently chose to use huggingface hub as the home for a large multi modal dataset I've been building. https://huggingface.co/datasets/Antreas/TALI It combines images, text, audio and video. Now, I could very easily upload a dataset made via datasets.Dataset.from_generator, as long as it did not include video files. I found that including .mp4 files in the entries would not auto-upload those files. Hence I tried to upload them myself. I quickly found out that uploading many small files is a very bad way to use git lfs, and that it would take ages, so, I resorted to using 7z to pack them all up. But then I had a new problem. My dataset had a size of 1.9TB. Trying to upload such a large file with the default huggingface_hub API always resulted in time outs etc. So I decided to split the large files into chunks of 5GB each and reupload. So, eventually it all worked out. But now the dataset can't be properly and natively used by the datasets API because of all the needed preprocessing -- and furthermore the hub is unable to visualize things. **Describe the solution you'd like** A native way to upload large datasets that include .mp4 or other video types. **Describe alternatives you've considered** Already explained earlier **Additional context** https://huggingface.co/datasets/Antreas/TALI Hi! You want to use `push_to_hub` (creates Parquet files) instead of `save_to_disk` (creates Arrow files) when creating a Hub dataset. Parquet is designed for long-term storage and takes less space than the Arrow format, and, most importantly, `load_dataset` can parse it, which should fix the viewer. Regarding the dataset generation, `Dataset.from_generator` with the video data represented as `datasets.Value("binary")` followed by `push_to_hub` should work (if the `push_to_hub` step times out, restart it to resume uploading) PS: Once the dataset is uploaded, to make working with the dataset easier, it's a good idea to add a [transform](https://huggingface.co/docs/datasets/main/en/process#format-transform) to the README that shows how to decode the binary video data into something a model can understand. Also, if you get an `ArrowInvalid` error (can happen when working with large binary data) in `Dataset.from_generator`, reduce the value of `writer_batch_size` (the default is 1000) to fix it.
[ -0.5871188640594482, -0.31734830141067505, 0.010441608726978302, 0.08555720746517181, 0.24533280730247498, 0.02440652996301651, 0.02347424626350403, 0.3973582088947296, -0.10469847917556763, 0.008287500590085983, -0.07994148880243301, 0.25892120599746704, -0.3773573040962219, 0.6446731686592102, -0.004024576395750046, -0.11771966516971588, 0.10561271011829376, 0.2893349528312683, 0.17571495473384857, 0.19962020218372345, 0.04386827349662781, -0.2412109375, 0.28531786799430847, -0.20793792605400085, -0.5986974835395813, -0.10210788249969482, -0.13561846315860748, 0.23582196235656738, -0.14570924639701843, -0.3176218271255493, -0.2501385509967804, 0.054711975157260895, 0.5052582621574402, 0.5777088403701782, -0.00011648763029370457, -0.2683001756668091, 0.38583454489707947, -0.191575288772583, -0.26127520203590393, 0.057617977261543274, -0.014547958970069885, -0.34802907705307007, 0.162980318069458, -0.039785511791706085, 0.02083214372396469, -0.42039474844932556, 0.2064903825521469, -0.4522097110748291, 0.11860150098800659, -0.3128461241722107, 0.07185068726539612, 0.09119103848934174, -0.13771449029445648, 0.1637822985649109, 0.17524611949920654, 0.6428640484809875, -0.31441235542297363, 0.0369282066822052, 0.5802661776542664, 0.13640770316123962, -0.12932392954826355, 0.06030441075563431, 0.26355358958244324, -0.26732608675956726, 0.49025672674179077, -0.04643819481134415, 0.0711759701371193, -0.4847760796546936, -0.14280366897583008, 0.2054060399532318, 0.5241996049880981, -0.15452143549919128, -0.5592658519744873, -0.38743650913238525, 0.06232443451881409, -0.15329508483409882, -0.06982700526714325, 0.4366399049758911, -0.16012907028198242, 0.16115544736385345, -0.22614383697509766, -0.2104886919260025, -0.326114296913147, 0.20707882940769196, 0.23709487915039062, -0.4191356301307678, -0.02061573415994644, -0.02494598925113678, 0.03555270656943321, -0.2808641195297241, 0.05818721652030945, -0.24319902062416077, 0.33924809098243713, -0.014351865276694298, -0.08562076091766357, -0.21366825699806213, -0.11046098172664642, 0.45817315578460693, 0.055434733629226685, 0.1600641906261444, -0.07423601299524307, 0.27616211771965027, -0.47890084981918335, 0.13712652027606964, 0.1203339546918869, -0.048502545803785324, 0.028927430510520935, -0.35857152938842773, 0.3056032955646515, 0.28368669748306274, -0.0171867236495018, -0.09094341099262238, -0.2812376022338867, 0.003216579556465149, -0.3992462754249573, -0.008029080927371979, 0.06148236244916916, 0.05129916965961456, -0.13112612068653107, -0.14277015626430511, -0.2133057564496994, 0.16638857126235962, 0.03582526370882988, 0.12306150794029236, -0.17968519032001495, 0.3071536123752594, -0.36275503039360046, 0.3178446888923645, 0.0706801787018776, -0.5015510320663452, -0.0052604153752326965, 0.07825800776481628, -0.2565902769565582, 0.43165111541748047, 0.12843994796276093, -0.3791183531284332, -0.08446656167507172, 0.025996223092079163, 0.4278786778450012, 0.12004294991493225, 0.06559474021196365, -0.19314277172088623, 0.06167735904455185, 0.061302218586206436, 0.0021384432911872864, 0.10073024779558182, 0.1081007793545723, 0.03864949941635132, -0.13269178569316864, 0.010906310752034187, -0.0405014269053936, -0.39215630292892456, -0.1799200177192688, 0.005366837605834007, -0.1717047095298767, 0.1393740028142929, -0.6916586756706238, 0.22340035438537598, -0.37359926104545593, -0.08323395252227783, -0.16586101055145264, 0.24009263515472412, 0.15724118053913116, -0.3581426441669464, -0.02422124519944191, 0.4686580300331116, -0.3979419469833374, 0.12532371282577515, -0.3144403100013733, 0.16642779111862183, 0.15199992060661316, 0.19300660490989685, 0.010240808129310608, 0.05937991291284561, -0.19999760389328003, 0.1431230902671814, 0.27652281522750854, -0.687892496585846, 0.02050851657986641, 0.37527403235435486, -0.00012759119272232056, 0.4109175205230713, 0.1482660472393036, 0.2809965908527374, 0.05587916821241379, -0.28277361392974854, 0.1465112566947937, 0.29316726326942444, -0.026498515158891678, -0.03685757517814636, -0.1216965913772583, -0.5783979296684265, -0.0444750152528286, 0.24153679609298706, -0.03892423212528229, -0.08691596984863281, 0.24434590339660645, -0.23875069618225098, 0.16238784790039062, -0.17881403863430023, 0.5247799754142761, -0.20290011167526245, 0.43023648858070374, 0.06690189242362976, -0.30776914954185486, -0.29719167947769165, -0.5735052227973938, 0.2134583741426468, -0.011119022965431213, -0.1562073528766632, -0.18378132581710815, -0.30199092626571655, 0.2178565263748169, -0.2905322313308716, -0.05661334469914436, 0.14920523762702942, 0.04579221457242966, 0.10531022399663925, -0.29819780588150024, -0.030059602111577988, -0.36695176362991333, 0.1933760643005371, 0.09134180098772049, 0.07569202780723572, -0.07355234026908875, 0.536247730255127, 0.19279561936855316, -0.2303048074245453, 0.023786000907421112, 0.10768457502126694, 0.20494453608989716, -0.1526130735874176, 0.20560628175735474, 0.12544144690036774, 0.021798234432935715, 0.5147864818572998, 0.41304701566696167, 0.6095767021179199, 0.38391852378845215, -0.33480554819107056, 0.18338604271411896, -0.24747434258460999, 0.044894322752952576, -0.03158579021692276, -0.2133747935295105, 0.1915483921766281, -0.159223735332489, -0.04126719385385513, 0.17334960401058197, -0.0038923993706703186, -0.006216101348400116, 0.19547051191329956, -0.19476906955242157, -0.13813266158103943, -0.0566554069519043, 0.23132017254829407, 0.12553544342517853, -0.2382785528898239, -0.06593453139066696, 0.15601280331611633, 0.4618537127971649, 0.015411294996738434, -0.07762284576892853, 0.18922576308250427, -0.26124536991119385, -0.05184398591518402, 0.19149035215377808, -0.09475091099739075, 0.09775306284427643, 0.21405784785747528, -0.1320156753063202, -0.06397508084774017, 0.33185875415802, -0.035586144775152206, -0.06667870283126831, 0.248899906873703, 0.12971842288970947, 0.25938016176223755, 0.20902109146118164, 0.15066558122634888, -0.07884182780981064, -0.20396688580513, 0.23803843557834625, -0.11449939012527466, -0.007574610412120819, -0.0878220722079277, -0.22522582113742828, 0.06648401916027069, 0.26058194041252136, -0.4010700285434723, -0.20674969255924225, -0.13406096398830414, 0.04613092541694641, 0.2774880528450012, -0.1742934286594391, 0.03986746072769165, 0.17098823189735413, 0.641625165939331, -0.16747084259986877, -0.2442118376493454, -0.1681310385465622, 0.10087546706199646, 0.09770141541957855, 0.05545496195554733, 0.4593583941459656, 0.08995382487773895, 0.23056413233280182, -0.025550805032253265, 0.44458189606666565, -0.7336328029632568, -0.06623619049787521, 0.21083620190620422, 0.0848044604063034, 0.361746221780777, -0.19325006008148193, 0.09651164710521698, 0.08559408783912659, -0.03430573269724846, -0.033648356795310974, -0.039871688932180405, 0.1004951149225235, -0.2305627465248108, 0.020616918802261353, 0.04278823733329773, 0.021788284182548523, 0.17135082185268402, -0.3377019762992859, -0.7167106866836548, 0.5012874007225037, 0.2241688072681427, -0.021963201463222504, -0.08211582899093628, 0.2874695956707001, 0.13379022479057312, 0.10433413833379745, -0.05655097961425781, 0.129662424325943, -0.2386046051979065, 0.1586853414773941, -0.3104088604450226, -0.3597961366176605, 0.205270454287529, 0.03711046278476715, -0.10332588851451874, 0.22110635042190552, -0.23805072903633118, -0.33347082138061523, -0.06741148233413696, 0.37064242362976074, 0.058993756771087646, -0.05278658866882324, 0.0645017921924591, 0.08049075305461884, 0.039841488003730774, -0.04930635914206505, -0.052085161209106445, -0.09290633350610733, 0.424788236618042, -0.02500060573220253, 0.20476773381233215, 0.11612370610237122, 0.14402621984481812, 0.6975115537643433, 0.311378538608551, -0.1944413185119629, 0.5138903856277466, 0.13527275621891022, 0.3771763741970062, -0.18369720876216888, -0.035470861941576004, 0.05689811706542969, -0.3665159046649933, 0.14513102173805237, 0.4069594740867615, 0.19664673507213593, 0.01655152067542076, -0.010095223784446716, 0.040753789246082306, -0.18077951669692993, 0.02318115532398224, 0.15871021151542664, -0.1152002140879631, -0.04563549906015396, -0.3232818841934204, -0.4907725155353546, -0.30026501417160034, -0.24655216932296753, 0.29257872700691223, 0.44597679376602173, 0.37382692098617554, -0.018420720472931862, -0.08941470086574554, 0.09622017294168472, -0.13999104499816895, 0.3184499442577362, 0.21874479949474335, -0.06669478118419647, -0.0376717746257782, -0.18377265334129333, 0.024179359897971153, -0.09731875360012054, 0.6386815905570984, -0.3811763525009155, -0.16102682054042816, -0.139122873544693, -0.10605479031801224, -0.2235715389251709, 0.05095261335372925, -0.16736547648906708, 0.06809361279010773, 0.10199412703514099, 0.9105267524719238, -0.10510826855897903, -0.11504568159580231, -0.5971525311470032, 0.34411466121673584, 0.16553926467895508, -0.11822928488254547, 0.0690220296382904, 0.3544319272041321, -0.636439859867096, -0.3456275463104248, 0.2842720150947571, -0.04206947982311249, -0.07342853397130966, -0.21631166338920593, 0.06802969425916672, -0.0663953348994255, 0.2570580244064331, -0.0847141370177269, 0.1883462369441986, 0.03173540532588959, 0.06509459018707275, 0.027993544936180115, 0.2710427939891815, 0.5833864808082581, 0.5490707755088806, 0.1960686892271042, -0.0459701269865036, 0.3289199471473694, 0.04338374361395836, 0.2882586419582367, 0.477282851934433, 0.314277321100235, 0.13286207616329193, -0.17913654446601868, 0.22754685580730438, -0.6972253918647766, 0.3789425790309906, 0.369188129901886, -0.4613942801952362, -0.2932888865470886, -0.07417439669370651, 0.6525435447692871, -0.050461545586586, 0.0062032341957092285, 0.19740764796733856, 0.6678892374038696, -0.0008963048458099365, -0.02650141716003418, 0.25100064277648926, 1.0886192321777344, -0.032264042645692825, 0.32996922731399536, -0.20543283224105835, -0.09863470494747162, 0.27421051263809204, -0.6566510200500488, -0.08352011442184448, -0.2799045443534851, -0.18828588724136353, -0.09539096802473068, -0.011277779936790466, 0.10261628031730652, 0.12059345841407776, -0.1760389804840088, -0.05533172935247421, 0.08134351670742035, 0.19559693336486816, -0.19360682368278503, 0.34251606464385986, -0.3640020191669464, -0.37967461347579956, -0.37168875336647034, 0.09500423073768616, -0.02293759025633335, -0.08806927502155304, -0.08991789817810059, -0.2299741804599762, -0.20361784100532532, 0.2518315315246582, -0.38846921920776367, -0.06242725998163223, 0.08346036076545715, -0.068687304854393, 0.09292319416999817, 0.0059456974267959595, 0.24913859367370605, -0.12872456014156342, -0.004611611366271973, -0.03669813275337219, -0.3076951503753662, 0.06826923787593842, -0.23621779680252075, 0.08647434413433075, -0.15138722956180573, -0.22116392850875854, 0.518883228302002, -0.17563843727111816, -0.007723614573478699, 0.2739715576171875, 0.09852501004934311, -0.05639481544494629, -0.04958470165729523, -0.07198094576597214, 0.15564848482608795, 0.05437224358320236, -0.26425817608833313, -0.09894528985023499, -0.06175818666815758, 0.015079207718372345, -0.024476146325469017, 0.2060825675725937, 0.060112640261650085, -0.0009986646473407745, 0.22919531166553497, 0.09698916971683502, -0.16625016927719116, 0.08520718663930893, -0.2538049817085266, -0.3096066117286682, 0.016672389581799507, 0.27864792943000793, -0.1648981124162674, -0.012090131640434265, 0.40767863392829895, 0.19996540248394012, -0.2917933464050293, -0.07823739945888519, 0.15460935235023499, -0.1614900529384613, 0.1339438259601593, -0.09236974269151688, 0.23841612040996552, -0.1620299518108368, -0.10039922595024109, -0.17187084257602692, -0.4419108033180237, 0.19925346970558167, -0.25547486543655396, 0.2589614987373352, -0.2485419660806656, -0.23330280184745789, 0.07933951169252396, 0.13089090585708618, -0.218939870595932, 0.17747145891189575, 0.05661933869123459, 0.1805662214756012, -0.10935981571674347, -0.09067773818969727, -0.01452833041548729, 0.05065741389989853, -0.09016057848930359, -0.04428468272089958, -0.4214552044868469, 0.008026685565710068, -0.22106410562992096, 0.21973256766796112, 0.3878597319126129, -0.06704743206501007, 0.09983021765947342, -0.006147421896457672, -0.22330866754055023, -0.25867295265197754, 0.1675848662853241, -0.08332903683185577, -0.09693333506584167, -0.25216400623321533, 0.5074613690376282, -0.17219719290733337, -0.01556609570980072, 0.06527663767337799, 0.3933219313621521, 0.3918284773826599, 0.00040757283568382263, -0.11314992606639862, -0.08485198765993118, -0.11931421607732773, -0.02110164240002632, 0.2807147800922394, 0.32330048084259033, 0.2240934669971466, 0.3528253436088562, 0.05695882812142372, 0.15658017992973328, -0.10784359276294708, 0.2786361277103424, -0.04110381007194519, 0.016789447516202927, 0.008914656937122345, 0.3581457734107971, 0.10333969444036484, 0.0760887861251831, -0.09540615975856781, 0.21976131200790405, -0.26909077167510986, 0.2993808090686798, 0.11789615452289581, 0.32498112320899963, 0.30471116304397583, -0.1716139018535614, -0.16525974869728088, 0.20349237322807312, -0.019398968666791916, 0.13248971104621887, 0.10223966091871262, -0.0720566064119339, 0.11839822679758072, 0.003810850903391838, 0.3097479045391083, 0.10567791759967804, 0.5262033343315125, -0.40462541580200195, 0.015358088538050652, 0.2224973440170288, -0.2724815905094147, 0.274442583322525, -0.4265037775039673, -0.1947030872106552, 0.27574265003204346, 0.27680304646492004, 0.2917589843273163, 0.04069161415100098, -0.0066271014511585236, 0.054103996604681015, -0.14095178246498108, -0.2413226217031479, 0.2173866629600525, 0.26538360118865967, 0.0790940597653389, 0.15367767214775085, -0.26621654629707336, -0.46332913637161255, 0.15877023339271545, -0.23523221909999847, -0.10605107247829437, -0.05522848665714264, 0.39463454484939575, 0.23027142882347107, 0.19066232442855835, -0.15509185194969177, 0.016280673444271088, 0.5838767290115356, -0.045924119651317596, -0.0915742963552475, 0.42342591285705566, 0.030922558158636093, -0.04239744320511818, -0.0720352903008461, 0.22800076007843018, 0.24649697542190552, -0.2558157444000244, 0.17331354320049286, 0.1944325864315033, 0.12794765830039978, 0.12866774201393127, 0.1075998991727829, 0.1013966053724289, 0.13818484544754028, 0.09454303979873657, 0.0036027804017066956, -0.15889737010002136, -0.12155874073505402, -0.3027026057243347, 0.11880314350128174, -0.44343897700309753, 0.12619684636592865, -0.16752076148986816, -0.08477317541837692, -0.17194408178329468, 0.026453403756022453, -0.41407841444015503, -0.21975766122341156, 0.35498079657554626, -0.48378312587738037, -0.060675475746393204, -0.11620410531759262, 0.03176861256361008, -0.2682218551635742, 0.40844765305519104, 0.40607964992523193, -0.1652543842792511, -0.06199239194393158, 0.019985109567642212, -0.3258517384529114, 0.060850732028484344, 0.03191986307501793, -0.0676456168293953, -0.10060715675354004, 0.05302199721336365, 0.14102765917778015, 0.26572084426879883, 0.044774964451789856, 0.014324948191642761, 0.13196399807929993, 0.13543206453323364, -0.2930595874786377, 0.0680946409702301, 0.21668539941310883, 0.10182226449251175, -0.11598744988441467, -0.19727182388305664, 0.15890997648239136, -0.08336463570594788, 0.012414172291755676, 0.09517509490251541, -0.23408447206020355, -0.11320231854915619, -0.3145553469657898, 0.39919543266296387, 0.04718124866485596, 0.3225070536136627, -0.13410086929798126, -0.40765565633773804, -0.26976874470710754, 0.020946722477674484, -0.14168134331703186, -0.1153295487165451, -0.010908203199505806, 0.6464263200759888, -0.21705147624015808, 0.11016318947076797, -0.14467667043209076, 0.11094224452972412, -0.011781133711338043, 0.10742998123168945, -0.16150029003620148, -0.04757193848490715, -0.24389515817165375, -0.08857570588588715, 0.33640146255493164, 0.1714654117822647, -0.12442620098590851, -0.09733295440673828, -0.2379302680492401, -0.09137292951345444, 0.4710690379142761, -0.42069607973098755, -0.4503503441810608, 0.19535502791404724, -0.07821022719144821, 0.35811692476272583, 0.2726837396621704, 0.0188768208026886, 0.008579984307289124, 0.1706428825855255, -0.004201279953122139, 0.09876087307929993, 0.24602589011192322, -0.17151440680027008, -0.30299773812294006, -0.03334749862551689, -0.14597268402576447, -0.03529214859008789, 0.04195412993431091, 0.05209667980670929, -0.225336492061615 ]
https://github.com/huggingface/datasets/issues/5888
One issue here is that Dataset.from_generator can work well for the non 'infinite sampling' version of the dataset. The training set for example is often sampled dynamically given the video files that I have uploaded. I worry that storing the video data as binary means that I'll end up duplicating a lot of the data. Furthermore, storing video data as anything but .mp4 would quickly make the dataset size from 1.9TB to 1PB.
A way to upload and visualize .mp4 files (millions of them) as part of a dataset
**Is your feature request related to a problem? Please describe.** I recently chose to use huggingface hub as the home for a large multi modal dataset I've been building. https://huggingface.co/datasets/Antreas/TALI It combines images, text, audio and video. Now, I could very easily upload a dataset made via datasets.Dataset.from_generator, as long as it did not include video files. I found that including .mp4 files in the entries would not auto-upload those files. Hence I tried to upload them myself. I quickly found out that uploading many small files is a very bad way to use git lfs, and that it would take ages, so, I resorted to using 7z to pack them all up. But then I had a new problem. My dataset had a size of 1.9TB. Trying to upload such a large file with the default huggingface_hub API always resulted in time outs etc. So I decided to split the large files into chunks of 5GB each and reupload. So, eventually it all worked out. But now the dataset can't be properly and natively used by the datasets API because of all the needed preprocessing -- and furthermore the hub is unable to visualize things. **Describe the solution you'd like** A native way to upload large datasets that include .mp4 or other video types. **Describe alternatives you've considered** Already explained earlier **Additional context** https://huggingface.co/datasets/Antreas/TALI
73
A way to upload and visualize .mp4 files (millions of them) as part of a dataset **Is your feature request related to a problem? Please describe.** I recently chose to use huggingface hub as the home for a large multi modal dataset I've been building. https://huggingface.co/datasets/Antreas/TALI It combines images, text, audio and video. Now, I could very easily upload a dataset made via datasets.Dataset.from_generator, as long as it did not include video files. I found that including .mp4 files in the entries would not auto-upload those files. Hence I tried to upload them myself. I quickly found out that uploading many small files is a very bad way to use git lfs, and that it would take ages, so, I resorted to using 7z to pack them all up. But then I had a new problem. My dataset had a size of 1.9TB. Trying to upload such a large file with the default huggingface_hub API always resulted in time outs etc. So I decided to split the large files into chunks of 5GB each and reupload. So, eventually it all worked out. But now the dataset can't be properly and natively used by the datasets API because of all the needed preprocessing -- and furthermore the hub is unable to visualize things. **Describe the solution you'd like** A native way to upload large datasets that include .mp4 or other video types. **Describe alternatives you've considered** Already explained earlier **Additional context** https://huggingface.co/datasets/Antreas/TALI One issue here is that Dataset.from_generator can work well for the non 'infinite sampling' version of the dataset. The training set for example is often sampled dynamically given the video files that I have uploaded. I worry that storing the video data as binary means that I'll end up duplicating a lot of the data. Furthermore, storing video data as anything but .mp4 would quickly make the dataset size from 1.9TB to 1PB.
[ -0.5850050449371338, -0.2102893590927124, -0.005259759724140167, 0.06007194519042969, 0.36151573061943054, -0.00783511996269226, -0.031745921820402145, 0.39905303716659546, -0.24006810784339905, 0.1267910748720169, -0.04619826003909111, 0.14087602496147156, -0.4736241400241852, 0.6762345433235168, 0.05692052096128464, -0.17031222581863403, 0.06620332598686218, 0.3117648661136627, -0.012560416013002396, 0.22291001677513123, 0.02262791246175766, -0.29281285405158997, 0.30399376153945923, -0.21218180656433105, -0.5728344321250916, -0.1237412691116333, -0.12607692182064056, 0.16918817162513733, -0.12856842577457428, -0.32598426938056946, -0.3220570981502533, 0.03921375423669815, 0.6473527550697327, 0.5661416053771973, -0.00011868638102896512, -0.28312134742736816, 0.347019225358963, -0.18477123975753784, -0.2802858352661133, 0.031293950974941254, -0.056817129254341125, -0.2564217746257782, 0.053819440305233, 0.020404517650604248, 0.07750672101974487, -0.4863441586494446, 0.21710601449012756, -0.423238605260849, 0.12276111543178558, -0.35257261991500854, 0.05953393131494522, 0.12683191895484924, -0.1484346091747284, 0.1448124647140503, 0.062472570687532425, 0.7160095572471619, -0.24683630466461182, 0.021192632615566254, 0.5869375467300415, 0.04707597941160202, -0.06777822226285934, 0.1167953759431839, 0.2289544641971588, -0.2828019857406616, 0.5146538019180298, -0.13269732892513275, 0.08318192511796951, -0.4487241506576538, -0.09993487596511841, 0.35231298208236694, 0.5633856654167175, -0.08824960887432098, -0.5793523788452148, -0.30939099192619324, 0.11792504787445068, -0.13637776672840118, -0.075685515999794, 0.41933923959732056, -0.22267001867294312, 0.22760483622550964, -0.3086540400981903, -0.12573936581611633, -0.33790674805641174, 0.29671865701675415, 0.19133605062961578, -0.5358651280403137, -0.03371882438659668, -0.001089027151465416, 0.16180768609046936, -0.2484704852104187, 0.02532796561717987, -0.1804858297109604, 0.40970543026924133, 0.03785660117864609, -0.005057965405285358, -0.25534579157829285, -0.13070891797542572, 0.44776642322540283, 0.09820707142353058, 0.10180199891328812, -0.04130368307232857, 0.1716364622116089, -0.6085109710693359, 0.1006346046924591, 0.1405966579914093, -0.08130023628473282, -0.012130491435527802, -0.32210856676101685, 0.39709049463272095, 0.2637881338596344, -0.10051450878381729, -0.06923441588878632, -0.3197000026702881, 0.019077222794294357, -0.3956521153450012, -0.030380740761756897, -0.003921873867511749, 0.07256223261356354, -0.1448056548833847, -0.19151481986045837, -0.35932767391204834, 0.1753804087638855, 0.015349116176366806, 0.08331608027219772, -0.17708809673786163, 0.29739853739738464, -0.3264046907424927, 0.28644615411758423, 0.10011087357997894, -0.5837735533714294, 0.01886710524559021, 0.036747388541698456, -0.30741360783576965, 0.4360181987285614, 0.13583776354789734, -0.2880280613899231, -0.052743855863809586, -0.013205360621213913, 0.4102667272090912, 0.22424089908599854, 0.10456903278827667, -0.14114828407764435, 0.12098631262779236, 0.08058003336191177, -0.05916351079940796, 0.1160406842827797, 0.06322360038757324, 0.1406075656414032, -0.14921583235263824, 0.0845581591129303, 0.09289118647575378, -0.3880564570426941, -0.18919873237609863, -0.010349336080253124, -0.19352222979068756, 0.12013644725084305, -0.46972575783729553, 0.22094985842704773, -0.2807156443595886, -0.14993128180503845, -0.10764375329017639, 0.1283314824104309, 0.12329279631376266, -0.33477121591567993, -0.0845923200249672, 0.5280044674873352, -0.43125978112220764, 0.16033883392810822, -0.2813059985637665, 0.10714920610189438, 0.16770684719085693, 0.2492285668849945, -0.04883921518921852, 0.047787830233573914, -0.17239247262477875, -0.01814405620098114, 0.21013620495796204, -0.5966138243675232, -0.004286203533411026, 0.423511266708374, 0.0023760944604873657, 0.4355650544166565, 0.2367267608642578, 0.36389607191085815, -0.010112214833498001, -0.25630488991737366, 0.20927873253822327, 0.37870022654533386, -0.05792444944381714, -0.08755922317504883, -0.07970786094665527, -0.6616957187652588, -0.039810746908187866, 0.22549951076507568, -0.011678045615553856, -0.021971531212329865, 0.2549223303794861, -0.2674386203289032, 0.1630512923002243, -0.1964365392923355, 0.5045028924942017, -0.20317897200584412, 0.34893161058425903, 0.053971048444509506, -0.3354645371437073, -0.4024137258529663, -0.47848835587501526, 0.10466937720775604, -0.11072725057601929, -0.1926446557044983, -0.11650396883487701, -0.31607526540756226, 0.30199384689331055, -0.32250258326530457, -0.02226615697145462, 0.15550784766674042, -0.02862214297056198, 0.15937373042106628, -0.26848065853118896, 0.03677825629711151, -0.44336870312690735, 0.11042670160531998, 0.02632077783346176, 0.034617017954587936, 0.00403895229101181, 0.3571982681751251, 0.25340205430984497, -0.19250114262104034, -0.02877938002347946, 0.13594123721122742, 0.11686183512210846, -0.11178221553564072, 0.16001632809638977, 0.03498305752873421, -0.09163153171539307, 0.38898131251335144, 0.3518106937408447, 0.6949028968811035, 0.4046054482460022, -0.291116327047348, 0.2186686396598816, -0.19910259544849396, 0.04621858894824982, -0.05501660704612732, -0.11096495389938354, 0.17896610498428345, -0.2398757040500641, -0.004608429968357086, 0.20691464841365814, 0.018891744315624237, 0.009925499558448792, 0.16515254974365234, -0.2207561433315277, -0.19349518418312073, -0.032656483352184296, 0.21296213567256927, 0.1492776870727539, -0.1687144786119461, -0.16953352093696594, 0.04153982922434807, 0.4423404932022095, -0.08780387043952942, -0.13018479943275452, 0.14767470955848694, -0.36469489336013794, -0.003209918737411499, 0.19466601312160492, -0.009341202676296234, 0.1817847490310669, 0.22598089277744293, -0.06140564754605293, -0.15574322640895844, 0.3417574465274811, -0.0731307789683342, -0.09141302108764648, 0.16147567331790924, 0.0964430570602417, 0.2651749849319458, 0.17854629456996918, 0.1462068259716034, -0.06398506462574005, -0.12496252357959747, 0.20566141605377197, -0.19008059799671173, -0.0006885305047035217, -0.05661390349268913, -0.31083494424819946, -0.03953215479850769, 0.158243328332901, -0.4779820144176483, -0.1501481831073761, -0.03555327653884888, 0.07603789120912552, 0.2692497968673706, -0.17562276124954224, 0.09330366551876068, 0.23357658088207245, 0.6353940963745117, -0.11834053695201874, -0.29835546016693115, 0.021453440189361572, 0.2201717495918274, 0.09014815092086792, 0.045741207897663116, 0.48638617992401123, -0.058549124747514725, 0.25786668062210083, -0.0525531992316246, 0.3319941759109497, -0.6973132491111755, -0.098850779235363, 0.21593578159809113, 0.20809680223464966, 0.3494596481323242, -0.11137163639068604, 0.11709679663181305, 0.13807272911071777, 0.005755417048931122, -0.06003261357545853, -0.06200568377971649, 0.13822096586227417, -0.21364375948905945, 0.02658556029200554, 0.11995118856430054, -0.03823716938495636, 0.26964932680130005, -0.4225798547267914, -0.6915693879127502, 0.5200096964836121, 0.13203468918800354, -0.015612246468663216, 0.044847920536994934, 0.33201754093170166, 0.07878031581640244, -0.016236865893006325, -0.045492008328437805, 0.10427078604698181, -0.23902474343776703, 0.17349189519882202, -0.30676528811454773, -0.3411841094493866, 0.125839501619339, -0.006314225494861603, -0.16413956880569458, 0.2709079086780548, -0.22072333097457886, -0.3330998420715332, -0.04291157424449921, 0.40088048577308655, -0.021518172696232796, 0.02279127947986126, 0.006542317569255829, -0.01811106875538826, 0.031299740076065063, -0.021438300609588623, 0.07840923964977264, -0.09675873070955276, 0.35361748933792114, 0.06813516467809677, 0.2214723527431488, 0.0516367144882679, 0.19826765358448029, 0.7379227876663208, 0.3122721314430237, -0.3153044283390045, 0.4122680127620697, 0.10547009110450745, 0.384637713432312, -0.12430061399936676, -0.08055058121681213, 0.07980963587760925, -0.3844706416130066, 0.11325928568840027, 0.2990954518318176, 0.2333555519580841, 0.11883864551782608, 0.050318554043769836, 0.19889748096466064, -0.09755358844995499, 0.08290612697601318, 0.22395934164524078, -0.06468169391155243, 0.04074839502573013, -0.21719218790531158, -0.44929641485214233, -0.32143107056617737, -0.24226349592208862, 0.23230789601802826, 0.4712179899215698, 0.383075088262558, 0.009785588830709457, -0.14364762604236603, -0.004866946488618851, -0.05789360776543617, 0.3535267114639282, 0.2641488313674927, -0.1192084476351738, -0.04711437225341797, -0.23674671351909637, -0.004760947078466415, 0.03505280986428261, 0.7033109664916992, -0.3493768274784088, -0.3011375665664673, -0.10293212532997131, -0.16090324521064758, -0.08341845124959946, 0.08267255127429962, -0.08079314976930618, 0.07736306637525558, 0.12932059168815613, 0.6616997718811035, 0.034160152077674866, -0.09123699367046356, -0.42475494742393494, 0.4575672745704651, 0.247002512216568, -0.18091800808906555, 0.06821539998054504, 0.31882548332214355, -0.5978841185569763, -0.43192464113235474, 0.25299760699272156, -0.1350492537021637, -0.12788797914981842, -0.3312763273715973, 0.1060948297381401, -0.008600488305091858, 0.33021068572998047, -0.11206068098545074, 0.11792135238647461, 0.06179392710328102, 0.021880634129047394, 0.029329512268304825, 0.2220541387796402, 0.6526120901107788, 0.4648689031600952, 0.07594658434391022, 0.012880995869636536, 0.2930324077606201, 0.005100715905427933, 0.2505297064781189, 0.490146279335022, 0.2766079306602478, 0.14512285590171814, -0.07960771769285202, 0.19606488943099976, -0.6657135486602783, 0.40925630927085876, 0.3947398066520691, -0.41491809487342834, -0.22924965620040894, -0.2293224036693573, 0.6476746797561646, -0.01091807335615158, 0.0765867829322815, 0.253817081451416, 0.5224096179008484, 0.031062178313732147, -0.14963433146476746, 0.13794177770614624, 1.0851011276245117, -0.054816145449876785, 0.41882017254829407, -0.24641884863376617, 0.06789971888065338, 0.30355340242385864, -0.5846067667007446, -0.03804297372698784, -0.19935794174671173, -0.22201962769031525, -0.14186985790729523, -0.05242663621902466, 0.12905004620552063, 0.11611032485961914, -0.1429155170917511, -0.029619794338941574, 0.09220632910728455, 0.23002511262893677, -0.1815519779920578, 0.25207656621932983, -0.40558522939682007, -0.31126275658607483, -0.3569740653038025, 0.05451420694589615, 0.028156345710158348, 0.016828278079628944, -0.08343543112277985, -0.27425307035446167, -0.11940039694309235, 0.297290563583374, -0.3107169270515442, -0.12345801293849945, -0.07045804709196091, -0.04845176264643669, 0.1182941198348999, 0.12280331552028656, 0.23662430047988892, -0.04415571317076683, -0.025757279247045517, -0.012617991305887699, -0.23530849814414978, 0.03561900928616524, -0.2053738534450531, 0.194269061088562, -0.1471150815486908, -0.21346108615398407, 0.596664309501648, -0.14817675948143005, -0.005529388785362244, 0.32816848158836365, 0.13366931676864624, -0.06347335875034332, -0.11302424967288971, -0.07831920683383942, 0.14956101775169373, 0.020740527659654617, -0.24707910418510437, -0.13666090369224548, 0.018932193517684937, 0.03762795776128769, -0.053148455917835236, 0.2704758048057556, 0.05739663913846016, 0.07344570755958557, 0.2230764478445053, 0.11435429751873016, -0.17622362077236176, 0.10958170890808105, -0.2886543273925781, -0.30572283267974854, 0.018088024109601974, 0.22178950905799866, -0.08044857531785965, -0.010571636259555817, 0.5232092142105103, 0.08706643432378769, -0.22767361998558044, -0.012729685753583908, 0.24942857027053833, -0.1382729858160019, 0.006727956235408783, -0.013190412893891335, 0.2978196144104004, -0.15613141655921936, -0.13133776187896729, -0.14830584824085236, -0.5263502597808838, 0.18072937428951263, -0.23252470791339874, 0.26233696937561035, -0.24426019191741943, -0.08695399761199951, 0.03652755916118622, 0.09518418461084366, -0.19740739464759827, 0.1543537676334381, 0.10774129629135132, 0.12546834349632263, -0.030478673055768013, -0.074177086353302, -0.01397174596786499, 0.08901473879814148, -0.1133115291595459, -0.07673288881778717, -0.4254379868507385, 0.01280944049358368, -0.25180956721305847, 0.2288428246974945, 0.3371972143650055, -0.1035279780626297, 0.1992207169532776, -0.11290094256401062, -0.20617978274822235, -0.2322857677936554, 0.19587530195713043, -0.13962654769420624, -0.06325585395097733, -0.1744413822889328, 0.21036861836910248, -0.14446818828582764, 0.030897408723831177, 0.11370642483234406, 0.33318892121315, 0.4283716678619385, 0.0859384536743164, -0.09455254673957825, -0.030922062695026398, -0.07949632406234741, -0.11749288439750671, 0.22298020124435425, 0.1999826282262802, 0.1766197681427002, 0.3825809955596924, 0.0533030703663826, 0.15385842323303223, -0.06703560054302216, 0.22098124027252197, 0.0014787139371037483, -0.0769711434841156, 0.09329507499933243, 0.36120307445526123, 0.10202981531620026, 0.04502525180578232, 0.010457780212163925, 0.12306377291679382, -0.23329408466815948, 0.2874729037284851, 0.14973106980323792, 0.32163870334625244, 0.1980486512184143, -0.06023179367184639, -0.24393221735954285, 0.000506572425365448, 0.053094517439603806, 0.13869953155517578, 0.23753933608531952, -0.011447839438915253, 0.13835053145885468, 0.002202160656452179, 0.3661998510360718, 0.14354661107063293, 0.5256693959236145, -0.5016905665397644, -0.00612102635204792, 0.058163806796073914, -0.3355243504047394, 0.21659275889396667, -0.49832335114479065, -0.10502070933580399, 0.3988806903362274, 0.2943883538246155, 0.3339524269104004, 0.04126492142677307, 0.07795795798301697, -0.12006029486656189, -0.10430106520652771, -0.22941415011882782, 0.21825145184993744, 0.28680506348609924, 0.09338483214378357, 0.04526054114103317, -0.2469288408756256, -0.423373818397522, 0.16645313799381256, -0.2023766040802002, -0.08595436811447144, -0.00898035243153572, 0.36636045575141907, 0.16759711503982544, 0.09177030622959137, -0.13742047548294067, 0.017134491354227066, 0.5254424214363098, -0.11345206946134567, -0.17086829245090485, 0.49822142720222473, 0.13377217948436737, 0.05550522357225418, -0.0922381579875946, 0.20597809553146362, 0.31703341007232666, -0.18131312727928162, 0.1849707067012787, 0.04678606986999512, 0.12406835705041885, 0.09664583951234818, 0.08678571879863739, 0.16811856627464294, 0.21572431921958923, 0.12366484850645065, -0.04468078911304474, -0.13449157774448395, -0.03567536175251007, -0.29398298263549805, 0.21786439418792725, -0.5783935189247131, 0.11816680431365967, -0.1250985711812973, -0.027750901877880096, -0.18467757105827332, -0.001570429652929306, -0.41614148020744324, -0.11534050107002258, 0.37173277139663696, -0.532270073890686, -0.05151957646012306, -0.05818137526512146, 0.007143158465623856, -0.3095228970050812, 0.2842444181442261, 0.4633136987686157, -0.1967892348766327, -0.038357220590114594, 0.042773425579071045, -0.2887439727783203, -0.022896774113178253, 0.04917978122830391, -0.04466657713055611, -0.20221541821956635, 0.032130464911460876, 0.20044076442718506, 0.23131385445594788, 0.08307868987321854, -0.08251555263996124, 0.18759360909461975, 0.10719098150730133, -0.28739896416664124, -0.04472225531935692, 0.10260841250419617, 0.22738060355186462, -0.14538267254829407, -0.20034462213516235, 0.0780806690454483, -0.21510715782642365, -0.02848641201853752, 0.038653433322906494, -0.2513195276260376, -0.11526986956596375, -0.20709127187728882, 0.4406272768974304, 0.09647990018129349, 0.3311343789100647, -0.08784914016723633, -0.4682419002056122, -0.2401980459690094, 0.07622011005878448, -0.18080361187458038, -0.18372595310211182, 0.018041033297777176, 0.7149167060852051, -0.29822006821632385, 0.21797779202461243, -0.15986594557762146, 0.1898345947265625, 0.016626648604869843, 0.009220689535140991, -0.17920756340026855, -0.08884381502866745, -0.3015138506889343, -0.11705601215362549, 0.43549826741218567, 0.20534808933734894, -0.1343637853860855, -0.16901175677776337, -0.2567811608314514, 0.026635058224201202, 0.47857043147087097, -0.5133468508720398, -0.45075559616088867, 0.1800132393836975, -0.0830981433391571, 0.28920772671699524, 0.24099770188331604, -0.005369424819946289, 0.011125177145004272, 0.20284655690193176, 0.04545608535408974, 0.18468192219734192, 0.27031540870666504, -0.18195375800132751, -0.2715975046157837, -0.033943790942430496, -0.10112439095973969, -0.041511014103889465, -0.043033286929130554, 0.04741892218589783, -0.27817243337631226 ]
https://github.com/huggingface/datasets/issues/5888
> storing video data as anything but .mp4 What I mean by storing as `datasets.Value("binary")` is embedding raw MP4 bytes in the Arrow table, but, indeed, this would waste a lot of space if there are duplicates. So I see two options: * if one video is not mapped to too many samples, you can embed the video bytes and do "group by" on the rest of the columns (this would turn them into lists) to avoid duplicating them (then, it should be easy to define a `map` in the README that samples the video data to "unpack" the samples) * you can create a dataset script that downloads the video files and embeds their file paths into the Arrow file Also, I misread MP4 as MP3. We need to add a `Video` feature to the `datasets` lib to support MP4 files in the viewer (a bit trickier to implement than the `Image` feature due to the Arrow limitations).
A way to upload and visualize .mp4 files (millions of them) as part of a dataset
**Is your feature request related to a problem? Please describe.** I recently chose to use huggingface hub as the home for a large multi modal dataset I've been building. https://huggingface.co/datasets/Antreas/TALI It combines images, text, audio and video. Now, I could very easily upload a dataset made via datasets.Dataset.from_generator, as long as it did not include video files. I found that including .mp4 files in the entries would not auto-upload those files. Hence I tried to upload them myself. I quickly found out that uploading many small files is a very bad way to use git lfs, and that it would take ages, so, I resorted to using 7z to pack them all up. But then I had a new problem. My dataset had a size of 1.9TB. Trying to upload such a large file with the default huggingface_hub API always resulted in time outs etc. So I decided to split the large files into chunks of 5GB each and reupload. So, eventually it all worked out. But now the dataset can't be properly and natively used by the datasets API because of all the needed preprocessing -- and furthermore the hub is unable to visualize things. **Describe the solution you'd like** A native way to upload large datasets that include .mp4 or other video types. **Describe alternatives you've considered** Already explained earlier **Additional context** https://huggingface.co/datasets/Antreas/TALI
159
A way to upload and visualize .mp4 files (millions of them) as part of a dataset **Is your feature request related to a problem? Please describe.** I recently chose to use huggingface hub as the home for a large multi modal dataset I've been building. https://huggingface.co/datasets/Antreas/TALI It combines images, text, audio and video. Now, I could very easily upload a dataset made via datasets.Dataset.from_generator, as long as it did not include video files. I found that including .mp4 files in the entries would not auto-upload those files. Hence I tried to upload them myself. I quickly found out that uploading many small files is a very bad way to use git lfs, and that it would take ages, so, I resorted to using 7z to pack them all up. But then I had a new problem. My dataset had a size of 1.9TB. Trying to upload such a large file with the default huggingface_hub API always resulted in time outs etc. So I decided to split the large files into chunks of 5GB each and reupload. So, eventually it all worked out. But now the dataset can't be properly and natively used by the datasets API because of all the needed preprocessing -- and furthermore the hub is unable to visualize things. **Describe the solution you'd like** A native way to upload large datasets that include .mp4 or other video types. **Describe alternatives you've considered** Already explained earlier **Additional context** https://huggingface.co/datasets/Antreas/TALI > storing video data as anything but .mp4 What I mean by storing as `datasets.Value("binary")` is embedding raw MP4 bytes in the Arrow table, but, indeed, this would waste a lot of space if there are duplicates. So I see two options: * if one video is not mapped to too many samples, you can embed the video bytes and do "group by" on the rest of the columns (this would turn them into lists) to avoid duplicating them (then, it should be easy to define a `map` in the README that samples the video data to "unpack" the samples) * you can create a dataset script that downloads the video files and embeds their file paths into the Arrow file Also, I misread MP4 as MP3. We need to add a `Video` feature to the `datasets` lib to support MP4 files in the viewer (a bit trickier to implement than the `Image` feature due to the Arrow limitations).
[ -0.4535922706127167, -0.24104151129722595, -0.012991730123758316, 0.10514369606971741, 0.2978488802909851, 0.05627821385860443, 0.04497167095541954, 0.37738701701164246, -0.08680988848209381, 0.045615751296281815, -0.14527669548988342, 0.15140065550804138, -0.40434205532073975, 0.6011254787445068, 0.06721608340740204, -0.1185566633939743, 0.12270016223192215, 0.37942105531692505, 0.07112319022417068, 0.20861707627773285, 0.024043656885623932, -0.3060983121395111, 0.295973002910614, -0.25705593824386597, -0.6106414794921875, -0.051161035895347595, -0.1455577313899994, 0.08571882545948029, -0.04100480675697327, -0.31495964527130127, -0.3302808105945587, 0.06634948402643204, 0.56679767370224, 0.6013662815093994, -0.00011676648136926815, -0.3241623044013977, 0.24035722017288208, -0.20623400807380676, -0.288993775844574, 0.05802660435438156, -0.10709724575281143, -0.31420138478279114, 0.11080096662044525, 0.028213605284690857, 0.06977938115596771, -0.5402426719665527, 0.21518008410930634, -0.5095131397247314, 0.046235352754592896, -0.40562954545021057, 0.06144469976425171, 0.09963169693946838, -0.19118651747703552, 0.2346288561820984, 0.17291757464408875, 0.6439545750617981, -0.2851918041706085, 0.05500276759266853, 0.6222867965698242, 0.10117310285568237, -0.14724163711071014, 0.13715752959251404, 0.25358492136001587, -0.23135221004486084, 0.492819219827652, -0.034164611250162125, 0.03869860619306564, -0.43919438123703003, -0.17864039540290833, 0.27710849046707153, 0.5433225035667419, -0.10220733284950256, -0.589390218257904, -0.323903352022171, 0.08958099037408829, -0.16871899366378784, -0.05909346044063568, 0.37676844000816345, -0.07005631178617477, 0.22905156016349792, -0.2576761245727539, -0.012583423405885696, -0.3406282961368561, 0.3299664556980133, 0.22251489758491516, -0.47871479392051697, -0.026769526302814484, -0.027352798730134964, 0.1517617404460907, -0.29548314213752747, -0.032189756631851196, -0.18370462954044342, 0.41734734177589417, 0.09646950662136078, -0.0897718220949173, -0.2533876895904541, -0.1517874002456665, 0.4708276391029358, 0.10035492479801178, 0.06649000942707062, -0.010680368170142174, 0.24722781777381897, -0.5664892792701721, 0.17007754743099213, 0.08101896941661835, -0.027421899139881134, -0.04781574383378029, -0.3143484592437744, 0.4135710895061493, 0.3182884156703949, -0.06670155376195908, -0.0965423434972763, -0.261417031288147, 0.05151746794581413, -0.38552725315093994, 0.013369984924793243, 0.056639403104782104, 0.06914626806974411, -0.20441485941410065, -0.10901257395744324, -0.32940515875816345, 0.14494089782238007, 0.10949449241161346, 0.11905819177627563, -0.1532992720603943, 0.3006139099597931, -0.30374830961227417, 0.23831188678741455, 0.12359195202589035, -0.5179060101509094, 0.035932719707489014, 0.00814063474535942, -0.27430808544158936, 0.4449938237667084, 0.18738234043121338, -0.3210495114326477, -0.0568733811378479, -0.0070663802325725555, 0.47814327478408813, 0.11761611700057983, 0.0704374611377716, -0.1755928099155426, 0.16345591843128204, 0.106496661901474, -0.05456672981381416, 0.1498039960861206, 0.08208025991916656, 0.15039151906967163, -0.12368425726890564, 0.06541737914085388, 0.03521054983139038, -0.3742697834968567, -0.17326165735721588, -0.01949954777956009, -0.15408407151699066, 0.1248532235622406, -0.503254234790802, 0.23126274347305298, -0.3058405816555023, -0.13443239033222198, -0.09937161952257156, 0.30258089303970337, 0.06944780051708221, -0.39875978231430054, -0.06789061427116394, 0.4626603126525879, -0.4195365309715271, 0.11444300413131714, -0.2838777005672455, 0.16380678117275238, 0.06665829569101334, 0.2969072163105011, -0.028349295258522034, -0.03116108477115631, -0.15810410678386688, 0.11645294725894928, 0.16048485040664673, -0.6392145156860352, -0.04339428246021271, 0.4197135865688324, 0.04184380918741226, 0.44416654109954834, 0.19655928015708923, 0.44693490862846375, 0.0638059452176094, -0.33433961868286133, 0.19897498190402985, 0.31468626856803894, -0.0824812576174736, -0.03036753460764885, -0.0693286806344986, -0.6636361479759216, 0.02329900488257408, 0.1421354115009308, -0.10246243327856064, -0.1367609202861786, 0.21289503574371338, -0.31597667932510376, 0.19272390007972717, -0.19183753430843353, 0.4991169571876526, -0.19767433404922485, 0.414938360452652, 0.10035936534404755, -0.29380908608436584, -0.34074780344963074, -0.5623340606689453, 0.17262762784957886, -0.034366175532341, -0.2475312352180481, -0.14433825016021729, -0.3925446569919586, 0.2623708248138428, -0.331650048494339, -0.06515975296497345, 0.18986713886260986, 0.010295301675796509, 0.10914114117622375, -0.3882179260253906, -0.08117925375699997, -0.4302012026309967, 0.13690882921218872, 0.08629727363586426, -0.01469886302947998, -0.011575520038604736, 0.40812522172927856, 0.16335038840770721, -0.13368374109268188, 0.01738794893026352, 0.18028169870376587, 0.15829840302467346, -0.12987838685512543, 0.23949706554412842, 0.12295091897249222, -0.05907886475324631, 0.4182790517807007, 0.3617357313632965, 0.6693261861801147, 0.46780866384506226, -0.24449513852596283, 0.15523047745227814, -0.13653191924095154, 0.10383294522762299, -0.07953627407550812, -0.18048323690891266, 0.1808490753173828, -0.21486832201480865, -0.03442700579762459, 0.14574119448661804, -0.0179869644343853, 0.030456088483333588, 0.2256731241941452, -0.26689407229423523, -0.30720824003219604, -0.06404843926429749, 0.2037656307220459, 0.12460008263587952, -0.08398444950580597, -0.09853540360927582, 0.1559767872095108, 0.442954421043396, -0.04137370362877846, -0.04594084247946739, 0.1259109228849411, -0.3032432496547699, 0.012470342218875885, 0.2052428424358368, -0.06804768741130829, 0.21273960173130035, 0.2194831371307373, -0.0671040266752243, -0.1897839605808258, 0.3038906455039978, -0.039673224091529846, -0.07512091100215912, 0.2189951241016388, 0.10329809784889221, 0.24384117126464844, 0.22797323763370514, 0.13425633311271667, -0.05073462054133415, -0.11496612429618835, 0.21119442582130432, -0.1867082417011261, -0.03687868267297745, -0.11047546565532684, -0.40990573167800903, -0.01229788362979889, 0.23291228711605072, -0.48680341243743896, -0.18516042828559875, -0.039102405309677124, 0.16484960913658142, 0.22750252485275269, -0.20351585745811462, 0.15519940853118896, 0.2506229281425476, 0.653468906879425, -0.17244061827659607, -0.2308976650238037, -0.057293303310871124, 0.20412778854370117, 0.11670201271772385, 0.052805572748184204, 0.49129873514175415, -0.02358674630522728, 0.33162206411361694, -0.023244619369506836, 0.3491448760032654, -0.7876207828521729, -0.13590650260448456, 0.22076034545898438, 0.05344412848353386, 0.32272663712501526, -0.1623784303665161, 0.13214439153671265, 0.0037350356578826904, -0.03604515641927719, -0.035847604274749756, -0.07433459162712097, 0.0734035074710846, -0.22047190368175507, 0.0632869228720665, 0.0955902636051178, -0.03950593248009682, 0.1940804272890091, -0.3502219319343567, -0.6929930448532104, 0.5312934517860413, 0.15540793538093567, 0.03786880522966385, -0.0892195776104927, 0.29940223693847656, 0.08944474905729294, 0.03524351865053177, -0.057178229093551636, 0.008521590381860733, -0.18362902104854584, 0.2231057584285736, -0.3397708535194397, -0.3568017780780792, 0.22150082886219025, 0.0501716285943985, -0.18464674055576324, 0.24138899147510529, -0.14736689627170563, -0.32284167408943176, -0.022947147488594055, 0.31924858689308167, 0.07170205563306808, 0.004062630236148834, 0.055642399936914444, 0.07201649248600006, 0.005704157054424286, -0.05381303280591965, 0.0023048073053359985, -0.14427848160266876, 0.3915465176105499, 0.08037453144788742, 0.21383152902126312, 0.08328273892402649, 0.2512773275375366, 0.6650372743606567, 0.38629281520843506, -0.28569409251213074, 0.42437276244163513, 0.10198649764060974, 0.40925830602645874, -0.11079931259155273, -0.052938420325517654, -0.008438881486654282, -0.36554154753685, 0.1747865378856659, 0.4273260831832886, 0.22054556012153625, 0.08891165256500244, 0.056171491742134094, 0.1690676212310791, -0.13266238570213318, 0.039909809827804565, 0.26014891266822815, -0.10697690397500992, 0.02519470825791359, -0.27110913395881653, -0.5788390636444092, -0.3147660493850708, -0.23731137812137604, 0.1987960934638977, 0.49109864234924316, 0.36778226494789124, -0.014890555292367935, -0.050870224833488464, -0.0036631934344768524, -0.08277818560600281, 0.3831349015235901, 0.2684541940689087, -0.03458492085337639, -0.035722725093364716, -0.18609395623207092, 0.02316894941031933, 0.06482170522212982, 0.5780613422393799, -0.35983672738075256, -0.30561599135398865, -0.15403106808662415, -0.07730346918106079, -0.15752987563610077, 0.10767985135316849, -0.12417543679475784, 0.06563732028007507, 0.0924081802368164, 0.644187331199646, -0.04543204605579376, -0.13428357243537903, -0.3953559398651123, 0.4218764007091522, 0.2104075849056244, -0.17007485032081604, -0.04723669961094856, 0.3243701457977295, -0.6268047094345093, -0.4476238489151001, 0.33894082903862, -0.1959737241268158, -0.03592396154999733, -0.32410794496536255, 0.07539080083370209, -0.08832639455795288, 0.3493541479110718, -0.11470922827720642, 0.1908215582370758, 0.10667154937982559, 0.07252654433250427, 0.0639735758304596, 0.2429409772157669, 0.5662260055541992, 0.4811364412307739, 0.0981898382306099, 0.02416207268834114, 0.2962006628513336, -0.01858270913362503, 0.31202074885368347, 0.5063497424125671, 0.23066793382167816, 0.14396275579929352, -0.11894267052412033, 0.13290321826934814, -0.673834502696991, 0.3112831711769104, 0.38911202549934387, -0.3916659653186798, -0.23785696923732758, -0.10665227472782135, 0.6552383899688721, -0.0006555914878845215, 0.0003537386655807495, 0.22823089361190796, 0.6097299456596375, -0.03145473450422287, -0.06889761984348297, 0.17115193605422974, 1.1123675107955933, -0.13923139870166779, 0.4569215178489685, -0.20160497725009918, 0.035392291843891144, 0.22032049298286438, -0.5449198484420776, -0.019023893401026726, -0.20265117287635803, -0.24452172219753265, -0.19083935022354126, 0.010798804461956024, 0.1326899230480194, 0.11591966450214386, -0.2160983681678772, -0.015657559037208557, 0.06532031297683716, 0.27588915824890137, -0.23667070269584656, 0.1856960654258728, -0.3542473614215851, -0.37071433663368225, -0.3866467773914337, 0.06874941289424896, 0.023792464286088943, -0.05059322714805603, -0.07460300624370575, -0.21268072724342346, -0.19746936857700348, 0.25433459877967834, -0.31973227858543396, -0.2419128119945526, -0.057922039180994034, 0.031181741505861282, 0.03802153095602989, 0.14489203691482544, 0.15771332383155823, -0.12953351438045502, -0.05901360139250755, -0.07227130979299545, -0.22516098618507385, -0.0021622758358716965, -0.22454148530960083, 0.20879468321800232, -0.15845248103141785, -0.24076327681541443, 0.4911388158798218, -0.09236396849155426, -0.010820508003234863, 0.23553943634033203, 0.17334002256393433, -0.09864625334739685, -0.12453264743089676, 0.03241610527038574, 0.10886617749929428, -0.026815874502062798, -0.32014405727386475, -0.13879840075969696, -0.11791375279426575, 0.06893602013587952, -0.029363542795181274, 0.2201482504606247, 0.022683512419462204, 0.13397783041000366, 0.19751963019371033, 0.10949951410293579, -0.16804708540439606, 0.14145663380622864, -0.26221486926078796, -0.3079532980918884, -0.053487472236156464, 0.1818183809518814, -0.13627596199512482, -0.0122271329164505, 0.5106304883956909, 0.14212383329868317, -0.2988022565841675, -0.10454303026199341, 0.17807021737098694, -0.1923569291830063, 0.06518839299678802, -0.025942426174879074, 0.2987603545188904, -0.06655651330947876, -0.10317707061767578, -0.1032036691904068, -0.5380721092224121, 0.3065260648727417, -0.17875590920448303, 0.33516091108322144, -0.30445730686187744, -0.12177203595638275, 0.032910920679569244, 0.14112745225429535, -0.21343234181404114, 0.17771005630493164, 0.029692843556404114, 0.18055692315101624, -0.0709017664194107, -0.04602521285414696, 0.024741552770137787, 0.08109243959188461, -0.08644449710845947, 0.023205440491437912, -0.41835707426071167, 0.019305869936943054, -0.20612919330596924, 0.23231732845306396, 0.32711082696914673, -0.04894104599952698, 0.07923367619514465, -0.11454272270202637, -0.206976518034935, -0.2875366508960724, 0.10658638179302216, -0.0744737833738327, -0.06682034581899643, -0.22355058789253235, 0.3065568506717682, -0.22743013501167297, 0.11169961094856262, 0.08064480870962143, 0.3569142520427704, 0.41232889890670776, 0.11997782438993454, -0.168193519115448, -0.1066049188375473, -0.09092691540718079, -0.023927204310894012, 0.24342021346092224, 0.19214139878749847, 0.21395978331565857, 0.335409939289093, 0.12391798198223114, 0.16220848262310028, -0.050848595798015594, 0.23875409364700317, -0.02551286295056343, -0.09252065420150757, 0.03596654534339905, 0.2992410957813263, 0.0982622504234314, 0.02473337948322296, -0.04714373126626015, 0.15814673900604248, -0.22624464333057404, 0.3304731249809265, 0.20121505856513977, 0.37913140654563904, 0.2604212760925293, -0.049447569996118546, -0.20425915718078613, 0.020793769508600235, -0.016605975106358528, 0.10178874433040619, 0.09074033796787262, -0.03429822623729706, 0.050190314650535583, -0.017281191423535347, 0.3373967707157135, 0.12005540728569031, 0.45559147000312805, -0.5734858512878418, -0.01435473095625639, 0.1437593698501587, -0.32175412774086, 0.24287472665309906, -0.41622740030288696, -0.09115186333656311, 0.41328075528144836, 0.2681341767311096, 0.29370734095573425, 0.13060574233531952, 0.0062726158648729324, -0.05245406553149223, -0.10279925167560577, -0.1149420291185379, 0.17667235434055328, 0.2960529327392578, 0.06915555894374847, 0.14604225754737854, -0.22130368649959564, -0.46553853154182434, 0.061559274792671204, -0.2251889854669571, -0.09224283695220947, 0.05445849522948265, 0.46156302094459534, 0.26244843006134033, 0.02649078145623207, -0.12938739359378815, 0.08904582262039185, 0.6562789678573608, -0.05414826050400734, -0.12297230958938599, 0.4829584062099457, 0.14670133590698242, 0.07830356806516647, -0.1064252108335495, 0.1632404774427414, 0.23363348841667175, -0.16887608170509338, 0.3084249198436737, 0.004544977098703384, 0.1465018093585968, 0.1334945112466812, 0.05483841896057129, 0.11107981204986572, 0.10811217874288559, 0.04021705687046051, -0.022179121151566505, -0.12208560109138489, -0.08461447060108185, -0.2822260558605194, 0.16010573506355286, -0.5251255631446838, 0.1479148268699646, -0.19753800332546234, -0.09691113233566284, -0.11201173812150955, -0.04732779040932655, -0.42680811882019043, -0.18754321336746216, 0.39407312870025635, -0.5550011396408081, 0.026023000478744507, -0.05634712800383568, 0.014965042471885681, -0.264348566532135, 0.2976608872413635, 0.32952821254730225, -0.23220333456993103, -0.12219329178333282, 0.03627042472362518, -0.3539980947971344, -0.00448424369096756, 0.03646024689078331, -0.1124500036239624, -0.13372787833213806, 0.06388973444700241, 0.1625894010066986, 0.25869041681289673, 0.23533561825752258, -0.13114356994628906, 0.2085343599319458, 0.04639390483498573, -0.29737144708633423, 0.00413934700191021, 0.1466071456670761, 0.2083304524421692, -0.12973201274871826, -0.16873213648796082, 0.06739260256290436, -0.1001552939414978, -0.018109958618879318, -0.034076523035764694, -0.23855143785476685, -0.14105090498924255, -0.14662256836891174, 0.3783762753009796, 0.04046960175037384, 0.2499614804983139, -0.12975837290287018, -0.39669081568717957, -0.27111494541168213, 0.026088528335094452, -0.15792252123355865, -0.10242301225662231, 0.06544587016105652, 0.5822179317474365, -0.3087756633758545, 0.19267502427101135, -0.15173086524009705, 0.14411833882331848, 0.0227021723985672, 0.05427946522831917, -0.1561296582221985, 0.013329170644283295, -0.26210522651672363, -0.04371865838766098, 0.3177655041217804, 0.2872299551963806, -0.17604286968708038, -0.08103200793266296, -0.21562622487545013, -0.09095483273267746, 0.4830511510372162, -0.42711204290390015, -0.4098546504974365, 0.21756692230701447, -0.009721986949443817, 0.34288647770881653, 0.3081005811691284, -0.10481037944555283, -0.04906342178583145, 0.20847317576408386, 0.03759859874844551, 0.0648169070482254, 0.2966144382953644, -0.20862983167171478, -0.2926434874534607, -0.07787495851516724, -0.12842711806297302, -0.022958198562264442, 0.04944603145122528, 0.0860774889588356, -0.30071330070495605 ]
https://github.com/huggingface/datasets/issues/5888
@mariosasko Right. If I want my dataset to be streamable, what are the necessary requirements to achieve that within the context of .mp4 binaries like we have here? I guess your second point here would not support that right?
A way to upload and visualize .mp4 files (millions of them) as part of a dataset
**Is your feature request related to a problem? Please describe.** I recently chose to use huggingface hub as the home for a large multi modal dataset I've been building. https://huggingface.co/datasets/Antreas/TALI It combines images, text, audio and video. Now, I could very easily upload a dataset made via datasets.Dataset.from_generator, as long as it did not include video files. I found that including .mp4 files in the entries would not auto-upload those files. Hence I tried to upload them myself. I quickly found out that uploading many small files is a very bad way to use git lfs, and that it would take ages, so, I resorted to using 7z to pack them all up. But then I had a new problem. My dataset had a size of 1.9TB. Trying to upload such a large file with the default huggingface_hub API always resulted in time outs etc. So I decided to split the large files into chunks of 5GB each and reupload. So, eventually it all worked out. But now the dataset can't be properly and natively used by the datasets API because of all the needed preprocessing -- and furthermore the hub is unable to visualize things. **Describe the solution you'd like** A native way to upload large datasets that include .mp4 or other video types. **Describe alternatives you've considered** Already explained earlier **Additional context** https://huggingface.co/datasets/Antreas/TALI
39
A way to upload and visualize .mp4 files (millions of them) as part of a dataset **Is your feature request related to a problem? Please describe.** I recently chose to use huggingface hub as the home for a large multi modal dataset I've been building. https://huggingface.co/datasets/Antreas/TALI It combines images, text, audio and video. Now, I could very easily upload a dataset made via datasets.Dataset.from_generator, as long as it did not include video files. I found that including .mp4 files in the entries would not auto-upload those files. Hence I tried to upload them myself. I quickly found out that uploading many small files is a very bad way to use git lfs, and that it would take ages, so, I resorted to using 7z to pack them all up. But then I had a new problem. My dataset had a size of 1.9TB. Trying to upload such a large file with the default huggingface_hub API always resulted in time outs etc. So I decided to split the large files into chunks of 5GB each and reupload. So, eventually it all worked out. But now the dataset can't be properly and natively used by the datasets API because of all the needed preprocessing -- and furthermore the hub is unable to visualize things. **Describe the solution you'd like** A native way to upload large datasets that include .mp4 or other video types. **Describe alternatives you've considered** Already explained earlier **Additional context** https://huggingface.co/datasets/Antreas/TALI @mariosasko Right. If I want my dataset to be streamable, what are the necessary requirements to achieve that within the context of .mp4 binaries like we have here? I guess your second point here would not support that right?
[ -0.5347316265106201, -0.16878670454025269, -0.02907712012529373, 0.09523332864046097, 0.32893070578575134, 0.07551120221614838, -0.009251018986105919, 0.3191840350627899, -0.28372135758399963, 0.0031201541423797607, -0.054568544030189514, 0.1520635187625885, -0.30519434809684753, 0.661288857460022, 0.019431039690971375, -0.2632823586463928, 0.04261722415685654, 0.3268689811229706, 0.04901552200317383, 0.192987322807312, 0.07438139617443085, -0.2785341739654541, 0.17262136936187744, -0.3079349994659424, -0.5935367941856384, -0.1444702297449112, -0.15226246416568756, 0.2146604210138321, -0.22307389974594116, -0.30448639392852783, -0.30418434739112854, 0.03342325985431671, 0.5213659405708313, 0.5723487734794617, -0.00011407113925088197, -0.33032888174057007, 0.3592761754989624, -0.20610463619232178, -0.3304116427898407, -0.003928102552890778, -0.09591077268123627, -0.24968522787094116, 0.17690005898475647, 0.036541327834129333, 0.014239184558391571, -0.46920302510261536, 0.19738973677158356, -0.4496152400970459, 0.18153107166290283, -0.2391970455646515, 0.08405621349811554, 0.1525590717792511, -0.09099256992340088, 0.22135800123214722, -0.029196538031101227, 0.6047378778457642, -0.293499231338501, 0.04894234985113144, 0.5313354730606079, 0.13181611895561218, -0.13044658303260803, 0.11923618614673615, 0.2712063193321228, -0.1552305817604065, 0.5160844326019287, -0.20168790221214294, 0.01946037821471691, -0.5076150298118591, -0.14494341611862183, 0.33151331543922424, 0.5907648205757141, -0.08046647906303406, -0.5824248194694519, -0.38973602652549744, 0.09310492873191833, -0.1416267305612564, -0.08932662010192871, 0.3764524459838867, -0.1428893804550171, 0.20811346173286438, -0.26067739725112915, -0.06704818457365036, -0.3573375642299652, 0.1949656903743744, 0.1930067390203476, -0.45701760053634644, -0.02854827418923378, -0.05906599387526512, 0.08082979172468185, -0.23867909610271454, 0.018349383026361465, -0.22556298971176147, 0.385467529296875, 0.028657905757427216, -0.07670606672763824, -0.1510789841413498, -0.09030567854642868, 0.5386694669723511, 0.11309466511011124, 0.07848816365003586, -0.01602253131568432, 0.20669133961200714, -0.6106097102165222, 0.1730537712574005, 0.11976493895053864, -0.04144369065761566, -0.038629282265901566, -0.37842613458633423, 0.3635284900665283, 0.25774747133255005, -0.07635548710823059, -0.07751870900392532, -0.31567510962486267, 0.05879891663789749, -0.4424822926521301, 0.03888861462473869, 0.13329243659973145, 0.0582650825381279, -0.15206587314605713, -0.20807895064353943, -0.3580780029296875, 0.1065361350774765, -0.012849900871515274, 0.10811901837587357, -0.17488273978233337, 0.31254732608795166, -0.32343214750289917, 0.27994099259376526, 0.1399346888065338, -0.5199068188667297, 0.018062245100736618, 0.05250529572367668, -0.2434811145067215, 0.3438718318939209, 0.17512252926826477, -0.47488975524902344, 0.006640180945396423, -0.00962703675031662, 0.3974575996398926, 0.12399739027023315, 0.1421889066696167, -0.1458711177110672, 0.04646756872534752, 0.13952848315238953, -0.04612469673156738, 0.0538119301199913, 0.13875705003738403, 0.1249045580625534, -0.06945274770259857, -0.006331793963909149, 0.12797176837921143, -0.3282284140586853, -0.11411444842815399, 0.05083734169602394, -0.15894824266433716, 0.13958194851875305, -0.5251596570014954, 0.2251376509666443, -0.434825599193573, -0.12672972679138184, -0.0746438130736351, 0.13873206079006195, 0.21464082598686218, -0.3521384596824646, -0.11462927609682083, 0.4305722117424011, -0.3753899931907654, 0.08661956340074539, -0.32610565423965454, 0.11977355182170868, 0.18433694541454315, 0.2004968225955963, -0.045716315507888794, 0.025538578629493713, -0.13046947121620178, 0.09837542474269867, 0.2335566282272339, -0.5905730128288269, 0.028798997402191162, 0.42879873514175415, -0.09319312870502472, 0.5106704235076904, 0.17872735857963562, 0.32011106610298157, -0.0028489679098129272, -0.22062864899635315, 0.10278904438018799, 0.37742552161216736, -0.04383628070354462, -0.11554931104183197, -0.05145525187253952, -0.6128872632980347, 0.06283069401979446, 0.2166898250579834, -0.027720855548977852, -0.03333531692624092, 0.26651179790496826, -0.28743135929107666, 0.12223702669143677, -0.18022461235523224, 0.4553787112236023, -0.18946944177150726, 0.41318461298942566, 0.0640236958861351, -0.26521214842796326, -0.34440428018569946, -0.5432228446006775, 0.10378269851207733, 0.04791489243507385, -0.15139992535114288, -0.050073835998773575, -0.3319779336452484, 0.3438928425312042, -0.33631598949432373, -0.025378644466400146, 0.08848568797111511, 0.07344935089349747, 0.17889249324798584, -0.3451243042945862, -0.028331834822893143, -0.43783673644065857, 0.24690553545951843, -0.04083690047264099, 0.08078283071517944, 0.046887993812561035, 0.32388097047805786, 0.13615381717681885, -0.14973169565200806, 0.137081578373909, 0.0573844350874424, 0.20832085609436035, -0.06431414932012558, 0.14912064373493195, 0.03599073737859726, 0.011999435722827911, 0.5045187473297119, 0.38712191581726074, 0.7333115339279175, 0.3998427987098694, -0.28496718406677246, 0.19274450838565826, -0.15670211613178253, 0.07336653769016266, -0.08871360123157501, -0.09329859912395477, 0.17039677500724792, -0.24296310544013977, -0.031163573265075684, 0.29546883702278137, 0.0487050786614418, 0.05580040067434311, 0.2159832864999771, -0.2889508306980133, -0.10680203139781952, 0.010109557770192623, 0.0810326561331749, 0.1722024530172348, -0.14760251343250275, -0.12865962088108063, 0.12555158138275146, 0.3660701513290405, -0.0002579614520072937, -0.0474286787211895, 0.15900246798992157, -0.3465921878814697, -0.10387671738862991, 0.2595689594745636, -0.033707037568092346, 0.17735478281974792, 0.24542701244354248, 0.024217337369918823, -0.07522524148225784, 0.38737136125564575, -0.10447090864181519, -0.0693759098649025, 0.22554028034210205, 0.12088023126125336, 0.2426094114780426, 0.15611857175827026, 0.1908990740776062, -0.1423686444759369, -0.13886627554893494, 0.18268784880638123, -0.21913570165634155, 0.024211086332798004, -0.1296185553073883, -0.26353752613067627, -0.06569931656122208, 0.2661994397640228, -0.5943881273269653, -0.15292534232139587, -0.028237883001565933, 0.008362645283341408, 0.2691482901573181, -0.09215625375509262, 0.10937823355197906, 0.1293085515499115, 0.6076383590698242, -0.19549253582954407, -0.22254908084869385, -0.09578245878219604, 0.17066985368728638, 0.10970175266265869, 0.10115379840135574, 0.35001951456069946, 0.1056845635175705, 0.2925492525100708, -0.030123762786388397, 0.4426981210708618, -0.7203118801116943, -0.11980579048395157, 0.178077831864357, 0.0931624099612236, 0.35999956727027893, -0.16023389995098114, 0.23457445204257965, 0.041591957211494446, -0.019828636199235916, -0.06892082840204239, -0.008816570043563843, 0.15192976593971252, -0.28508812189102173, 0.011031877249479294, 0.03153899684548378, 0.008459798991680145, 0.2556857764720917, -0.3331919014453888, -0.6858319044113159, 0.5750830769538879, 0.12558448314666748, -0.010064681991934776, 0.004383835941553116, 0.2247193157672882, 0.20170682668685913, 0.08582889288663864, 0.08398458361625671, 0.10243897140026093, -0.159948468208313, 0.0765293687582016, -0.2801636755466461, -0.3648739159107208, 0.22872042655944824, 0.11420761048793793, -0.12661057710647583, 0.30714085698127747, -0.18897005915641785, -0.3051466643810272, -0.07841463387012482, 0.41475772857666016, 0.050965242087841034, -0.04247397556900978, 0.16352009773254395, 0.06748642772436142, 0.020479924976825714, -0.125311017036438, -0.05155223235487938, -0.1907178908586502, 0.41924554109573364, -0.0012883953750133514, 0.15862378478050232, 0.04709523171186447, 0.18098528683185577, 0.7086407542228699, 0.37215742468833923, -0.2815982401371002, 0.4622455835342407, 0.2053031027317047, 0.3899870216846466, -0.10746480524539948, -0.08093926310539246, 0.15691637992858887, -0.4079051613807678, 0.09282702207565308, 0.38792678713798523, 0.21830609440803528, 0.07130450010299683, -0.001198887825012207, 0.064027801156044, -0.29947739839553833, 0.17080405354499817, 0.16821566224098206, -0.07419779896736145, 0.08365495502948761, -0.23918816447257996, -0.45817339420318604, -0.2200561761856079, -0.1709298938512802, 0.17954662442207336, 0.6084878444671631, 0.4036848545074463, 0.03208034113049507, -0.12317755073308945, -0.07626171410083771, 0.028720855712890625, 0.28351759910583496, 0.22449469566345215, -0.029017746448516846, -0.08485313504934311, -0.12298082560300827, -0.0372593030333519, -0.020889246836304665, 0.4580545723438263, -0.4608798623085022, -0.2926068902015686, -0.0731225311756134, -0.08200284838676453, -0.03005531057715416, 0.16437843441963196, -0.11321143805980682, 0.028751447796821594, 0.14119893312454224, 0.5356683731079102, -0.013399168848991394, -0.06064338609576225, -0.4651881158351898, 0.37433600425720215, 0.30119788646698, -0.1654462069272995, 0.07793409377336502, 0.2981064021587372, -0.5954920053482056, -0.3919699192047119, 0.24740754067897797, -0.24856996536254883, -0.14951124787330627, -0.2520359754562378, 0.0832105353474617, 0.015467070043087006, 0.32624703645706177, -0.10754132270812988, 0.08962614089250565, 0.05380411818623543, 0.051792412996292114, 0.10309837013483047, 0.26972779631614685, 0.697379469871521, 0.4566129446029663, 0.15538249909877777, 0.04344397410750389, 0.22742335498332977, 0.14166441559791565, 0.3295040726661682, 0.4885268211364746, 0.24559848010540009, 0.13405749201774597, -0.0360308438539505, 0.0636235773563385, -0.6570771932601929, 0.36815908551216125, 0.4128331243991852, -0.3537098169326782, -0.29399818181991577, -0.23510807752609253, 0.537716269493103, -0.11781603842973709, 0.040240928530693054, 0.3362587094306946, 0.4903048574924469, 0.019466716796159744, -0.1610855758190155, 0.14318528771400452, 1.0868356227874756, -0.025602389127016068, 0.2571577727794647, -0.24537336826324463, -0.03367636352777481, 0.17947597801685333, -0.5281364917755127, -0.009990997612476349, -0.148863285779953, -0.18694742023944855, -0.20611408352851868, -0.09702359139919281, 0.18068060278892517, 0.058882541954517365, -0.22963842749595642, -0.09252563863992691, 0.10693471133708954, 0.23834754526615143, -0.08801067620515823, 0.3693850636482239, -0.401915580034256, -0.3531106412410736, -0.4447590708732605, 0.12518194317817688, -0.07781648635864258, 0.06751495599746704, -0.10776735842227936, -0.28261619806289673, -0.11308684200048447, 0.20905764400959015, -0.3815460205078125, -0.13039042055606842, -0.21998900175094604, -0.11522514373064041, -0.027125181630253792, 0.1086200475692749, 0.25184687972068787, -0.048567529767751694, -0.08792416751384735, 0.003673441708087921, -0.3277100622653961, 0.12512940168380737, -0.2096942961215973, 0.023132652044296265, -0.03869239240884781, -0.21413148939609528, 0.5357816815376282, -0.2260555773973465, 0.030895039439201355, 0.27984756231307983, 0.05138202756643295, -0.07522688806056976, -0.039969637989997864, -0.12188102304935455, 0.14873048663139343, 0.08056028187274933, -0.26688939332962036, -0.046656522899866104, -0.08103453367948532, 0.029438719153404236, 0.007079181727021933, 0.1966005265712738, 0.11842204630374908, 0.010924622416496277, 0.2639917731285095, 0.17912662029266357, -0.24707846343517303, 0.07798533886671066, -0.3167358934879303, -0.3714362382888794, -0.10327428579330444, 0.28990668058395386, -0.19693569839000702, -0.057315997779369354, 0.4140298366546631, 0.020507536828517914, -0.05067797750234604, -0.1647941619157791, 0.23890475928783417, -0.1528804898262024, -0.024171270430088043, 0.0018279794603586197, 0.24936039745807648, -0.1498161405324936, -0.14733804762363434, -0.22379282116889954, -0.5012668371200562, 0.19031772017478943, -0.2754381597042084, 0.22032827138900757, -0.29902079701423645, -0.1967049241065979, 0.10903233289718628, 0.18103277683258057, -0.2467557191848755, 0.14574863016605377, 0.10589896142482758, 0.14061561226844788, -0.0484461709856987, -0.06306849420070648, 0.1079954206943512, 0.09123359620571136, -0.08609644323587418, -0.05586441233754158, -0.4407014846801758, -0.020243097096681595, -0.21189244091510773, 0.2202838808298111, 0.3981207013130188, -0.16610559821128845, 0.10799470543861389, -0.08241268992424011, -0.30334746837615967, -0.23725470900535583, 0.18136778473854065, -0.1166696846485138, -0.04633282870054245, -0.2013140469789505, 0.37623026967048645, -0.1411590576171875, 0.031019501388072968, 0.0509674996137619, 0.2895500957965851, 0.3810761868953705, 0.07641319930553436, -0.24463076889514923, 0.018363889306783676, -0.06889810413122177, -0.02726934663951397, 0.21342839300632477, 0.24560844898223877, 0.21650491654872894, 0.36177685856819153, 0.06874440610408783, 0.13333112001419067, -0.17472192645072937, 0.3092079758644104, 0.028885086998343468, -0.041945505887269974, 0.18226976692676544, 0.2856626808643341, 0.128529891371727, 0.06548216938972473, 0.022893596440553665, 0.17226658761501312, -0.2758029103279114, 0.3349880576133728, 0.1094994843006134, 0.3327915668487549, 0.2679917812347412, -0.10273769497871399, -0.20673388242721558, 0.0846891850233078, -0.0011833161115646362, 0.1322532594203949, 0.05567021295428276, 0.027921870350837708, 0.12442518770694733, -0.04636148735880852, 0.383462518453598, 0.10684925317764282, 0.31037646532058716, -0.450792133808136, -0.030171025544404984, 0.2455069124698639, -0.33901482820510864, 0.2778525650501251, -0.3914942145347595, -0.13201822340488434, 0.36527061462402344, 0.23245137929916382, 0.30555588006973267, 0.045111868530511856, -0.007597051560878754, -0.10247835516929626, -0.09847228229045868, -0.23062556982040405, 0.10264948010444641, 0.23267002403736115, 0.13266289234161377, 0.14857535064220428, -0.2833481431007385, -0.3577815890312195, 0.09293314814567566, -0.18274593353271484, -0.019741736352443695, -0.016386285424232483, 0.3382531702518463, 0.19951996207237244, 0.038707442581653595, -0.16054992377758026, 0.05842648819088936, 0.5387871861457825, -0.08507166057825089, -0.1232692152261734, 0.4228540062904358, 0.1460740566253662, 0.026989243924617767, -0.017764315009117126, 0.27127504348754883, 0.2515779435634613, -0.19792643189430237, 0.17673197388648987, 0.038807377219200134, 0.0370723158121109, 0.16075937449932098, 0.24673356115818024, 0.13956379890441895, 0.19185218214988708, 0.09957386553287506, 0.011738266795873642, -0.1691807061433792, 0.003776497207581997, -0.37546685338020325, 0.08419395983219147, -0.5492339730262756, 0.12695346772670746, -0.19007322192192078, -0.07738856226205826, -0.21870647370815277, 0.0027200430631637573, -0.3826392889022827, -0.12422891706228256, 0.41542303562164307, -0.4755706489086151, -0.11278480291366577, -0.10634744167327881, 0.031598348170518875, -0.22743605077266693, 0.30038878321647644, 0.46999481320381165, -0.07862572371959686, -0.053289420902729034, -0.027718104422092438, -0.3090822994709015, -0.04823528230190277, -0.012909473851323128, -0.10155414789915085, -0.11232422292232513, -0.024664655327796936, 0.16125285625457764, 0.3474382758140564, 0.13258571922779083, -0.06536548584699631, 0.18024110794067383, 0.05349796637892723, -0.30617937445640564, -0.01438373513519764, 0.22659501433372498, 0.16751010715961456, -0.15586715936660767, -0.20315496623516083, 0.16170939803123474, -0.08566330373287201, 0.0029027387499809265, 0.010217823088169098, -0.1917370855808258, -0.10729614645242691, -0.18606775999069214, 0.4184073805809021, 0.09820783138275146, 0.3847489058971405, -0.1373361349105835, -0.4518788456916809, -0.2833509147167206, 0.08425089716911316, -0.1094948872923851, -0.1528933048248291, -0.020507268607616425, 0.6950178742408752, -0.22111457586288452, 0.10951866209506989, -0.14099332690238953, 0.1340477615594864, 0.006915584206581116, 0.007372494786977768, -0.15370087325572968, -0.04006155952811241, -0.3493589162826538, -0.006288103759288788, 0.38294827938079834, 0.17535030841827393, -0.12827599048614502, -0.21940360963344574, -0.2929783761501312, -0.03743867948651314, 0.5181084871292114, -0.49930810928344727, -0.4183879494667053, 0.1806657612323761, -0.06895428895950317, 0.3927742838859558, 0.24535636603832245, -0.05807855725288391, -0.008642807602882385, 0.24577978253364563, 0.045834898948669434, 0.07879018783569336, 0.2484293282032013, -0.1894446164369583, -0.23734697699546814, -0.03279316797852516, -0.19896593689918518, -0.060700420290231705, 0.04125581681728363, -0.012117922306060791, -0.21418721973896027 ]
https://github.com/huggingface/datasets/issues/5888
The streaming would work, but the video paths would require using `fsspec.open` to get the content.
A way to upload and visualize .mp4 files (millions of them) as part of a dataset
**Is your feature request related to a problem? Please describe.** I recently chose to use huggingface hub as the home for a large multi modal dataset I've been building. https://huggingface.co/datasets/Antreas/TALI It combines images, text, audio and video. Now, I could very easily upload a dataset made via datasets.Dataset.from_generator, as long as it did not include video files. I found that including .mp4 files in the entries would not auto-upload those files. Hence I tried to upload them myself. I quickly found out that uploading many small files is a very bad way to use git lfs, and that it would take ages, so, I resorted to using 7z to pack them all up. But then I had a new problem. My dataset had a size of 1.9TB. Trying to upload such a large file with the default huggingface_hub API always resulted in time outs etc. So I decided to split the large files into chunks of 5GB each and reupload. So, eventually it all worked out. But now the dataset can't be properly and natively used by the datasets API because of all the needed preprocessing -- and furthermore the hub is unable to visualize things. **Describe the solution you'd like** A native way to upload large datasets that include .mp4 or other video types. **Describe alternatives you've considered** Already explained earlier **Additional context** https://huggingface.co/datasets/Antreas/TALI
16
A way to upload and visualize .mp4 files (millions of them) as part of a dataset **Is your feature request related to a problem? Please describe.** I recently chose to use huggingface hub as the home for a large multi modal dataset I've been building. https://huggingface.co/datasets/Antreas/TALI It combines images, text, audio and video. Now, I could very easily upload a dataset made via datasets.Dataset.from_generator, as long as it did not include video files. I found that including .mp4 files in the entries would not auto-upload those files. Hence I tried to upload them myself. I quickly found out that uploading many small files is a very bad way to use git lfs, and that it would take ages, so, I resorted to using 7z to pack them all up. But then I had a new problem. My dataset had a size of 1.9TB. Trying to upload such a large file with the default huggingface_hub API always resulted in time outs etc. So I decided to split the large files into chunks of 5GB each and reupload. So, eventually it all worked out. But now the dataset can't be properly and natively used by the datasets API because of all the needed preprocessing -- and furthermore the hub is unable to visualize things. **Describe the solution you'd like** A native way to upload large datasets that include .mp4 or other video types. **Describe alternatives you've considered** Already explained earlier **Additional context** https://huggingface.co/datasets/Antreas/TALI The streaming would work, but the video paths would require using `fsspec.open` to get the content.
[ -0.5551955103874207, -0.28798842430114746, -0.008014790713787079, 0.09705822169780731, 0.2945646643638611, 0.04519537091255188, -0.021156584843993187, 0.35694944858551025, -0.15446490049362183, 0.026033267378807068, -0.06267376244068146, 0.1369837522506714, -0.3402658700942993, 0.7099331617355347, -0.006575495004653931, -0.16785241663455963, 0.07653848081827164, 0.23583582043647766, 0.0864400565624237, 0.2348019927740097, 0.049519844353199005, -0.24972644448280334, 0.22212153673171997, -0.24358731508255005, -0.6582394242286682, -0.09176407009363174, -0.15970417857170105, 0.20612545311450958, -0.1245294138789177, -0.34314996004104614, -0.2697276771068573, 0.030818816274404526, 0.600666344165802, 0.6189810037612915, -0.00011600744619499892, -0.31220871210098267, 0.3671363294124603, -0.1791943609714508, -0.22850817441940308, 0.07757207751274109, -0.09513475000858307, -0.3297317326068878, 0.12200786173343658, 0.024289727210998535, 0.06406079232692719, -0.47314727306365967, 0.21100354194641113, -0.49157264828681946, 0.1033330112695694, -0.2704986333847046, 0.06843648850917816, 0.09368739277124405, -0.15809185802936554, 0.2136838734149933, 0.04828634858131409, 0.630733072757721, -0.2555604875087738, 0.003736726939678192, 0.5856685042381287, 0.03230641037225723, -0.09981828927993774, 0.07865941524505615, 0.22013609111309052, -0.20018261671066284, 0.47405052185058594, -0.11312822997570038, 0.02024206332862377, -0.47835439443588257, -0.18224066495895386, 0.27262604236602783, 0.5799100995063782, -0.009103009477257729, -0.5558028817176819, -0.3450593948364258, 0.0671233981847763, -0.12158414721488953, -0.11138087511062622, 0.35141295194625854, -0.15858730673789978, 0.1706799864768982, -0.23644843697547913, -0.07542309910058975, -0.35036444664001465, 0.2968124747276306, 0.2043994665145874, -0.5200021266937256, -0.030583202838897705, -0.04671155661344528, 0.09110182523727417, -0.32911720871925354, -0.007647208869457245, -0.18676739931106567, 0.3935518264770508, 0.050481025129556656, -0.11162475496530533, -0.1907636821269989, -0.04308184236288071, 0.4547739624977112, 0.06784328818321228, 0.12348172813653946, -0.0688009262084961, 0.23036009073257446, -0.6066454648971558, 0.14146599173545837, 0.1321779042482376, -0.03222634270787239, -0.017629768699407578, -0.346761018037796, 0.4046255648136139, 0.29958170652389526, -0.08943541347980499, -0.10727346688508987, -0.2790761888027191, 0.03471413627266884, -0.4946325719356537, 0.017639964818954468, 0.0602162629365921, 0.025451719760894775, -0.15870681405067444, -0.17935404181480408, -0.29948341846466064, 0.13629643619060516, -0.019087916240096092, 0.11379177868366241, -0.19917094707489014, 0.3295168876647949, -0.3207508623600006, 0.25649285316467285, 0.06670283526182175, -0.5104501843452454, 0.015911858528852463, 0.0450550802052021, -0.25561612844467163, 0.476289302110672, 0.16401714086532593, -0.2941412627696991, -0.07799508422613144, -0.06848359107971191, 0.4439897835254669, 0.14504343271255493, 0.06358169764280319, -0.1597720831632614, 0.05063978210091591, 0.09186118841171265, -0.06402526795864105, 0.09352938085794449, 0.12557411193847656, 0.1442173272371292, -0.08540713042020798, 0.008186044171452522, 0.02129572257399559, -0.364393025636673, -0.15588945150375366, 0.0035055074840784073, -0.14891044795513153, 0.06493251025676727, -0.5509040355682373, 0.23616626858711243, -0.4128870666027069, -0.16311374306678772, -0.11836880445480347, 0.24735915660858154, 0.10315865278244019, -0.3353617489337921, -0.07623697817325592, 0.47994041442871094, -0.321964830160141, 0.08760617673397064, -0.29139167070388794, 0.14215892553329468, 0.13919372856616974, 0.24615304172039032, 0.05375310778617859, 0.01193772442638874, -0.18593217432498932, 0.12836375832557678, 0.15430283546447754, -0.671915590763092, -0.003810930997133255, 0.4609328508377075, -0.00015112757682800293, 0.45333367586135864, 0.16850540041923523, 0.34367635846138, -0.023854726925492287, -0.22254140675067902, 0.2080606073141098, 0.4106615483760834, -0.05282238870859146, -0.07595216482877731, -0.0845949575304985, -0.6322169899940491, -0.005348494276404381, 0.24289627373218536, -0.0011526604648679495, -0.02467772364616394, 0.26720091700553894, -0.3599468171596527, 0.15426719188690186, -0.1290317177772522, 0.4450114667415619, -0.14552262425422668, 0.3966987133026123, 0.07221904397010803, -0.28057193756103516, -0.41817447543144226, -0.4994116723537445, 0.15022417902946472, -0.011296823620796204, -0.2239980846643448, -0.12316858768463135, -0.31033530831336975, 0.26389139890670776, -0.33830392360687256, -0.01617647521197796, 0.09724664688110352, 0.018406778573989868, 0.12088258564472198, -0.3427574336528778, 0.05975222587585449, -0.36973369121551514, 0.189300537109375, 0.06778746843338013, 0.022695433348417282, 0.00675380602478981, 0.367323100566864, 0.17388130724430084, -0.1483347862958908, 0.00868213176727295, 0.13625295460224152, 0.25652897357940674, -0.07832355797290802, 0.17308104038238525, 0.05383681878447533, -0.0382193997502327, 0.3929073214530945, 0.4374394118785858, 0.7504834532737732, 0.4057207703590393, -0.33752694725990295, 0.12355926632881165, -0.15361222624778748, 0.03815164789557457, -0.11679449677467346, -0.11988283693790436, 0.15657979249954224, -0.28775694966316223, 0.011486072093248367, 0.22969113290309906, 0.07621611654758453, 0.022793292999267578, 0.15766049921512604, -0.20678472518920898, -0.11157464236021042, 0.0028536845929920673, 0.1904352903366089, 0.0914926826953888, -0.2349012941122055, -0.07918407768011093, 0.05661731958389282, 0.3882918953895569, 0.0008577406406402588, -0.07240799814462662, 0.14862369000911713, -0.2963269352912903, 0.029270470142364502, 0.22248245775699615, -0.08450543880462646, 0.16957826912403107, 0.23751546442508698, -0.049209363758563995, -0.06142033636569977, 0.4410672187805176, -0.024461306631565094, -0.10068379342556, 0.19685034453868866, 0.0967804491519928, 0.25614526867866516, 0.24280546605587006, 0.16002562642097473, -0.06572382152080536, -0.1815069615840912, 0.19656771421432495, -0.17194342613220215, -0.0030556246638298035, -0.0697232037782669, -0.34971994161605835, -0.0807671844959259, 0.2565765976905823, -0.5082402229309082, -0.17787538468837738, -0.08174131065607071, 0.028542816638946533, 0.22155745327472687, -0.16098454594612122, 0.11165568977594376, 0.14288149774074554, 0.6333134770393372, -0.17146800458431244, -0.23719412088394165, -0.10069720447063446, 0.1933518350124359, 0.11167392134666443, 0.06035337597131729, 0.444169282913208, 0.02915528416633606, 0.21410806477069855, 0.047864533960819244, 0.4213617742061615, -0.7392531633377075, -0.06703667342662811, 0.2133360654115677, 0.17230351269245148, 0.3465183675289154, -0.20892642438411713, 0.1526382863521576, 0.1582145243883133, 0.0016363784670829773, -0.046065881848335266, -0.03115004673600197, 0.12493785470724106, -0.2426714301109314, 0.017550028860569, 0.10411933064460754, 0.0036719590425491333, 0.24511390924453735, -0.3584275245666504, -0.7232536673545837, 0.5606405138969421, 0.08610527962446213, -0.053302183747291565, -0.03646060451865196, 0.2670992314815521, 0.13983844220638275, 0.022150292992591858, -0.012147348374128342, 0.10436679422855377, -0.20047013461589813, 0.13698650896549225, -0.30101558566093445, -0.3812824487686157, 0.21181803941726685, 0.08130145072937012, -0.20971016585826874, 0.19842970371246338, -0.20348627865314484, -0.30973684787750244, -0.09916850924491882, 0.4589613080024719, 0.012210208922624588, -0.03147866949439049, 0.08936814963817596, 0.0178179033100605, 0.012178793549537659, -0.05455116927623749, -0.001964651048183441, -0.2125263661146164, 0.3903842568397522, 0.019126642495393753, 0.16516299545764923, 0.07800747454166412, 0.2145845592021942, 0.683326780796051, 0.3559545874595642, -0.22148668766021729, 0.4874010682106018, 0.08331534266471863, 0.371931791305542, -0.09935181587934494, -0.102674201130867, 0.06909555941820145, -0.43566247820854187, 0.13672658801078796, 0.3261023759841919, 0.2500908374786377, 0.07882139086723328, -0.005132794380187988, 0.12064765393733978, -0.15716049075126648, 0.1372990906238556, 0.14365878701210022, -0.09006442129611969, 0.05940786376595497, -0.2813580632209778, -0.5201718807220459, -0.26797765493392944, -0.22527317702770233, 0.2544885277748108, 0.531571090221405, 0.37286853790283203, -0.00362270325422287, -0.07447025924921036, 0.011003471910953522, -0.05329379811882973, 0.3844562768936157, 0.23477016389369965, -0.04371406137943268, -0.10526366531848907, -0.16364946961402893, -0.039148956537246704, 0.005404885858297348, 0.6053420901298523, -0.3944523334503174, -0.30586230754852295, -0.09835643321275711, -0.11035677045583725, -0.09122658520936966, 0.1048746183514595, -0.052847255021333694, 0.042593616992235184, 0.18836364150047302, 0.6748075485229492, 0.04174928367137909, -0.029773211106657982, -0.4688394069671631, 0.3526563346385956, 0.25199151039123535, -0.20737028121948242, 0.06486523151397705, 0.3226862847805023, -0.5922799110412598, -0.4420662820339203, 0.29546377062797546, -0.17177599668502808, -0.05676751211285591, -0.2722473740577698, 0.0951530933380127, -0.024074915796518326, 0.2866581976413727, -0.1723846197128296, 0.08846096694469452, 0.06759914755821228, 0.06406666338443756, 0.05493186414241791, 0.2497090846300125, 0.5920500755310059, 0.5273405313491821, 0.1849830597639084, 0.014041261747479439, 0.2846596837043762, 0.07606227695941925, 0.3336002230644226, 0.4300878345966339, 0.2716365158557892, 0.21338427066802979, -0.09895718097686768, 0.18514296412467957, -0.6662217378616333, 0.38500332832336426, 0.42427924275398254, -0.38891035318374634, -0.24362167716026306, -0.11604144424200058, 0.6322895288467407, -0.0671837255358696, 0.04667368531227112, 0.2767356038093567, 0.5323957204818726, 0.059212327003479004, -0.16882115602493286, 0.09641845524311066, 1.041501522064209, -0.02115112543106079, 0.3347565829753876, -0.30865469574928284, 0.012122780084609985, 0.1922089010477066, -0.6146186590194702, -0.037478070706129074, -0.1588357537984848, -0.24283620715141296, -0.14982399344444275, -0.017189227044582367, 0.13159018754959106, 0.05167686939239502, -0.14925675094127655, -0.0543447844684124, 0.11970797181129456, 0.18958711624145508, -0.1540401577949524, 0.2890510559082031, -0.3157891631126404, -0.33005291223526, -0.34254610538482666, 0.0985221117734909, -0.014288464561104774, -0.0006446391344070435, -0.08560933917760849, -0.21759271621704102, -0.117916040122509, 0.2598729133605957, -0.3913987874984741, -0.11054475605487823, -0.012769531458616257, 0.006176915019750595, 0.08676221966743469, 0.13206371665000916, 0.2604827284812927, -0.0597359724342823, -0.13641151785850525, -0.03831690549850464, -0.32367879152297974, 0.09181013703346252, -0.1976184993982315, 0.10565881431102753, -0.15353266894817352, -0.23168741166591644, 0.5115368962287903, -0.18909673392772675, -0.012969866394996643, 0.2642349600791931, 0.1314900666475296, -0.09237085282802582, -0.13583460450172424, -0.0010183025151491165, 0.12576451897621155, 0.06333088874816895, -0.3050396740436554, -0.0544540174305439, 0.035613492131233215, 0.028203316032886505, -0.02385902777314186, 0.2787575423717499, 0.064186692237854, 0.0678241103887558, 0.26218026876449585, 0.12934646010398865, -0.18267318606376648, 0.13392002880573273, -0.3352550268173218, -0.4028415083885193, 0.00935598649084568, 0.2845684289932251, -0.14113841950893402, 0.016716666519641876, 0.5042181611061096, 0.05046851560473442, -0.0961984395980835, -0.13792967796325684, 0.23550105094909668, -0.16624394059181213, 0.04992617294192314, -0.003953786566853523, 0.19988295435905457, -0.2094838172197342, -0.10701045393943787, -0.19673216342926025, -0.5298457145690918, 0.14548452198505402, -0.2845902442932129, 0.22275283932685852, -0.32785776257514954, -0.17082515358924866, 0.04916505515575409, 0.13898199796676636, -0.20611396431922913, 0.18156182765960693, 0.046644024550914764, 0.10288005322217941, -0.01471617165952921, -0.03179158270359039, 0.07863594591617584, 0.1039252057671547, -0.10476590692996979, 0.00285189226269722, -0.3445799946784973, 0.002801906317472458, -0.2364802062511444, 0.22613337635993958, 0.40536829829216003, -0.11643081903457642, 0.1445048600435257, -0.06550174206495285, -0.2592463493347168, -0.2208317220211029, 0.09439021348953247, -0.04264116287231445, -0.06412440538406372, -0.1511671096086502, 0.239364892244339, -0.2089930921792984, 0.05218017101287842, 0.11403736472129822, 0.3675701916217804, 0.3985486924648285, 0.11193475127220154, -0.1878017634153366, -0.0408453606069088, -0.04155426472425461, -0.040862493216991425, 0.1961122751235962, 0.23146161437034607, 0.1952814757823944, 0.38111066818237305, 0.052128661423921585, 0.15550225973129272, -0.1538085788488388, 0.23648476600646973, -0.08461464196443558, -0.04963860660791397, 0.16605237126350403, 0.34072422981262207, 0.11787918210029602, 0.06679315865039825, -0.04409024864435196, 0.22114869952201843, -0.2680725157260895, 0.30965614318847656, 0.08058048039674759, 0.29998689889907837, 0.2681136131286621, -0.05796297639608383, -0.20190070569515228, -0.011569187045097351, 0.026718690991401672, 0.14920580387115479, -0.0165280569344759, 0.0025739669799804688, 0.07385832816362381, -0.01747772842645645, 0.30633291602134705, 0.1031726747751236, 0.4650254249572754, -0.40854620933532715, -0.03748784959316254, 0.07393660396337509, -0.30502626299858093, 0.2204497754573822, -0.5247347354888916, -0.1109623908996582, 0.23019704222679138, 0.28956300020217896, 0.33588314056396484, 0.018864456564188004, -0.02437398210167885, -0.08631125092506409, -0.06996426731348038, -0.2314884215593338, 0.15815232694149017, 0.3115253746509552, 0.06752213835716248, 0.21540184319019318, -0.23685353994369507, -0.373973548412323, 0.14028607308864594, -0.1493684947490692, -0.07524234056472778, -0.013963121920824051, 0.3727666139602661, 0.15467862784862518, 0.08861425518989563, -0.16424694657325745, 0.08033348619937897, 0.6389245390892029, -0.04882704094052315, -0.20615708827972412, 0.40599530935287476, 0.09912867099046707, 0.023882120847702026, -0.06364256143569946, 0.2219802439212799, 0.2654775083065033, -0.20766198635101318, 0.20964843034744263, 0.015098951756954193, 0.11092273145914078, 0.1226106733083725, 0.18214698135852814, 0.15405841171741486, 0.2192770391702652, 0.07954026013612747, -0.023183468729257584, -0.15854358673095703, -0.014178055338561535, -0.36080053448677063, 0.2031555324792862, -0.5886551141738892, 0.11183282732963562, -0.20988523960113525, -0.0662834495306015, -0.24274767935276031, 0.04338499903678894, -0.4058767855167389, -0.1517234444618225, 0.4134520888328552, -0.5029021501541138, -0.08369287103414536, -0.10531148314476013, 0.019986696541309357, -0.2929467558860779, 0.34709614515304565, 0.4343029856681824, -0.037071049213409424, -0.04048886150121689, 0.019041121006011963, -0.2999259829521179, -0.009660717099905014, 0.02444196678698063, -0.09271686524152756, -0.09854453802108765, -0.023769699037075043, 0.1585656851530075, 0.21409791707992554, 0.14753280580043793, -0.077755406498909, 0.20164689421653748, 0.11188994348049164, -0.33884114027023315, -0.016410769894719124, 0.13191114366054535, 0.1612047255039215, -0.12078647315502167, -0.16352160274982452, 0.05311626195907593, -0.11365677416324615, 0.005374617874622345, 0.07875639200210571, -0.2740902900695801, -0.17373575270175934, -0.2060236930847168, 0.41908013820648193, 0.11470792442560196, 0.41668057441711426, -0.13661502301692963, -0.41091594099998474, -0.2753846049308777, -0.012274172157049179, -0.1599038541316986, -0.17459578812122345, -0.020098695531487465, 0.6598188281059265, -0.2750007212162018, 0.16334368288516998, -0.15727785229682922, 0.16137051582336426, -0.007593005895614624, -0.027370750904083252, -0.13993355631828308, -0.0660259947180748, -0.2539234757423401, -0.029872749000787735, 0.35153108835220337, 0.24190673232078552, -0.15862232446670532, -0.15785105526447296, -0.19268980622291565, 0.007647231221199036, 0.4984915554523468, -0.5138084888458252, -0.42908939719200134, 0.19151027500629425, -0.03709802031517029, 0.2561981678009033, 0.275316447019577, -0.030926764011383057, -0.0671616941690445, 0.2087271511554718, 0.05235075205564499, 0.13324375450611115, 0.2636963725090027, -0.22716878354549408, -0.28011396527290344, -0.02866722270846367, -0.1012507975101471, -0.029073616489768028, 0.05646192282438278, 0.07752025127410889, -0.19755151867866516 ]
https://github.com/huggingface/datasets/issues/5888
Not yet. The (open source) tooling for video is not great in terms of ease of use/performance, so we are discussing internally the best way to support it (one option is creating a new library for video IO, but this will require a lot of work)
A way to upload and visualize .mp4 files (millions of them) as part of a dataset
**Is your feature request related to a problem? Please describe.** I recently chose to use huggingface hub as the home for a large multi modal dataset I've been building. https://huggingface.co/datasets/Antreas/TALI It combines images, text, audio and video. Now, I could very easily upload a dataset made via datasets.Dataset.from_generator, as long as it did not include video files. I found that including .mp4 files in the entries would not auto-upload those files. Hence I tried to upload them myself. I quickly found out that uploading many small files is a very bad way to use git lfs, and that it would take ages, so, I resorted to using 7z to pack them all up. But then I had a new problem. My dataset had a size of 1.9TB. Trying to upload such a large file with the default huggingface_hub API always resulted in time outs etc. So I decided to split the large files into chunks of 5GB each and reupload. So, eventually it all worked out. But now the dataset can't be properly and natively used by the datasets API because of all the needed preprocessing -- and furthermore the hub is unable to visualize things. **Describe the solution you'd like** A native way to upload large datasets that include .mp4 or other video types. **Describe alternatives you've considered** Already explained earlier **Additional context** https://huggingface.co/datasets/Antreas/TALI
46
A way to upload and visualize .mp4 files (millions of them) as part of a dataset **Is your feature request related to a problem? Please describe.** I recently chose to use huggingface hub as the home for a large multi modal dataset I've been building. https://huggingface.co/datasets/Antreas/TALI It combines images, text, audio and video. Now, I could very easily upload a dataset made via datasets.Dataset.from_generator, as long as it did not include video files. I found that including .mp4 files in the entries would not auto-upload those files. Hence I tried to upload them myself. I quickly found out that uploading many small files is a very bad way to use git lfs, and that it would take ages, so, I resorted to using 7z to pack them all up. But then I had a new problem. My dataset had a size of 1.9TB. Trying to upload such a large file with the default huggingface_hub API always resulted in time outs etc. So I decided to split the large files into chunks of 5GB each and reupload. So, eventually it all worked out. But now the dataset can't be properly and natively used by the datasets API because of all the needed preprocessing -- and furthermore the hub is unable to visualize things. **Describe the solution you'd like** A native way to upload large datasets that include .mp4 or other video types. **Describe alternatives you've considered** Already explained earlier **Additional context** https://huggingface.co/datasets/Antreas/TALI Not yet. The (open source) tooling for video is not great in terms of ease of use/performance, so we are discussing internally the best way to support it (one option is creating a new library for video IO, but this will require a lot of work)
[ -0.5383275151252747, -0.2630661129951477, -0.03204777091741562, 0.060689639300107956, 0.2810743451118469, 0.04513327777385712, 0.015760738402605057, 0.3808838129043579, -0.16616883873939514, 0.026201725006103516, -0.033128175884485245, 0.1467970609664917, -0.324729859828949, 0.6856820583343506, -0.0015710555016994476, -0.18341518938541412, 0.06520050764083862, 0.30653244256973267, 0.09973932802677155, 0.25679636001586914, 0.08070079982280731, -0.2716233432292938, 0.24171943962574005, -0.25955551862716675, -0.6727548241615295, -0.11253856867551804, -0.14238515496253967, 0.13657252490520477, -0.10537686944007874, -0.3286932706832886, -0.2745293974876404, 0.023911073803901672, 0.6171324253082275, 0.6051572561264038, -0.00011375644680811092, -0.336517870426178, 0.3467232584953308, -0.17145052552223206, -0.20342159271240234, 0.10139727592468262, -0.08010559529066086, -0.39014673233032227, 0.129248708486557, -0.011469051241874695, 0.09312530606985092, -0.46540337800979614, 0.20666784048080444, -0.46343863010406494, 0.0742838904261589, -0.32612913846969604, 0.08424623310565948, 0.13373294472694397, -0.13087210059165955, 0.20662400126457214, 0.06276106089353561, 0.6786541938781738, -0.2609982490539551, 0.03039185330271721, 0.6361663937568665, 0.02503477782011032, -0.10129402577877045, 0.09596773982048035, 0.21795198321342468, -0.21895311772823334, 0.4477611780166626, -0.08590123057365417, 0.004561564885079861, -0.4890506863594055, -0.17112165689468384, 0.24775296449661255, 0.591396689414978, -0.032409340143203735, -0.5479265451431274, -0.31992924213409424, 0.13704586029052734, -0.14879965782165527, -0.14202584326267242, 0.3437006175518036, -0.1402696967124939, 0.17877286672592163, -0.22962304949760437, -0.030103037133812904, -0.36247146129608154, 0.28670522570610046, 0.2511029541492462, -0.4911870062351227, -0.01961183175444603, -0.06294544041156769, 0.08623206615447998, -0.3086707293987274, 0.01781516522169113, -0.13928627967834473, 0.3790387213230133, 0.06393790245056152, -0.10852712392807007, -0.21685820817947388, -0.08728346228599548, 0.4387633204460144, 0.05901484191417694, 0.12036220729351044, -0.0731438398361206, 0.20228850841522217, -0.5926998853683472, 0.12782028317451477, 0.12706255912780762, -0.032430075109004974, -0.05226626619696617, -0.3675335943698883, 0.4366850256919861, 0.2986951768398285, -0.07055225968360901, -0.09007731080055237, -0.23318499326705933, 0.006388150155544281, -0.40615198016166687, 0.014141310006380081, 0.07983250170946121, 0.04537089914083481, -0.18656529486179352, -0.18074285984039307, -0.35400235652923584, 0.0925203263759613, -0.013046765699982643, 0.046759068965911865, -0.20236635208129883, 0.3305930495262146, -0.315582275390625, 0.24159587919712067, 0.09763309359550476, -0.5365537405014038, 0.030293866991996765, 0.0632074773311615, -0.21187283098697662, 0.48875102400779724, 0.19103389978408813, -0.30607107281684875, -0.10933280736207962, -0.02015049010515213, 0.45085063576698303, 0.13514654338359833, 0.12362580001354218, -0.14491555094718933, 0.046516526490449905, 0.0570426844060421, -0.03627648204565048, 0.051707275211811066, 0.11043082177639008, 0.17088055610656738, -0.09181681275367737, 0.020346738398075104, 0.018130606040358543, -0.36930543184280396, -0.21117740869522095, 0.031536124646663666, -0.1374262422323227, 0.06533363461494446, -0.44943174719810486, 0.21280774474143982, -0.3995334208011627, -0.12872648239135742, -0.12194521725177765, 0.2554212212562561, 0.15560908615589142, -0.3225632309913635, -0.06933008134365082, 0.42301642894744873, -0.36053067445755005, 0.12453580647706985, -0.3427925407886505, 0.13521680235862732, 0.12233196198940277, 0.2387106567621231, 0.042902372777462006, 0.04143071174621582, -0.1786217987537384, 0.0598701536655426, 0.14074578881263733, -0.675901472568512, 0.0027807913720607758, 0.408617228269577, -0.053115636110305786, 0.4268760085105896, 0.18159860372543335, 0.4286734163761139, -0.006544541567564011, -0.26304855942726135, 0.20939864218235016, 0.3937155306339264, -0.06877207010984421, -0.11485931277275085, -0.08278658241033554, -0.6063848733901978, -0.05986251309514046, 0.2779828906059265, -0.009210987947881222, -0.06851135194301605, 0.23243401944637299, -0.36894741654396057, 0.11981991678476334, -0.12639448046684265, 0.47230663895606995, -0.1623532474040985, 0.4032399356365204, 0.08636604249477386, -0.27057841420173645, -0.39001229405403137, -0.4928039312362671, 0.10789389163255692, 0.005447953939437866, -0.21426913142204285, -0.09056863188743591, -0.31800931692123413, 0.25734061002731323, -0.35391539335250854, 0.009027248248457909, 0.1542239636182785, 0.0521397665143013, 0.11431816965341568, -0.37118664383888245, 0.058342888951301575, -0.38518261909484863, 0.1672114133834839, 0.05389220267534256, 0.020552922040224075, 0.030235543847084045, 0.32863903045654297, 0.14816072583198547, -0.15674640238285065, -0.003628462553024292, 0.146278515458107, 0.21243344247341156, -0.07175423204898834, 0.17029865086078644, 0.017835430800914764, -0.11909684538841248, 0.36491724848747253, 0.4538773000240326, 0.731059193611145, 0.4088612198829651, -0.3361961245536804, 0.16283319890499115, -0.19208870828151703, 0.03130100294947624, -0.15004730224609375, -0.09967835247516632, 0.17087416350841522, -0.3202223479747772, -0.007936522364616394, 0.18158945441246033, 0.08773843944072723, 0.020760931074619293, 0.15754525363445282, -0.20137953758239746, -0.15479004383087158, -0.014968940988183022, 0.1749231070280075, 0.10637567937374115, -0.23096472024917603, -0.06918451189994812, 0.04514829069375992, 0.3911607265472412, -0.0281943641602993, -0.03384080529212952, 0.14094974100589752, -0.2833014726638794, 0.027340248227119446, 0.17324398458003998, -0.07786029577255249, 0.1544744372367859, 0.2468910962343216, -0.0891440361738205, -0.11109684407711029, 0.4276028871536255, -0.03208239749073982, -0.12229322642087936, 0.21593409776687622, 0.09046832472085953, 0.23045824468135834, 0.21957603096961975, 0.16277003288269043, -0.006060071289539337, -0.19165918231010437, 0.1916840523481369, -0.1647150218486786, 0.04241107404232025, -0.09543664753437042, -0.3029018044471741, -0.04277811944484711, 0.2716582417488098, -0.523047924041748, -0.18071967363357544, -0.07144048064947128, 0.03861188516020775, 0.19159698486328125, -0.16197028756141663, 0.11606163531541824, 0.12580513954162598, 0.6263625025749207, -0.177474245429039, -0.25605806708335876, -0.09909491240978241, 0.14662785828113556, 0.09606052935123444, 0.08823498338460922, 0.4466221034526825, -0.013539828360080719, 0.2961530387401581, 0.0069792792201042175, 0.4433361887931824, -0.7569162845611572, -0.10434137284755707, 0.2316513955593109, 0.16296745836734772, 0.317338228225708, -0.2062053233385086, 0.15220023691654205, 0.14926019310951233, -0.010930538177490234, -0.03929358720779419, 0.003830552101135254, 0.13626600801944733, -0.25451430678367615, -0.02523086592555046, 0.09549947828054428, 0.01036139577627182, 0.237751767039299, -0.33454427123069763, -0.7154802680015564, 0.5443236827850342, 0.09795154631137848, -0.06266975402832031, -0.07219379395246506, 0.2808901369571686, 0.1608172506093979, 0.04896862432360649, 0.018195249140262604, 0.12562993168830872, -0.21023082733154297, 0.13966104388237, -0.2924342751502991, -0.3491288721561432, 0.23583956062793732, 0.0668221041560173, -0.16026636958122253, 0.19092725217342377, -0.2076505422592163, -0.3481299579143524, -0.060754768550395966, 0.4762542247772217, -0.010165533050894737, -0.043045297265052795, 0.07023071497678757, 0.027810242027044296, -0.0018493607640266418, -0.024249732494354248, -0.010808974504470825, -0.19973137974739075, 0.36513975262641907, -0.005385022610425949, 0.21003258228302002, 0.12096516788005829, 0.23414769768714905, 0.6629341840744019, 0.2986569106578827, -0.26258647441864014, 0.48292893171310425, 0.14715524017810822, 0.3824756443500519, -0.09323772042989731, -0.12832331657409668, 0.043160077184438705, -0.42171725630760193, 0.16042350232601166, 0.3062993586063385, 0.2176848202943802, 0.07901469618082047, -0.007288411259651184, 0.10102979093790054, -0.14085571467876434, 0.1357249915599823, 0.2023206353187561, -0.09430621564388275, 0.08038634061813354, -0.32445234060287476, -0.5464377999305725, -0.30456793308258057, -0.24072003364562988, 0.26052117347717285, 0.5148712992668152, 0.36885905265808105, -0.01071595773100853, -0.09405429661273956, 0.022176962345838547, 0.0051009636372327805, 0.4282033443450928, 0.23541821539402008, -0.031561583280563354, -0.10141222923994064, -0.16945184767246246, -0.0277397520840168, 0.037644121795892715, 0.5556623339653015, -0.37614691257476807, -0.3156662881374359, -0.07436030358076096, -0.1065940260887146, -0.03514069318771362, 0.07922312617301941, -0.10132838785648346, 0.04471897706389427, 0.21187886595726013, 0.6619707345962524, 0.07113108038902283, -0.07036417722702026, -0.3740348517894745, 0.3671357035636902, 0.2360800802707672, -0.22162288427352905, 0.06587022542953491, 0.30404603481292725, -0.5974193811416626, -0.39217743277549744, 0.29827582836151123, -0.17010658979415894, -0.046184953302145004, -0.28669726848602295, 0.07280214875936508, -0.05968515947461128, 0.2881055772304535, -0.17737196385860443, 0.07524444907903671, 0.038176171481609344, 0.09201236814260483, 0.0056553613394498825, 0.22441799938678741, 0.5355525016784668, 0.4676252603530884, 0.18312372267246246, -0.004805769771337509, 0.2779061198234558, 0.03395281359553337, 0.3708232045173645, 0.3918319642543793, 0.29205089807510376, 0.18852952122688293, -0.12736967206001282, 0.19915646314620972, -0.6660865545272827, 0.36193978786468506, 0.43995964527130127, -0.4130321741104126, -0.2826988399028778, -0.07723738253116608, 0.610917329788208, -0.03651735931634903, 0.07692348957061768, 0.24370165169239044, 0.5407893657684326, 0.07233815640211105, -0.19082900881767273, 0.17103195190429688, 1.0284374952316284, -0.023008089512586594, 0.34470334649086, -0.32950517535209656, -0.0008170381188392639, 0.1900504231452942, -0.5964158773422241, -0.04093679040670395, -0.17498189210891724, -0.2694917321205139, -0.12375278770923615, -0.004850760102272034, 0.11073918640613556, 0.05647015571594238, -0.17809247970581055, -0.05783281475305557, 0.10536408424377441, 0.24164167046546936, -0.18310636281967163, 0.2766071557998657, -0.31180864572525024, -0.36028853058815, -0.31636181473731995, 0.113317109644413, -0.022235743701457977, -0.003835574723780155, -0.09998524188995361, -0.222528338432312, -0.10377621650695801, 0.28363290429115295, -0.378591388463974, -0.1468721628189087, 0.009990915656089783, 0.004203427582979202, 0.05465910956263542, 0.10966859757900238, 0.24861207604408264, -0.1040952205657959, -0.08569243550300598, -0.03303707391023636, -0.2633291184902191, 0.07480308413505554, -0.23175279796123505, 0.10904304683208466, -0.11823882162570953, -0.2066555768251419, 0.5347590446472168, -0.18283295631408691, -0.04001590609550476, 0.26164039969444275, 0.15502114593982697, -0.04665365070104599, -0.1791488081216812, 0.003774607554078102, 0.07626201212406158, 0.050139401108026505, -0.2958470582962036, -0.11718393862247467, 0.017060816287994385, 0.03888383507728577, 0.001874113455414772, 0.3051243722438812, 0.06317393481731415, 0.07252907752990723, 0.22180233895778656, 0.12409523129463196, -0.18512065708637238, 0.10339361429214478, -0.29985982179641724, -0.4114454388618469, 0.014478074386715889, 0.2860175669193268, -0.11055891215801239, -0.002746269106864929, 0.503583550453186, 0.03920251876115799, -0.12698456645011902, -0.13813531398773193, 0.2358456552028656, -0.17043206095695496, 0.08636665344238281, -0.11667279899120331, 0.22277158498764038, -0.21832332015037537, -0.13661141693592072, -0.1719834804534912, -0.5547020435333252, 0.14272098243236542, -0.23624953627586365, 0.25301486253738403, -0.3365901708602905, -0.18704232573509216, 0.06059274077415466, 0.14246733486652374, -0.22579488158226013, 0.14229793846607208, 0.04072035849094391, 0.11828422546386719, 0.023492880165576935, -0.06876767426729202, 0.03581341728568077, 0.17780271172523499, -0.06930818408727646, -0.02923753298819065, -0.34771275520324707, -0.01610429212450981, -0.21569131314754486, 0.21090632677078247, 0.364131897687912, -0.07193294167518616, 0.15774405002593994, -0.04439576715230942, -0.2470133900642395, -0.22935980558395386, 0.07739979773759842, -0.12774576246738434, -0.0532095804810524, -0.14925497770309448, 0.17865586280822754, -0.21163281798362732, 0.08648629486560822, 0.0835949033498764, 0.34979045391082764, 0.41978177428245544, 0.12680965662002563, -0.17201115190982819, 0.011580422520637512, -0.04794823378324509, -0.08718720078468323, 0.1957831084728241, 0.24364978075027466, 0.16955208778381348, 0.36791494488716125, 0.09683500230312347, 0.16390857100486755, -0.13682915270328522, 0.20959174633026123, -0.10537884384393692, -0.04389515146613121, 0.16941997408866882, 0.3406499922275543, 0.1548156887292862, 0.052677422761917114, -0.04674690589308739, 0.2376156449317932, -0.25776785612106323, 0.31787109375, 0.10017625987529755, 0.3072836697101593, 0.29580432176589966, -0.06350305676460266, -0.21569781005382538, 0.016902610659599304, -0.0504516065120697, 0.1256454586982727, 0.008982082828879356, 0.026859015226364136, 0.05629982426762581, -0.044196996837854385, 0.3010173439979553, 0.12182112783193588, 0.46513229608535767, -0.4601949453353882, 0.003906555473804474, 0.07082466781139374, -0.3097861409187317, 0.2522503137588501, -0.4798177480697632, -0.15083001554012299, 0.293642520904541, 0.3095782399177551, 0.32720208168029785, 0.057195745408535004, -0.025448627769947052, -0.07739745080471039, -0.06673399358987808, -0.2640064060688019, 0.15355466306209564, 0.2960958778858185, 0.1536833941936493, 0.16914303600788116, -0.22036337852478027, -0.4073503017425537, 0.1418379545211792, -0.13587288558483124, -0.00854954868555069, -0.04070322588086128, 0.39081382751464844, 0.14917594194412231, 0.09661506116390228, -0.16177359223365784, 0.07595781236886978, 0.6384892463684082, -0.036007534712553024, -0.22829569876194, 0.44326871633529663, 0.08389909565448761, -0.014737661927938461, -0.04307694733142853, 0.2149021327495575, 0.2935481667518616, -0.20011523365974426, 0.22312220931053162, -0.012191690504550934, 0.11133063584566116, 0.1149572879076004, 0.16147691011428833, 0.11751817166805267, 0.20627310872077942, 0.013648666441440582, 0.000652167946100235, -0.16192786395549774, -0.0006397501565515995, -0.3457314670085907, 0.1562052071094513, -0.5755260586738586, 0.07675594091415405, -0.19405969977378845, -0.11488621681928635, -0.25919657945632935, 0.03859109804034233, -0.38956573605537415, -0.19395284354686737, 0.3893873691558838, -0.4727872908115387, -0.09337363392114639, -0.09997466206550598, 0.033334530889987946, -0.3077848255634308, 0.3286776542663574, 0.41568154096603394, -0.1276625096797943, -0.058575354516506195, 0.04180020093917847, -0.2975563406944275, -0.02772919461131096, 0.05036546289920807, -0.10044336318969727, -0.10185235738754272, -0.03113352134823799, 0.12370699644088745, 0.22784645855426788, 0.18264618515968323, -0.13799990713596344, 0.2451559603214264, 0.09154823422431946, -0.3671330213546753, -0.018128130584955215, 0.1519140899181366, 0.12828350067138672, -0.11812595278024673, -0.1336822658777237, 0.035819537937641144, -0.13387878239154816, 0.027846142649650574, 0.01136738806962967, -0.27328425645828247, -0.10820352286100388, -0.14816658198833466, 0.4665796160697937, 0.11644494533538818, 0.3846239149570465, -0.11672236025333405, -0.4097687304019928, -0.30008184909820557, 0.03111550584435463, -0.14716896414756775, -0.14678999781608582, 0.03551087900996208, 0.6247460246086121, -0.28093332052230835, 0.17413955926895142, -0.13863655924797058, 0.210953950881958, -0.026582568883895874, -0.0020459219813346863, -0.1517023742198944, -0.10479027032852173, -0.22237178683280945, -0.0347067266702652, 0.4033024311065674, 0.23546861112117767, -0.13338303565979004, -0.1512472927570343, -0.24589426815509796, 0.01058083027601242, 0.4392372667789459, -0.45975029468536377, -0.40882638096809387, 0.19363699853420258, -0.028849944472312927, 0.25653746724128723, 0.2986580729484558, 0.038659557700157166, -0.05929342657327652, 0.2128022015094757, 0.05096455290913582, 0.16174820065498352, 0.309073269367218, -0.13922762870788574, -0.2600865662097931, -0.026625122874975204, -0.16479220986366272, -0.058796368539333344, 0.049423739314079285, 0.06523440778255463, -0.16660034656524658 ]
https://github.com/huggingface/datasets/issues/5888
True. I spend a good 4 months just mixing and matching existing solutions so I could get performance that would not IO bound my model training. This is what I ended up with, in case it's useful https://github.com/AntreasAntoniou/TALI/blob/045cf9e5aa75b1bf2c6d5351fb910fa10e3ff32c/tali/data/data_plus.py#L85
A way to upload and visualize .mp4 files (millions of them) as part of a dataset
**Is your feature request related to a problem? Please describe.** I recently chose to use huggingface hub as the home for a large multi modal dataset I've been building. https://huggingface.co/datasets/Antreas/TALI It combines images, text, audio and video. Now, I could very easily upload a dataset made via datasets.Dataset.from_generator, as long as it did not include video files. I found that including .mp4 files in the entries would not auto-upload those files. Hence I tried to upload them myself. I quickly found out that uploading many small files is a very bad way to use git lfs, and that it would take ages, so, I resorted to using 7z to pack them all up. But then I had a new problem. My dataset had a size of 1.9TB. Trying to upload such a large file with the default huggingface_hub API always resulted in time outs etc. So I decided to split the large files into chunks of 5GB each and reupload. So, eventually it all worked out. But now the dataset can't be properly and natively used by the datasets API because of all the needed preprocessing -- and furthermore the hub is unable to visualize things. **Describe the solution you'd like** A native way to upload large datasets that include .mp4 or other video types. **Describe alternatives you've considered** Already explained earlier **Additional context** https://huggingface.co/datasets/Antreas/TALI
38
A way to upload and visualize .mp4 files (millions of them) as part of a dataset **Is your feature request related to a problem? Please describe.** I recently chose to use huggingface hub as the home for a large multi modal dataset I've been building. https://huggingface.co/datasets/Antreas/TALI It combines images, text, audio and video. Now, I could very easily upload a dataset made via datasets.Dataset.from_generator, as long as it did not include video files. I found that including .mp4 files in the entries would not auto-upload those files. Hence I tried to upload them myself. I quickly found out that uploading many small files is a very bad way to use git lfs, and that it would take ages, so, I resorted to using 7z to pack them all up. But then I had a new problem. My dataset had a size of 1.9TB. Trying to upload such a large file with the default huggingface_hub API always resulted in time outs etc. So I decided to split the large files into chunks of 5GB each and reupload. So, eventually it all worked out. But now the dataset can't be properly and natively used by the datasets API because of all the needed preprocessing -- and furthermore the hub is unable to visualize things. **Describe the solution you'd like** A native way to upload large datasets that include .mp4 or other video types. **Describe alternatives you've considered** Already explained earlier **Additional context** https://huggingface.co/datasets/Antreas/TALI True. I spend a good 4 months just mixing and matching existing solutions so I could get performance that would not IO bound my model training. This is what I ended up with, in case it's useful https://github.com/AntreasAntoniou/TALI/blob/045cf9e5aa75b1bf2c6d5351fb910fa10e3ff32c/tali/data/data_plus.py#L85
[ -0.5507328510284424, -0.29418110847473145, -0.01599453017115593, 0.0892653837800026, 0.3306483328342438, 0.0404433012008667, 0.036232225596904755, 0.4525602459907532, -0.12330783903598785, 0.005729686468839645, -0.13260167837142944, 0.14337515830993652, -0.3638761639595032, 0.7047359943389893, 0.02442454919219017, -0.12300613522529602, 0.06652182340621948, 0.2663642466068268, 0.10747618228197098, 0.21573489904403687, 0.06604412198066711, -0.2635611593723297, 0.2601034343242645, -0.25053519010543823, -0.6568789482116699, -0.06390458345413208, -0.1554528772830963, 0.18117639422416687, -0.1203596293926239, -0.27678394317626953, -0.2701580822467804, 0.06310158967971802, 0.6025241017341614, 0.5976272225379944, -0.00011641602031886578, -0.27889910340309143, 0.2970741093158722, -0.20351922512054443, -0.2235567569732666, 0.1152476817369461, -0.036496277898550034, -0.3385831117630005, 0.08467071503400803, -0.020748429000377655, 0.0353325754404068, -0.43332454562187195, 0.1638965606689453, -0.3458309769630432, 0.10766597092151642, -0.22983327507972717, 0.07287431508302689, 0.1773080974817276, -0.12531238794326782, 0.20159408450126648, 0.0840657502412796, 0.6263934373855591, -0.2806284427642822, 0.0801687091588974, 0.6582972407341003, 0.01396062970161438, -0.09653589129447937, 0.11872784793376923, 0.2556033134460449, -0.23395438492298126, 0.4774656295776367, -0.06765793263912201, 0.07482002675533295, -0.46125131845474243, -0.171725332736969, 0.2724744975566864, 0.49593988060951233, -0.02155940979719162, -0.6107125282287598, -0.36181938648223877, 0.11985774338245392, -0.14006951451301575, -0.10256465524435043, 0.40020182728767395, -0.17403215169906616, 0.20239010453224182, -0.24847444891929626, -0.050411026924848557, -0.33471834659576416, 0.24498315155506134, 0.23510697484016418, -0.476420521736145, 0.0033317208290100098, -0.07993404567241669, 0.16089223325252533, -0.30645260214805603, -0.09382498264312744, -0.19781112670898438, 0.36980196833610535, 0.05802540481090546, -0.11661064624786377, -0.2640463709831238, -0.06715275347232819, 0.41938701272010803, 0.059069663286209106, 0.13097400963306427, -0.09798331558704376, 0.2664927542209625, -0.5706445574760437, 0.08523499965667725, 0.08720040321350098, -0.008257262408733368, -0.060304414480924606, -0.33943280577659607, 0.3697173595428467, 0.3311091363430023, -0.09382254630327225, -0.08218549191951752, -0.2921135425567627, 0.026994280517101288, -0.5053141117095947, -0.02375274896621704, 0.011062614619731903, 0.022127866744995117, -0.2054692804813385, -0.16679832339286804, -0.28346139192581177, 0.09696755558252335, 0.026767104864120483, 0.11160411685705185, -0.17559906840324402, 0.294981449842453, -0.3088694214820862, 0.2553989887237549, 0.0472353994846344, -0.5500246286392212, 0.01613520085811615, 0.07382670044898987, -0.2774658203125, 0.47714436054229736, 0.16000662744045258, -0.27490752935409546, -0.097797691822052, -0.03840070217847824, 0.4131220281124115, 0.14108002185821533, 0.0964544489979744, -0.1743093878030777, 0.04233420267701149, 0.07865434885025024, -0.06233148276805878, 0.08053374290466309, 0.09415598213672638, 0.14142674207687378, -0.12367196381092072, 0.017214005813002586, 0.007966534234583378, -0.3984741270542145, -0.13865572214126587, 0.006666955538094044, -0.17877274751663208, 0.09249214828014374, -0.4585808515548706, 0.26892903447151184, -0.3184240460395813, -0.096950963139534, -0.1223730742931366, 0.22160495817661285, 0.06728793680667877, -0.28932812809944153, -0.005450092256069183, 0.45906901359558105, -0.35448843240737915, 0.1026926264166832, -0.2818191945552826, 0.1545167863368988, 0.1128816157579422, 0.28594890236854553, -0.00015227869153022766, 0.09301832318305969, -0.20004233717918396, 0.08966439962387085, 0.21355734765529633, -0.6537609696388245, -0.05515667796134949, 0.4199485182762146, -0.031236998736858368, 0.45311853289604187, 0.19047978520393372, 0.3776765465736389, -0.052126556634902954, -0.2747025787830353, 0.26040512323379517, 0.3804171085357666, -0.047697607427835464, -0.08917218446731567, -0.1526148021221161, -0.6418266296386719, -0.030756663531064987, 0.2694820761680603, -0.020265188068151474, -0.1055803894996643, 0.14851373434066772, -0.40006572008132935, 0.227093905210495, -0.1741793155670166, 0.4449206292629242, -0.15364234149456024, 0.40447503328323364, 0.03200587257742882, -0.27334722876548767, -0.36380618810653687, -0.4594368636608124, 0.16538497805595398, -0.04475018009543419, -0.13256292045116425, -0.13997942209243774, -0.2805401086807251, 0.27424168586730957, -0.3472273349761963, -0.05947348475456238, 0.109268918633461, 0.019219502806663513, 0.0735197514295578, -0.32401683926582336, 0.02916647493839264, -0.3890637755393982, 0.17997556924819946, 0.016136959195137024, 0.05994337424635887, -0.014546968042850494, 0.3566867411136627, 0.14767862856388092, -0.1613057553768158, -0.005617260932922363, 0.12431657314300537, 0.11601847410202026, -0.13705720007419586, 0.13932859897613525, -0.00030234677251428366, -0.09798933565616608, 0.3582800626754761, 0.4346318542957306, 0.7155175805091858, 0.39265090227127075, -0.23490920662879944, 0.13474582135677338, -0.1822611391544342, 0.019368529319763184, -0.10374855995178223, -0.13697263598442078, 0.28205105662345886, -0.213497132062912, 0.015120580792427063, 0.22758862376213074, -0.00324857234954834, 0.023563385009765625, 0.14242896437644958, -0.20046797394752502, -0.1480514109134674, 0.005626652389764786, 0.21761895716190338, 0.11987294256687164, -0.2027573436498642, -0.042710550129413605, 0.08931326866149902, 0.470567524433136, -0.02086513116955757, -0.10928300023078918, 0.17271815240383148, -0.2752419412136078, 0.00183761864900589, 0.1527871936559677, -0.05272865667939186, 0.22250449657440186, 0.23120778799057007, -0.09346619248390198, -0.13067114353179932, 0.3958207368850708, -0.06991315633058548, -0.060236647725105286, 0.20128008723258972, 0.04543546587228775, 0.2553190290927887, 0.22677862644195557, 0.15131685137748718, -0.07518010586500168, -0.19279202818870544, 0.2081156075000763, -0.13358843326568604, -0.016299277544021606, -0.037541259080171585, -0.28335559368133545, -0.0685461014509201, 0.22080472111701965, -0.4859039783477783, -0.1604793518781662, -0.04930148646235466, 0.04699182137846947, 0.1833655685186386, -0.1721639335155487, 0.09550989419221878, 0.1374485045671463, 0.6302833557128906, -0.14719532430171967, -0.2608467638492584, -0.081720732152462, 0.17161938548088074, 0.053566824644804, 0.06338639557361603, 0.5294675230979919, -0.06322059035301208, 0.2532791197299957, -0.04785240441560745, 0.35072848200798035, -0.6234491467475891, -0.13541586697101593, 0.19131585955619812, 0.158067524433136, 0.3363865911960602, -0.263083815574646, 0.1549740731716156, 0.20165900886058807, -0.03128313273191452, 0.02125738188624382, 0.010550759732723236, 0.09423664957284927, -0.23116618394851685, 0.004057593643665314, 0.09111938625574112, -0.02645297721028328, 0.16836538910865784, -0.34606534242630005, -0.7152798175811768, 0.5306104421615601, 0.0881706178188324, -0.053941287100315094, 0.03814457729458809, 0.3405689001083374, 0.13706858456134796, -0.013048335909843445, -0.022523608058691025, 0.1501321792602539, -0.19847732782363892, 0.19756150245666504, -0.21994546055793762, -0.3829667270183563, 0.14271125197410583, 0.049233339726924896, -0.13765421509742737, 0.1747012883424759, -0.19707706570625305, -0.3517330288887024, -0.11949974298477173, 0.4603673219680786, -0.016588831320405006, -0.059237100183963776, 0.02665824443101883, -0.005424473434686661, -0.0004713200032711029, -0.011515341699123383, 0.0413956493139267, -0.09890198707580566, 0.3447055220603943, 0.040203675627708435, 0.16123688220977783, 0.11900933086872101, 0.24205750226974487, 0.7277494072914124, 0.3081018924713135, -0.3051011264324188, 0.488576740026474, 0.14544208347797394, 0.33822140097618103, -0.08543628454208374, -0.15234646201133728, 0.04918414354324341, -0.40066877007484436, 0.14803068339824677, 0.33456557989120483, 0.2177823781967163, 0.0941612720489502, -0.011267341673374176, 0.09822162985801697, -0.08849723637104034, 0.06527809798717499, 0.2384977638721466, -0.03770115599036217, -0.006665579974651337, -0.2758404314517975, -0.5428350567817688, -0.3217508792877197, -0.22791947424411774, 0.2785547971725464, 0.5385780334472656, 0.309397429227829, -0.031040918081998825, -0.0844925194978714, -0.0012400783598423004, -0.05006778612732887, 0.3496052026748657, 0.23057526350021362, -0.0738184005022049, -0.07564693689346313, -0.19586648046970367, -0.008694089949131012, -0.014236416667699814, 0.6929493546485901, -0.29527217149734497, -0.2670958340167999, -0.07930000871419907, -0.12097977101802826, -0.07210011035203934, 0.025355741381645203, -0.11436282098293304, 0.041073285043239594, 0.2517227828502655, 0.8646030426025391, 0.04652915894985199, -0.11922532320022583, -0.4467308223247528, 0.3782680332660675, 0.22135503590106964, -0.19980067014694214, 0.031596481800079346, 0.2848876714706421, -0.5923954844474792, -0.355363667011261, 0.3062669634819031, -0.12311719357967377, -0.09191402792930603, -0.27557212114334106, 0.20312315225601196, -0.05776403844356537, 0.28519365191459656, -0.1285385638475418, 0.07533285021781921, 0.06613859534263611, 0.12262324243783951, -0.006746804807335138, 0.21270506083965302, 0.5779155492782593, 0.5351236462593079, 0.1483801156282425, -0.0007520653307437897, 0.24512764811515808, -0.008337818086147308, 0.2938547730445862, 0.5093817114830017, 0.30966436862945557, 0.22561867535114288, -0.1401015818119049, 0.2161417007446289, -0.6499102115631104, 0.4159490764141083, 0.4450036883354187, -0.4024936854839325, -0.24155399203300476, -0.1010938510298729, 0.6335674524307251, -0.06970220059156418, 0.0728188306093216, 0.22808143496513367, 0.5256091952323914, 0.05672432482242584, -0.1627005934715271, 0.11606335639953613, 1.138953685760498, -0.028188377618789673, 0.3813736140727997, -0.26932206749916077, -0.00656600296497345, 0.22697997093200684, -0.6415086984634399, -0.02680395357310772, -0.17930132150650024, -0.2842172086238861, -0.0796239823102951, -0.02229512482881546, 0.07583504915237427, 0.08441942185163498, -0.12492254376411438, -0.09263186156749725, 0.123119056224823, 0.20382502675056458, -0.1836021989583969, 0.3150583505630493, -0.30670228600502014, -0.31252819299697876, -0.34471672773361206, 0.08407649397850037, 0.0008141626603901386, -0.006942540407180786, -0.06906481087207794, -0.3057680130004883, -0.1821119487285614, 0.2683447599411011, -0.34162867069244385, -0.1326518952846527, -0.021097473800182343, 0.01688026264309883, 0.07092966139316559, 0.03865547478199005, 0.2249140739440918, -0.1224653571844101, -0.11915872991085052, -0.07913868874311447, -0.2767829895019531, 0.07669837772846222, -0.2813728451728821, 0.17638078331947327, -0.16551867127418518, -0.2328675091266632, 0.5854623913764954, -0.18809175491333008, -0.027207404375076294, 0.22175389528274536, 0.13235913217067719, -0.012446187436580658, -0.15469864010810852, -0.031029891222715378, 0.10659558326005936, 0.02415631338953972, -0.3238527476787567, -0.09847727417945862, 0.03438875079154968, 0.012155689299106598, -0.010698409751057625, 0.24738335609436035, 0.04304814338684082, 0.09701570123434067, 0.22204047441482544, 0.08091601729393005, -0.15005864202976227, 0.1445309817790985, -0.27514445781707764, -0.3628634214401245, 0.07592090964317322, 0.28807586431503296, -0.10579989850521088, 0.0027659982442855835, 0.4892978370189667, 0.12028443813323975, -0.1860552430152893, -0.09456635266542435, 0.23881465196609497, -0.14739470183849335, 0.06856079399585724, -0.09880659729242325, 0.2603178918361664, -0.2500491142272949, -0.10467597842216492, -0.15669921040534973, -0.5708906650543213, 0.15396541357040405, -0.24851810932159424, 0.27909430861473083, -0.37691619992256165, -0.09502780437469482, 0.08050180971622467, 0.20960795879364014, -0.2187199592590332, 0.1687244474887848, 0.029576748609542847, 0.11520260572433472, -0.003263276070356369, -0.09249088913202286, 0.0599416121840477, 0.16071882843971252, -0.09836843609809875, -0.03751938045024872, -0.39048153162002563, -0.007409632205963135, -0.23133373260498047, 0.20723113417625427, 0.37222960591316223, -0.08483864367008209, 0.18722721934318542, -0.05735832825303078, -0.22335198521614075, -0.25538671016693115, 0.08427484333515167, -0.15098699927330017, -0.04245731607079506, -0.13502007722854614, 0.2359241545200348, -0.22206756472587585, 0.08092650771141052, 0.08598333597183228, 0.33342742919921875, 0.41345083713531494, 0.1717151552438736, -0.16985493898391724, -0.04532274603843689, -0.05477023124694824, -0.11272202432155609, 0.2299158126115799, 0.21689555048942566, 0.13177341222763062, 0.3410241901874542, 0.07709755748510361, 0.15099984407424927, -0.14422398805618286, 0.22693265974521637, -0.011839887127280235, -0.057815030217170715, 0.14767958223819733, 0.32267051935195923, 0.12113633006811142, 0.0312662273645401, -0.06344334781169891, 0.2453955113887787, -0.2993083894252777, 0.3149286210536957, 0.11449483036994934, 0.2763849198818207, 0.29156339168548584, 0.009278429672122002, -0.19039353728294373, 0.07378563284873962, 0.051312174648046494, 0.0920632928609848, 0.03999433293938637, 0.011689096689224243, 0.09788040816783905, -0.0007133185863494873, 0.27821987867355347, 0.14289534091949463, 0.5051438212394714, -0.47641628980636597, 0.0028103068470954895, 0.021482881158590317, -0.2978883385658264, 0.20513656735420227, -0.5423496961593628, -0.17786359786987305, 0.30375033617019653, 0.29102641344070435, 0.30885645747184753, 0.04521467164158821, 0.09609408676624298, -0.07700096070766449, -0.12324348092079163, -0.21583887934684753, 0.18766750395298004, 0.24947641789913177, 0.09327355027198792, 0.16873744130134583, -0.2928750514984131, -0.44913190603256226, 0.17522358894348145, -0.16394546627998352, 0.004642159678041935, 0.01652788370847702, 0.39215847849845886, 0.1574867218732834, 0.12203074991703033, -0.22564610838890076, 0.05081827938556671, 0.6391264796257019, -0.0979878157377243, -0.1458650529384613, 0.5013148784637451, 0.046784985810518265, 0.00623316690325737, -0.11312539875507355, 0.2389790117740631, 0.26618534326553345, -0.14745797216892242, 0.21442683041095734, 0.05754553899168968, 0.12976187467575073, 0.09129659086465836, 0.1484135091304779, 0.18553727865219116, 0.17246399819850922, 0.06919988989830017, -0.024840211495757103, -0.17467999458312988, 0.008797966875135899, -0.3279118239879608, 0.17136290669441223, -0.6037507057189941, 0.1374431848526001, -0.17948973178863525, -0.13947813212871552, -0.25071653723716736, 0.010065656155347824, -0.39564192295074463, -0.1257806271314621, 0.4111209809780121, -0.48952072858810425, -0.08896282315254211, -0.07396519929170609, 0.021209459751844406, -0.30621516704559326, 0.37718087434768677, 0.45275941491127014, -0.14279629290103912, -0.10012692213058472, 0.0931561291217804, -0.29634055495262146, -0.014769110828638077, 0.03521737456321716, 0.032437317073345184, -0.1502200961112976, 0.0030023232102394104, 0.18806207180023193, 0.18578779697418213, 0.2175406962633133, -0.14579695463180542, 0.20140132308006287, 0.07101599872112274, -0.38734063506126404, -0.005565278232097626, 0.06768786907196045, 0.16887150704860687, -0.10520027577877045, -0.1413934975862503, 0.06942752003669739, -0.1904384344816208, 0.006994277238845825, 0.025990121066570282, -0.3091541528701782, -0.09362129867076874, -0.17805437743663788, 0.4513557553291321, 0.0796373188495636, 0.4189482629299164, -0.12760600447654724, -0.45544540882110596, -0.27964094281196594, 0.08061645179986954, -0.16943460702896118, -0.16504856944084167, 0.03587237372994423, 0.6641260385513306, -0.2996854782104492, 0.17558002471923828, -0.16667556762695312, 0.17999085783958435, -0.020812474191188812, -0.04032382741570473, -0.11647170782089233, -0.10389828681945801, -0.1923372596502304, -0.08273382484912872, 0.41208013892173767, 0.2677529454231262, -0.12479279935359955, -0.19596511125564575, -0.29652297496795654, -0.008399434387683868, 0.5003413558006287, -0.4694075286388397, -0.4175838828086853, 0.21818861365318298, -0.03553175926208496, 0.19215568900108337, 0.3155284523963928, -0.08933530002832413, -0.0874306857585907, 0.1801748275756836, 0.07170155644416809, 0.09210142493247986, 0.35838255286216736, -0.10980956256389618, -0.2673337459564209, -0.027501262724399567, -0.09629800170660019, -0.07399342209100723, 0.026369601488113403, 0.0769834816455841, -0.16674885153770447 ]
https://github.com/huggingface/datasets/issues/5881
cc @lhoestq in case you have any ideas here! Might need a multi-host set-up to debug (can give you access to a JAX one if you need)
Split dataset by node: index error when sharding iterable dataset
### Describe the bug Context: we're splitting an iterable dataset by node and then passing it to a torch data loader with multiple workers When we iterate over it for 5 steps, we don't get an error When we instead iterate over it for 8 steps, we get an `IndexError` when fetching the data if we have too many workers ### Steps to reproduce the bug Here, we have 2 JAX processes (`jax.process_count() = 2`) which we split the dataset over. The dataset loading script can be found here: https://huggingface.co/datasets/distil-whisper/librispeech_asr/blob/c6a1e805cbfeed5057400ac5937327d7e30281b8/librispeech_asr.py#L310 <details> <summary> Code to reproduce </summary> ```python from datasets import load_dataset import jax from datasets.distributed import split_dataset_by_node from torch.utils.data import DataLoader from tqdm import tqdm # load an example dataset (https://huggingface.co/datasets/distil-whisper/librispeech_asr) dataset = load_dataset("distil-whisper/librispeech_asr", "all", split="train.clean.100", streaming=True) # just keep the text column -> no need to define a collator dataset_text = dataset.remove_columns(set(dataset.features.keys()) - {"text"}) # define some constants batch_size = 256 num_examples = 5 # works for 5 examples, doesn't for 8 num_workers = dataset_text.n_shards # try with multiple workers dataloader = DataLoader(dataset_text, batch_size=batch_size, num_workers=num_workers, drop_last=True) for i, batch in tqdm(enumerate(dataloader), total=num_examples, desc="Multiple workers"): if i == num_examples: break # try splitting by node (we can't do this with `dataset_text` since `split_dataset_by_node` expects the Audio column for an ASR dataset) dataset = split_dataset_by_node(dataset, rank=jax.process_index(), world_size=jax.process_count()) # remove the text column again dataset_text = dataset.remove_columns(set(dataset.features.keys()) - {"text"}) dataloader = DataLoader(dataset_text, batch_size=16, num_workers=num_workers // 2, drop_last=True) for i, batch in tqdm(enumerate(dataloader), total=num_examples, desc="Split by node"): if i == num_examples: break # too many workers dataloader = DataLoader(dataset_text, batch_size=256, num_workers=num_workers, drop_last=True) for i, batch in tqdm(enumerate(dataloader), total=num_examples, desc="Too many workers"): if i == num_examples: break ``` </details> <details> <summary> With 5 examples: </summary> ``` Multiple workers: 100%|███████████████████████████████████████████████████████████████████| 5/5 [00:16<00:00, 3.33s/it] Assigning 7 shards (or data sources) of the dataset to each node. Split by node: 100%|██████████████████████████████████████████████████████████████████████| 5/5 [00:13<00:00, 2.76s/it] Assigning 7 shards (or data sources) of the dataset to each node. Too many dataloader workers: 14 (max is dataset.n_shards=7). Stopping 7 dataloader workers. To parallelize data loading, we give each process some shards (or data sources) to process. Therefore it's unnecessary t o have a number of workers greater than dataset.n_shards=7. To enable more parallelism, please split the dataset in more files than 7. Too many workers: 100%|███████████████████████████████████████████████████████████████████| 5/5 [00:15<00:00, 3.03s/it] ``` </details> <details> <summary> With 7 examples: </summary> ``` Multiple workers: 100%|███████████████████████████████████████████████████████████████████| 8/8 [00:13<00:00, 1.71s/it] Assigning 7 shards (or data sources) of the dataset to each node. Split by node: 100%|██████████████████████████████████████████████████████████████████████| 8/8 [00:11<00:00, 1.38s/it] Assigning 7 shards (or data sources) of the dataset to each node. Too many dataloader workers: 14 (max is dataset.n_shards=7). Stopping 7 dataloader workers. To parallelize data loading, we give each process some shards (or data sources) to process. Therefore it's unnecessary to have a number of workers greater than dataset.n_shards=7. To enable more parallelism, please split the dataset in more files than 7. Too many workers: 88%|██████████████████████████████████████████████████████████▋ | 7/8 [00:13<00:01, 1.89s/it] Traceback (most recent call last): File "distil-whisper/test_librispeech.py", line 36, in <module> for i, batch in tqdm(enumerate(dataloader), total=num_examples, desc="Too many workers"): File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/tqdm/std.py", line 1178, in __iter__ for obj in iterable: File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 633, in __next__ data = self._next_data() File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1325, in _next_data return self._process_data(data) File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1371, in _process_data data.reraise() File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/_utils.py", line 644, in reraise raise exception IndexError: Caught IndexError in DataLoader worker process 7. Original Traceback (most recent call last): File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop data = fetcher.fetch(index) File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 32, in fetch data.append(next(self.dataset_iter)) File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 986, in __iter__ yield from self._iter_pytorch(ex_iterable) File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 920, in _iter_pytorch for key, example in ex_iterable.shard_data_sources(worker_info.id, worker_info.num_workers): File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 540, in shard_data_sources self.ex_iterable.shard_data_sources(worker_id, num_workers), File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 796, in shard_data_sources self.ex_iterable.shard_data_sources(worker_id, num_workers), File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 126, in shard_data_sources requested_gen_kwargs = _merge_gen_kwargs([gen_kwargs_list[i] for i in shard_indices]) File "/home/sanchitgandhi/datasets/src/datasets/utils/sharding.py", line 76, in _merge_gen_kwargs for key in gen_kwargs_list[0] IndexError: list index out of range ``` </details> ### Expected behavior Should pass for both 5 and 7 examples ### Environment info - `datasets` version: 2.12.1.dev0 - Platform: Linux-5.13.0-1023-gcp-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.1
27
Split dataset by node: index error when sharding iterable dataset ### Describe the bug Context: we're splitting an iterable dataset by node and then passing it to a torch data loader with multiple workers When we iterate over it for 5 steps, we don't get an error When we instead iterate over it for 8 steps, we get an `IndexError` when fetching the data if we have too many workers ### Steps to reproduce the bug Here, we have 2 JAX processes (`jax.process_count() = 2`) which we split the dataset over. The dataset loading script can be found here: https://huggingface.co/datasets/distil-whisper/librispeech_asr/blob/c6a1e805cbfeed5057400ac5937327d7e30281b8/librispeech_asr.py#L310 <details> <summary> Code to reproduce </summary> ```python from datasets import load_dataset import jax from datasets.distributed import split_dataset_by_node from torch.utils.data import DataLoader from tqdm import tqdm # load an example dataset (https://huggingface.co/datasets/distil-whisper/librispeech_asr) dataset = load_dataset("distil-whisper/librispeech_asr", "all", split="train.clean.100", streaming=True) # just keep the text column -> no need to define a collator dataset_text = dataset.remove_columns(set(dataset.features.keys()) - {"text"}) # define some constants batch_size = 256 num_examples = 5 # works for 5 examples, doesn't for 8 num_workers = dataset_text.n_shards # try with multiple workers dataloader = DataLoader(dataset_text, batch_size=batch_size, num_workers=num_workers, drop_last=True) for i, batch in tqdm(enumerate(dataloader), total=num_examples, desc="Multiple workers"): if i == num_examples: break # try splitting by node (we can't do this with `dataset_text` since `split_dataset_by_node` expects the Audio column for an ASR dataset) dataset = split_dataset_by_node(dataset, rank=jax.process_index(), world_size=jax.process_count()) # remove the text column again dataset_text = dataset.remove_columns(set(dataset.features.keys()) - {"text"}) dataloader = DataLoader(dataset_text, batch_size=16, num_workers=num_workers // 2, drop_last=True) for i, batch in tqdm(enumerate(dataloader), total=num_examples, desc="Split by node"): if i == num_examples: break # too many workers dataloader = DataLoader(dataset_text, batch_size=256, num_workers=num_workers, drop_last=True) for i, batch in tqdm(enumerate(dataloader), total=num_examples, desc="Too many workers"): if i == num_examples: break ``` </details> <details> <summary> With 5 examples: </summary> ``` Multiple workers: 100%|███████████████████████████████████████████████████████████████████| 5/5 [00:16<00:00, 3.33s/it] Assigning 7 shards (or data sources) of the dataset to each node. Split by node: 100%|██████████████████████████████████████████████████████████████████████| 5/5 [00:13<00:00, 2.76s/it] Assigning 7 shards (or data sources) of the dataset to each node. Too many dataloader workers: 14 (max is dataset.n_shards=7). Stopping 7 dataloader workers. To parallelize data loading, we give each process some shards (or data sources) to process. Therefore it's unnecessary t o have a number of workers greater than dataset.n_shards=7. To enable more parallelism, please split the dataset in more files than 7. Too many workers: 100%|███████████████████████████████████████████████████████████████████| 5/5 [00:15<00:00, 3.03s/it] ``` </details> <details> <summary> With 7 examples: </summary> ``` Multiple workers: 100%|███████████████████████████████████████████████████████████████████| 8/8 [00:13<00:00, 1.71s/it] Assigning 7 shards (or data sources) of the dataset to each node. Split by node: 100%|██████████████████████████████████████████████████████████████████████| 8/8 [00:11<00:00, 1.38s/it] Assigning 7 shards (or data sources) of the dataset to each node. Too many dataloader workers: 14 (max is dataset.n_shards=7). Stopping 7 dataloader workers. To parallelize data loading, we give each process some shards (or data sources) to process. Therefore it's unnecessary to have a number of workers greater than dataset.n_shards=7. To enable more parallelism, please split the dataset in more files than 7. Too many workers: 88%|██████████████████████████████████████████████████████████▋ | 7/8 [00:13<00:01, 1.89s/it] Traceback (most recent call last): File "distil-whisper/test_librispeech.py", line 36, in <module> for i, batch in tqdm(enumerate(dataloader), total=num_examples, desc="Too many workers"): File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/tqdm/std.py", line 1178, in __iter__ for obj in iterable: File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 633, in __next__ data = self._next_data() File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1325, in _next_data return self._process_data(data) File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1371, in _process_data data.reraise() File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/_utils.py", line 644, in reraise raise exception IndexError: Caught IndexError in DataLoader worker process 7. Original Traceback (most recent call last): File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop data = fetcher.fetch(index) File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 32, in fetch data.append(next(self.dataset_iter)) File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 986, in __iter__ yield from self._iter_pytorch(ex_iterable) File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 920, in _iter_pytorch for key, example in ex_iterable.shard_data_sources(worker_info.id, worker_info.num_workers): File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 540, in shard_data_sources self.ex_iterable.shard_data_sources(worker_id, num_workers), File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 796, in shard_data_sources self.ex_iterable.shard_data_sources(worker_id, num_workers), File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 126, in shard_data_sources requested_gen_kwargs = _merge_gen_kwargs([gen_kwargs_list[i] for i in shard_indices]) File "/home/sanchitgandhi/datasets/src/datasets/utils/sharding.py", line 76, in _merge_gen_kwargs for key in gen_kwargs_list[0] IndexError: list index out of range ``` </details> ### Expected behavior Should pass for both 5 and 7 examples ### Environment info - `datasets` version: 2.12.1.dev0 - Platform: Linux-5.13.0-1023-gcp-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.1 cc @lhoestq in case you have any ideas here! Might need a multi-host set-up to debug (can give you access to a JAX one if you need)
[ -0.3438449800014496, -0.11162509024143219, -0.059762854129076004, 0.2692221403121948, 0.06411129981279373, -0.08080780506134033, 0.8632721900939941, 0.330071359872818, -0.07778079807758331, 0.38194793462753296, 0.10152041167020798, 0.276222825050354, -0.19482579827308655, -0.008883349597454071, -0.22051949799060822, -0.16358238458633423, -0.13677209615707397, 0.028592877089977264, -0.04727735370397568, 0.14974665641784668, -0.14812955260276794, 0.08956090360879898, -0.13839074969291687, -0.17494525015354156, -0.5069965124130249, -0.08194999396800995, -0.052564457058906555, 0.22942529618740082, 0.1871800720691681, -0.1730796992778778, 0.18940415978431702, -0.2384277582168579, 0.31375813484191895, 0.6929024457931519, -0.00011501891276566312, 0.25776606798171997, 0.26057422161102295, 0.03154964745044708, -0.03852492570877075, 0.017169184982776642, -0.31468719244003296, -0.21539029479026794, -0.025413895025849342, -0.19543904066085815, 0.014529570937156677, 0.19854187965393066, -0.16817604005336761, -0.4060784578323364, 0.19296258687973022, -0.004398193210363388, 0.1252109408378601, 0.42142942547798157, -0.22948682308197021, 0.08848123252391815, 0.37135154008865356, -0.04809847101569176, -0.2256813943386078, -0.34595006704330444, 0.14573663473129272, 0.3530295789241791, -0.4983476400375366, 0.3899678587913513, -0.011802241206169128, 0.30606189370155334, -0.06520858407020569, -0.12325949966907501, -0.07440686970949173, -0.2600533068180084, 0.030875418335199356, 0.2490033209323883, 0.15054675936698914, 0.05635581538081169, -0.2193720042705536, -0.34921592473983765, -0.27360302209854126, -0.4609352946281433, 0.23649658262729645, 0.13464310765266418, 0.010170649737119675, -0.1534854918718338, -0.03681666776537895, 0.3354247808456421, 0.16056641936302185, -0.01868608221411705, 0.034703731536865234, 0.44645002484321594, -0.055033959448337555, 0.2567899227142334, 0.14537152647972107, -0.0423869788646698, 0.4998518228530884, 0.2416340708732605, -0.022470485419034958, -0.027803611010313034, -0.4694574773311615, 0.005570530891418457, 0.25780051946640015, -0.4518275856971741, 0.07932440936565399, 0.1836942732334137, 0.012518517673015594, 0.1465364694595337, 0.4381676912307739, 0.06581627577543259, 0.2714841961860657, -0.04581703245639801, -0.03476007282733917, 0.23730899393558502, 0.09607915580272675, -0.014199990779161453, -0.18655958771705627, -0.06303967535495758, 0.23482052981853485, -0.594344437122345, -0.0746755301952362, 0.22123102843761444, 0.2145417332649231, 0.08825437724590302, -0.3502674102783203, -0.14902791380882263, 0.06731224060058594, -0.17589347064495087, 0.3210279643535614, 0.2829552888870239, 0.4365255832672119, 0.10689302533864975, -0.25760436058044434, 0.1853434145450592, -0.43111181259155273, -0.43715882301330566, -0.2631233334541321, -0.18361011147499084, -0.10531088709831238, 0.05340423434972763, 0.0325583890080452, -0.47668907046318054, 0.12241272628307343, -0.09812820702791214, 0.10560695827007294, -0.16971763968467712, 0.08566869795322418, -0.2834489941596985, 0.15386390686035156, 0.16695016622543335, 0.16956384479999542, 0.09462899714708328, 0.22358299791812897, -0.07868417352437973, -0.13108818233013153, -0.00807228498160839, -0.24845324456691742, -0.5659595131874084, 0.05551818758249283, 0.10174743086099625, 0.0014003664255142212, 0.24806931614875793, -0.032730069011449814, -0.10086999833583832, 0.68349689245224, 0.20576779544353485, 0.06986892223358154, -0.08470260351896286, -0.41655927896499634, -0.060385897755622864, -0.012896772474050522, 0.38937312364578247, 0.38848942518234253, 0.05406300723552704, -0.20576563477516174, 0.14869658648967743, 0.355957955121994, 0.29074761271476746, -0.20229575037956238, 0.2572838068008423, -0.3243243992328644, 0.4978307783603668, 0.2238818258047104, 0.020009055733680725, -0.23654574155807495, 0.610176682472229, -0.10847077518701553, -0.1348373293876648, 0.2252633273601532, 0.25122150778770447, 0.4450564682483673, -0.09887471795082092, 0.0020835231989622116, 0.3371255099773407, -0.2411145567893982, 0.12891457974910736, -0.20604625344276428, 0.12726999819278717, 0.22414907813072205, 0.0951991081237793, 0.2630665600299835, -0.10833574831485748, 0.22143124043941498, -0.2286709100008011, 0.33204373717308044, -0.008047889918088913, 0.1255904734134674, 0.20992185175418854, -0.26144444942474365, -0.01638040319085121, 0.1783977448940277, -0.07875107228755951, -0.16513420641422272, 0.21234583854675293, 0.045277804136276245, -0.16687685251235962, -0.11544281244277954, 0.05067187547683716, -0.05463682487607002, 0.08591650426387787, -0.3980554938316345, -0.1270928978919983, -0.006519149988889694, 0.02972489222884178, -0.20926231145858765, -0.36619752645492554, -0.21071100234985352, 0.004442421719431877, -0.293293833732605, 0.07524164021015167, -0.4437686502933502, 0.34814324975013733, 0.06757522374391556, -0.21426409482955933, 0.11930254101753235, 0.20214970409870148, 0.21025574207305908, -0.2823067605495453, -0.09134414792060852, 0.3711341917514801, 0.2723773121833801, 0.20008420944213867, 0.0033730219583958387, -0.06240759789943695, 0.0911707729101181, -0.2199992537498474, -0.1300281286239624, 0.262588232755661, 0.02250637114048004, -0.23306390643119812, 0.15338104963302612, 0.22076961398124695, -0.44566014409065247, 0.4176091253757477, -0.22179925441741943, 0.04414123296737671, 0.23078376054763794, -0.01644626259803772, -0.01827748864889145, -0.11827869713306427, 0.23885373771190643, -0.33923977613449097, -0.20398558676242828, -0.10016053169965744, -0.26540830731391907, 0.028408046811819077, 0.12395887821912766, 0.18440721929073334, 0.032208263874053955, -0.12662196159362793, 0.04371343553066254, 0.13596399128437042, 0.13246341049671173, 0.11938329041004181, 0.2938385605812073, 0.039534397423267365, 0.04798634722828865, -0.3687019348144531, 0.32352662086486816, -0.19636601209640503, 0.059668753296136856, 0.08938979357481003, 0.24247336387634277, 0.5059559345245361, -0.05187685042619705, -0.1219668909907341, -0.14888626337051392, -0.2594757676124573, 0.1518929898738861, 0.22751528024673462, -0.1954062581062317, 0.12288284301757812, -0.024677392095327377, 0.04748895764350891, -0.1707400381565094, -0.19474071264266968, -0.07350398600101471, -0.5424302816390991, -0.11156290024518967, 0.27437883615493774, -0.40874865651130676, 0.17775306105613708, -0.3823961019515991, -0.18706277012825012, 0.2629019320011139, 0.012626191601157188, 0.023970648646354675, -0.09336161613464355, 0.04737892001867294, -0.03200468420982361, 0.4437195956707001, 0.13984675705432892, 0.10288578271865845, -0.11052596569061279, -0.020595744252204895, -0.5600925087928772, -0.005880862474441528, 0.16628697514533997, -0.1003769189119339, 0.08530788123607635, 0.20185774564743042, -0.1319066286087036, -0.02786673977971077, -0.385656476020813, 0.16456454992294312, -0.0974668636918068, 0.03973832726478577, 0.5179474353790283, 0.1012248769402504, 0.07391095161437988, 0.16862383484840393, -0.44629573822021484, 0.05391066521406174, -0.4113641083240509, -0.03431927040219307, -0.04448305070400238, 0.24551059305667877, -0.04470188543200493, 0.008647497743368149, -0.11531931161880493, 0.24237129092216492, -0.29062992334365845, -0.047836799174547195, -0.28901249170303345, 0.22524328529834747, -0.23081457614898682, -0.25233176350593567, -0.10044857114553452, -0.08465811610221863, 0.04036732763051987, 0.2026907056570053, -0.3353070616722107, 0.5409305095672607, -0.11044429242610931, 0.15327709913253784, 0.054353825747966766, -0.11912894248962402, 0.3324001431465149, 0.14356815814971924, -0.0167330801486969, -0.07638774067163467, 0.15976297855377197, -0.07824812829494476, -0.22069285809993744, 0.22515755891799927, 0.016101505607366562, 0.38758569955825806, 0.19957181811332703, 0.8008944988250732, 0.08712093532085419, -0.21172268688678741, 0.3181616961956024, 0.04786843806505203, -0.15943534672260284, -0.00504637137055397, -0.4321867823600769, 0.14884158968925476, -0.17597927153110504, -0.22254008054733276, 0.17707253992557526, -0.1393132507801056, -0.1661672294139862, 0.04961993545293808, -0.16427677869796753, 0.0558350533246994, -0.41685938835144043, 0.2628035545349121, -0.12832441926002502, 0.29465028643608093, -0.04014792665839195, 0.15651562809944153, 0.010776914656162262, -0.29810285568237305, -0.1432410180568695, 0.1143587976694107, 0.1395328938961029, -0.08204783499240875, -0.07235288619995117, 0.11901050806045532, -0.3381306827068329, 0.3269035816192627, 0.24589461088180542, 0.5223236083984375, 0.17046597599983215, -0.3455694019794464, 0.07765015214681625, 0.07001899182796478, 0.4913504421710968, -0.14523804187774658, 0.052420008927583694, 0.10914488136768341, -0.11817087233066559, -0.2523905038833618, -0.11002233624458313, -0.15723955631256104, 0.6813249588012695, 0.2064385563135147, 0.35917234420776367, -0.13642098009586334, -0.16711586713790894, 0.07672164589166641, -0.11894358694553375, -0.18317961692810059, -0.27558374404907227, -0.41504526138305664, -0.1429484486579895, -0.09259918332099915, 0.39226630330085754, 0.09156960248947144, 0.3258490562438965, -0.010322920978069305, -0.07995223253965378, -0.43436646461486816, -0.31874215602874756, 0.015319332480430603, 0.0455060712993145, 0.13930237293243408, -0.2906055152416229, 0.4903109073638916, 0.10548681020736694, 0.28006747364997864, 0.16264712810516357, 0.20658189058303833, -0.12347374856472015, 0.09992282092571259, 0.23389652371406555, -0.2367369532585144, 0.17167411744594574, 0.2993243336677551, -0.10286767780780792, 0.10750813782215118, 0.03813745081424713, 0.2871139645576477, -0.21003392338752747, -0.22306419909000397, 0.08570864051580429, 0.06605561077594757, -0.35896044969558716, 0.002867288887500763, 0.21957933902740479, -0.13291719555854797, 0.11987555027008057, 0.24089503288269043, -0.19196583330631256, -0.042227838188409805, 0.31813135743141174, 0.1707494556903839, 0.7980759143829346, -0.11169441044330597, -0.155856654047966, 0.18495474755764008, 0.39763781428337097, 0.12332674115896225, -0.37463030219078064, 0.44500744342803955, -0.24254804849624634, -0.5292295813560486, 0.02541467547416687, -0.21296821534633636, 0.00625976175069809, 0.07795839011669159, 0.05230739712715149, 0.3415234386920929, -0.2717165946960449, -0.03298069164156914, -0.3577460050582886, 0.21510353684425354, -0.34070298075675964, -0.31247907876968384, 0.10991200804710388, -0.002352531999349594, 0.022973041981458664, 0.17978844046592712, 0.01003364846110344, -0.12466810643672943, 0.25398075580596924, -0.21319951117038727, 0.09406152367591858, 0.04120428115129471, 0.14820703864097595, 0.3950643539428711, 0.18744787573814392, -0.457807332277298, 0.17841270565986633, 0.08401927351951599, 0.0020345747470855713, -0.3836970329284668, 0.15634191036224365, 0.05886358395218849, 0.02934211865067482, 0.02995464578270912, 0.03590349107980728, 0.06647704541683197, 0.24922657012939453, 0.0687730461359024, -0.09829522669315338, -0.26716896891593933, 0.08007296919822693, -0.5441076755523682, -0.020266443490982056, 0.4983738660812378, -0.023849621415138245, -0.4951120615005493, 0.20486409962177277, 0.16571161150932312, -0.33130237460136414, -0.338945209980011, 0.08130699396133423, 0.06486108899116516, -0.27412575483322144, 0.23969799280166626, -0.06613902747631073, -0.21246305108070374, 0.07253146916627884, 0.24141040444374084, 0.06679999083280563, 0.13673913478851318, 0.23875561356544495, 0.38418900966644287, -0.3391035199165344, -0.22439929842948914, 0.13611510396003723, 0.2881627678871155, -0.32730773091316223, 0.16809430718421936, -0.6817811131477356, 0.16712269186973572, 0.04192555323243141, 0.10756072402000427, -0.053486816585063934, 0.23522034287452698, -0.2647675573825836, -0.3609103560447693, -0.18761605024337769, 0.16922669112682343, -0.19017387926578522, 0.09088478982448578, -0.3585607707500458, 0.3009413182735443, -0.07837677747011185, 0.2833218574523926, -0.19196617603302002, 0.10449861735105515, -0.25036200881004333, 0.37123510241508484, 0.3594561815261841, -0.1394890397787094, 0.20720194280147552, -0.014672618359327316, -0.07644155621528625, 0.2628307342529297, -0.028378766030073166, -0.1517658233642578, -0.026549652218818665, 0.084556944668293, 0.05889132618904114, -0.03217014670372009, -0.11266660690307617, -0.010733447968959808, -0.04890317842364311, -0.3369462490081787, 0.09212519228458405, 0.15427210927009583, -0.10413634777069092, -0.07781516015529633, 0.3401317596435547, 0.11216072738170624, -0.2310267984867096, 0.1092635914683342, -0.05362534895539284, 0.048359550535678864, -0.22230491042137146, 0.30777841806411743, 0.14588651061058044, 0.1078614667057991, 0.07473570108413696, -0.007430873811244965, 0.45512855052948, -0.08227663487195969, 0.20268507301807404, -0.3707015812397003, 0.019446812570095062, 0.10227389633655548, 0.25933340191841125, 0.28406837582588196, -0.24100889265537262, -0.26977959275245667, 0.07382255792617798, 0.1536070853471756, -0.04040451720356941, -0.13044333457946777, 0.008766904473304749, 0.25412410497665405, 0.008432351052761078, 0.32455867528915405, 0.20138520002365112, -0.17074362933635712, -0.3658846914768219, 0.22889889776706696, 0.10773167014122009, -0.5555316209793091, -0.04221409931778908, 0.2259974628686905, -0.3348045349121094, -0.15160386264324188, 0.44845470786094666, -0.10797494649887085, 0.1053956151008606, 0.6386840343475342, -0.32888779044151306, 0.6917989253997803, 0.4502895176410675, 0.04650295898318291, -0.0352647602558136, -0.2893158197402954, -0.1300385296344757, 0.1584775745868683, 0.08131128549575806, -0.03900061175227165, -0.126889169216156, 0.5756785273551941, 0.10583509504795074, 0.1932360976934433, -0.03449384495615959, 0.15215767920017242, -0.17565323412418365, -0.09567072987556458, -0.03509800136089325, -0.04379485547542572, -0.3183518052101135, -0.1622897833585739, 0.07982505857944489, 0.22904205322265625, 0.3686935603618622, 0.20221324265003204, -0.14544528722763062, -0.15695315599441528, 0.24044255912303925, 0.1969013214111328, 0.07290048897266388, -0.49579715728759766, 0.05238790810108185, 0.1520342230796814, 0.04074789583683014, 0.16955405473709106, -0.005256975069642067, 0.41977912187576294, 0.09432302415370941, -0.2429410219192505, 0.010428223758935928, -0.021739959716796875, -0.031197667121887207, -0.11776010692119598, 0.22224068641662598, -0.5038411617279053, -0.007595771923661232, 0.4173905849456787, 0.015115462243556976, -0.06838637590408325, -0.06676729023456573, 0.3372841775417328, 0.5952528715133667, -0.037178970873355865, 0.13875631988048553, -0.259573370218277, -0.06760063022375107, 0.07793234288692474, 0.05293336138129234, -0.11815958470106125, 0.013904109597206116, 0.43503591418266296, -0.39145055413246155, 0.1994735598564148, 0.08012169599533081, 0.04307737946510315, -0.26520511507987976, 0.2603907883167267, -0.06454484909772873, -0.1810779720544815, -0.30568593740463257, -0.08557318896055222, -0.28827399015426636, 0.04439615458250046, -0.26938748359680176, -0.06680061668157578, 0.17496445775032043, 0.6394560933113098, -0.18824654817581177, 0.1542435735464096, 0.2322542369365692, -0.12694716453552246, 0.03581786900758743, 0.511904776096344, -0.024080932140350342, -0.1004648506641388, -0.3710812032222748, 0.025487763807177544, 0.1378103792667389, -0.45650357007980347, 0.04752367362380028, 0.1902155578136444, 0.03421269357204437, -0.02019883319735527, -0.15831637382507324, 0.29096245765686035, -0.04865967482328415, 0.003985201939940453, 0.13636815547943115, 0.1310267597436905, 0.01951807737350464, 0.09167253226041794, -0.398184210062027, -0.5995730757713318, -0.22755590081214905, 0.2800934910774231, 0.21206073462963104, 0.2037011981010437, -0.1424187868833542, 0.048324085772037506, -0.48533159494400024, 0.3997977077960968, -0.20950493216514587, 0.38638433814048767, -0.31341177225112915, 0.1726750135421753, -0.3916029632091522, 0.4229358732700348, 0.03502563014626503, 0.3047019839286804, 0.06721025705337524, 0.1649753600358963, -0.08483660221099854, -0.6327115297317505, 0.18227559328079224, -0.5119244456291199, -0.27522826194763184, -0.21841859817504883, 0.1954069584608078, 0.5580602288246155, 0.2668323218822479, -0.31660473346710205, -0.1393490433692932, 0.11953988671302795, 0.02322189137339592, -0.09547615051269531, -0.24119055271148682, 0.3332935869693756, -0.1537964642047882, -0.07702012360095978, -0.42775171995162964, 0.2288769781589508, -0.14806292951107025, 0.15461556613445282, -0.15733899176120758 ]
https://github.com/huggingface/datasets/issues/5881
I am also facing the same problem. Could you let me know if you found a solution for this?
Split dataset by node: index error when sharding iterable dataset
### Describe the bug Context: we're splitting an iterable dataset by node and then passing it to a torch data loader with multiple workers When we iterate over it for 5 steps, we don't get an error When we instead iterate over it for 8 steps, we get an `IndexError` when fetching the data if we have too many workers ### Steps to reproduce the bug Here, we have 2 JAX processes (`jax.process_count() = 2`) which we split the dataset over. The dataset loading script can be found here: https://huggingface.co/datasets/distil-whisper/librispeech_asr/blob/c6a1e805cbfeed5057400ac5937327d7e30281b8/librispeech_asr.py#L310 <details> <summary> Code to reproduce </summary> ```python from datasets import load_dataset import jax from datasets.distributed import split_dataset_by_node from torch.utils.data import DataLoader from tqdm import tqdm # load an example dataset (https://huggingface.co/datasets/distil-whisper/librispeech_asr) dataset = load_dataset("distil-whisper/librispeech_asr", "all", split="train.clean.100", streaming=True) # just keep the text column -> no need to define a collator dataset_text = dataset.remove_columns(set(dataset.features.keys()) - {"text"}) # define some constants batch_size = 256 num_examples = 5 # works for 5 examples, doesn't for 8 num_workers = dataset_text.n_shards # try with multiple workers dataloader = DataLoader(dataset_text, batch_size=batch_size, num_workers=num_workers, drop_last=True) for i, batch in tqdm(enumerate(dataloader), total=num_examples, desc="Multiple workers"): if i == num_examples: break # try splitting by node (we can't do this with `dataset_text` since `split_dataset_by_node` expects the Audio column for an ASR dataset) dataset = split_dataset_by_node(dataset, rank=jax.process_index(), world_size=jax.process_count()) # remove the text column again dataset_text = dataset.remove_columns(set(dataset.features.keys()) - {"text"}) dataloader = DataLoader(dataset_text, batch_size=16, num_workers=num_workers // 2, drop_last=True) for i, batch in tqdm(enumerate(dataloader), total=num_examples, desc="Split by node"): if i == num_examples: break # too many workers dataloader = DataLoader(dataset_text, batch_size=256, num_workers=num_workers, drop_last=True) for i, batch in tqdm(enumerate(dataloader), total=num_examples, desc="Too many workers"): if i == num_examples: break ``` </details> <details> <summary> With 5 examples: </summary> ``` Multiple workers: 100%|███████████████████████████████████████████████████████████████████| 5/5 [00:16<00:00, 3.33s/it] Assigning 7 shards (or data sources) of the dataset to each node. Split by node: 100%|██████████████████████████████████████████████████████████████████████| 5/5 [00:13<00:00, 2.76s/it] Assigning 7 shards (or data sources) of the dataset to each node. Too many dataloader workers: 14 (max is dataset.n_shards=7). Stopping 7 dataloader workers. To parallelize data loading, we give each process some shards (or data sources) to process. Therefore it's unnecessary t o have a number of workers greater than dataset.n_shards=7. To enable more parallelism, please split the dataset in more files than 7. Too many workers: 100%|███████████████████████████████████████████████████████████████████| 5/5 [00:15<00:00, 3.03s/it] ``` </details> <details> <summary> With 7 examples: </summary> ``` Multiple workers: 100%|███████████████████████████████████████████████████████████████████| 8/8 [00:13<00:00, 1.71s/it] Assigning 7 shards (or data sources) of the dataset to each node. Split by node: 100%|██████████████████████████████████████████████████████████████████████| 8/8 [00:11<00:00, 1.38s/it] Assigning 7 shards (or data sources) of the dataset to each node. Too many dataloader workers: 14 (max is dataset.n_shards=7). Stopping 7 dataloader workers. To parallelize data loading, we give each process some shards (or data sources) to process. Therefore it's unnecessary to have a number of workers greater than dataset.n_shards=7. To enable more parallelism, please split the dataset in more files than 7. Too many workers: 88%|██████████████████████████████████████████████████████████▋ | 7/8 [00:13<00:01, 1.89s/it] Traceback (most recent call last): File "distil-whisper/test_librispeech.py", line 36, in <module> for i, batch in tqdm(enumerate(dataloader), total=num_examples, desc="Too many workers"): File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/tqdm/std.py", line 1178, in __iter__ for obj in iterable: File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 633, in __next__ data = self._next_data() File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1325, in _next_data return self._process_data(data) File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1371, in _process_data data.reraise() File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/_utils.py", line 644, in reraise raise exception IndexError: Caught IndexError in DataLoader worker process 7. Original Traceback (most recent call last): File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop data = fetcher.fetch(index) File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 32, in fetch data.append(next(self.dataset_iter)) File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 986, in __iter__ yield from self._iter_pytorch(ex_iterable) File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 920, in _iter_pytorch for key, example in ex_iterable.shard_data_sources(worker_info.id, worker_info.num_workers): File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 540, in shard_data_sources self.ex_iterable.shard_data_sources(worker_id, num_workers), File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 796, in shard_data_sources self.ex_iterable.shard_data_sources(worker_id, num_workers), File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 126, in shard_data_sources requested_gen_kwargs = _merge_gen_kwargs([gen_kwargs_list[i] for i in shard_indices]) File "/home/sanchitgandhi/datasets/src/datasets/utils/sharding.py", line 76, in _merge_gen_kwargs for key in gen_kwargs_list[0] IndexError: list index out of range ``` </details> ### Expected behavior Should pass for both 5 and 7 examples ### Environment info - `datasets` version: 2.12.1.dev0 - Platform: Linux-5.13.0-1023-gcp-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.1
19
Split dataset by node: index error when sharding iterable dataset ### Describe the bug Context: we're splitting an iterable dataset by node and then passing it to a torch data loader with multiple workers When we iterate over it for 5 steps, we don't get an error When we instead iterate over it for 8 steps, we get an `IndexError` when fetching the data if we have too many workers ### Steps to reproduce the bug Here, we have 2 JAX processes (`jax.process_count() = 2`) which we split the dataset over. The dataset loading script can be found here: https://huggingface.co/datasets/distil-whisper/librispeech_asr/blob/c6a1e805cbfeed5057400ac5937327d7e30281b8/librispeech_asr.py#L310 <details> <summary> Code to reproduce </summary> ```python from datasets import load_dataset import jax from datasets.distributed import split_dataset_by_node from torch.utils.data import DataLoader from tqdm import tqdm # load an example dataset (https://huggingface.co/datasets/distil-whisper/librispeech_asr) dataset = load_dataset("distil-whisper/librispeech_asr", "all", split="train.clean.100", streaming=True) # just keep the text column -> no need to define a collator dataset_text = dataset.remove_columns(set(dataset.features.keys()) - {"text"}) # define some constants batch_size = 256 num_examples = 5 # works for 5 examples, doesn't for 8 num_workers = dataset_text.n_shards # try with multiple workers dataloader = DataLoader(dataset_text, batch_size=batch_size, num_workers=num_workers, drop_last=True) for i, batch in tqdm(enumerate(dataloader), total=num_examples, desc="Multiple workers"): if i == num_examples: break # try splitting by node (we can't do this with `dataset_text` since `split_dataset_by_node` expects the Audio column for an ASR dataset) dataset = split_dataset_by_node(dataset, rank=jax.process_index(), world_size=jax.process_count()) # remove the text column again dataset_text = dataset.remove_columns(set(dataset.features.keys()) - {"text"}) dataloader = DataLoader(dataset_text, batch_size=16, num_workers=num_workers // 2, drop_last=True) for i, batch in tqdm(enumerate(dataloader), total=num_examples, desc="Split by node"): if i == num_examples: break # too many workers dataloader = DataLoader(dataset_text, batch_size=256, num_workers=num_workers, drop_last=True) for i, batch in tqdm(enumerate(dataloader), total=num_examples, desc="Too many workers"): if i == num_examples: break ``` </details> <details> <summary> With 5 examples: </summary> ``` Multiple workers: 100%|███████████████████████████████████████████████████████████████████| 5/5 [00:16<00:00, 3.33s/it] Assigning 7 shards (or data sources) of the dataset to each node. Split by node: 100%|██████████████████████████████████████████████████████████████████████| 5/5 [00:13<00:00, 2.76s/it] Assigning 7 shards (or data sources) of the dataset to each node. Too many dataloader workers: 14 (max is dataset.n_shards=7). Stopping 7 dataloader workers. To parallelize data loading, we give each process some shards (or data sources) to process. Therefore it's unnecessary t o have a number of workers greater than dataset.n_shards=7. To enable more parallelism, please split the dataset in more files than 7. Too many workers: 100%|███████████████████████████████████████████████████████████████████| 5/5 [00:15<00:00, 3.03s/it] ``` </details> <details> <summary> With 7 examples: </summary> ``` Multiple workers: 100%|███████████████████████████████████████████████████████████████████| 8/8 [00:13<00:00, 1.71s/it] Assigning 7 shards (or data sources) of the dataset to each node. Split by node: 100%|██████████████████████████████████████████████████████████████████████| 8/8 [00:11<00:00, 1.38s/it] Assigning 7 shards (or data sources) of the dataset to each node. Too many dataloader workers: 14 (max is dataset.n_shards=7). Stopping 7 dataloader workers. To parallelize data loading, we give each process some shards (or data sources) to process. Therefore it's unnecessary to have a number of workers greater than dataset.n_shards=7. To enable more parallelism, please split the dataset in more files than 7. Too many workers: 88%|██████████████████████████████████████████████████████████▋ | 7/8 [00:13<00:01, 1.89s/it] Traceback (most recent call last): File "distil-whisper/test_librispeech.py", line 36, in <module> for i, batch in tqdm(enumerate(dataloader), total=num_examples, desc="Too many workers"): File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/tqdm/std.py", line 1178, in __iter__ for obj in iterable: File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 633, in __next__ data = self._next_data() File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1325, in _next_data return self._process_data(data) File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1371, in _process_data data.reraise() File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/_utils.py", line 644, in reraise raise exception IndexError: Caught IndexError in DataLoader worker process 7. Original Traceback (most recent call last): File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop data = fetcher.fetch(index) File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 32, in fetch data.append(next(self.dataset_iter)) File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 986, in __iter__ yield from self._iter_pytorch(ex_iterable) File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 920, in _iter_pytorch for key, example in ex_iterable.shard_data_sources(worker_info.id, worker_info.num_workers): File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 540, in shard_data_sources self.ex_iterable.shard_data_sources(worker_id, num_workers), File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 796, in shard_data_sources self.ex_iterable.shard_data_sources(worker_id, num_workers), File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 126, in shard_data_sources requested_gen_kwargs = _merge_gen_kwargs([gen_kwargs_list[i] for i in shard_indices]) File "/home/sanchitgandhi/datasets/src/datasets/utils/sharding.py", line 76, in _merge_gen_kwargs for key in gen_kwargs_list[0] IndexError: list index out of range ``` </details> ### Expected behavior Should pass for both 5 and 7 examples ### Environment info - `datasets` version: 2.12.1.dev0 - Platform: Linux-5.13.0-1023-gcp-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.1 I am also facing the same problem. Could you let me know if you found a solution for this?
[ -0.3438449800014496, -0.11162509024143219, -0.059762854129076004, 0.2692221403121948, 0.06411129981279373, -0.08080780506134033, 0.8632721900939941, 0.330071359872818, -0.07778079807758331, 0.38194793462753296, 0.10152041167020798, 0.276222825050354, -0.19482579827308655, -0.008883349597454071, -0.22051949799060822, -0.16358238458633423, -0.13677209615707397, 0.028592877089977264, -0.04727735370397568, 0.14974665641784668, -0.14812955260276794, 0.08956090360879898, -0.13839074969291687, -0.17494525015354156, -0.5069965124130249, -0.08194999396800995, -0.052564457058906555, 0.22942529618740082, 0.1871800720691681, -0.1730796992778778, 0.18940415978431702, -0.2384277582168579, 0.31375813484191895, 0.6929024457931519, -0.00011501891276566312, 0.25776606798171997, 0.26057422161102295, 0.03154964745044708, -0.03852492570877075, 0.017169184982776642, -0.31468719244003296, -0.21539029479026794, -0.025413895025849342, -0.19543904066085815, 0.014529570937156677, 0.19854187965393066, -0.16817604005336761, -0.4060784578323364, 0.19296258687973022, -0.004398193210363388, 0.1252109408378601, 0.42142942547798157, -0.22948682308197021, 0.08848123252391815, 0.37135154008865356, -0.04809847101569176, -0.2256813943386078, -0.34595006704330444, 0.14573663473129272, 0.3530295789241791, -0.4983476400375366, 0.3899678587913513, -0.011802241206169128, 0.30606189370155334, -0.06520858407020569, -0.12325949966907501, -0.07440686970949173, -0.2600533068180084, 0.030875418335199356, 0.2490033209323883, 0.15054675936698914, 0.05635581538081169, -0.2193720042705536, -0.34921592473983765, -0.27360302209854126, -0.4609352946281433, 0.23649658262729645, 0.13464310765266418, 0.010170649737119675, -0.1534854918718338, -0.03681666776537895, 0.3354247808456421, 0.16056641936302185, -0.01868608221411705, 0.034703731536865234, 0.44645002484321594, -0.055033959448337555, 0.2567899227142334, 0.14537152647972107, -0.0423869788646698, 0.4998518228530884, 0.2416340708732605, -0.022470485419034958, -0.027803611010313034, -0.4694574773311615, 0.005570530891418457, 0.25780051946640015, -0.4518275856971741, 0.07932440936565399, 0.1836942732334137, 0.012518517673015594, 0.1465364694595337, 0.4381676912307739, 0.06581627577543259, 0.2714841961860657, -0.04581703245639801, -0.03476007282733917, 0.23730899393558502, 0.09607915580272675, -0.014199990779161453, -0.18655958771705627, -0.06303967535495758, 0.23482052981853485, -0.594344437122345, -0.0746755301952362, 0.22123102843761444, 0.2145417332649231, 0.08825437724590302, -0.3502674102783203, -0.14902791380882263, 0.06731224060058594, -0.17589347064495087, 0.3210279643535614, 0.2829552888870239, 0.4365255832672119, 0.10689302533864975, -0.25760436058044434, 0.1853434145450592, -0.43111181259155273, -0.43715882301330566, -0.2631233334541321, -0.18361011147499084, -0.10531088709831238, 0.05340423434972763, 0.0325583890080452, -0.47668907046318054, 0.12241272628307343, -0.09812820702791214, 0.10560695827007294, -0.16971763968467712, 0.08566869795322418, -0.2834489941596985, 0.15386390686035156, 0.16695016622543335, 0.16956384479999542, 0.09462899714708328, 0.22358299791812897, -0.07868417352437973, -0.13108818233013153, -0.00807228498160839, -0.24845324456691742, -0.5659595131874084, 0.05551818758249283, 0.10174743086099625, 0.0014003664255142212, 0.24806931614875793, -0.032730069011449814, -0.10086999833583832, 0.68349689245224, 0.20576779544353485, 0.06986892223358154, -0.08470260351896286, -0.41655927896499634, -0.060385897755622864, -0.012896772474050522, 0.38937312364578247, 0.38848942518234253, 0.05406300723552704, -0.20576563477516174, 0.14869658648967743, 0.355957955121994, 0.29074761271476746, -0.20229575037956238, 0.2572838068008423, -0.3243243992328644, 0.4978307783603668, 0.2238818258047104, 0.020009055733680725, -0.23654574155807495, 0.610176682472229, -0.10847077518701553, -0.1348373293876648, 0.2252633273601532, 0.25122150778770447, 0.4450564682483673, -0.09887471795082092, 0.0020835231989622116, 0.3371255099773407, -0.2411145567893982, 0.12891457974910736, -0.20604625344276428, 0.12726999819278717, 0.22414907813072205, 0.0951991081237793, 0.2630665600299835, -0.10833574831485748, 0.22143124043941498, -0.2286709100008011, 0.33204373717308044, -0.008047889918088913, 0.1255904734134674, 0.20992185175418854, -0.26144444942474365, -0.01638040319085121, 0.1783977448940277, -0.07875107228755951, -0.16513420641422272, 0.21234583854675293, 0.045277804136276245, -0.16687685251235962, -0.11544281244277954, 0.05067187547683716, -0.05463682487607002, 0.08591650426387787, -0.3980554938316345, -0.1270928978919983, -0.006519149988889694, 0.02972489222884178, -0.20926231145858765, -0.36619752645492554, -0.21071100234985352, 0.004442421719431877, -0.293293833732605, 0.07524164021015167, -0.4437686502933502, 0.34814324975013733, 0.06757522374391556, -0.21426409482955933, 0.11930254101753235, 0.20214970409870148, 0.21025574207305908, -0.2823067605495453, -0.09134414792060852, 0.3711341917514801, 0.2723773121833801, 0.20008420944213867, 0.0033730219583958387, -0.06240759789943695, 0.0911707729101181, -0.2199992537498474, -0.1300281286239624, 0.262588232755661, 0.02250637114048004, -0.23306390643119812, 0.15338104963302612, 0.22076961398124695, -0.44566014409065247, 0.4176091253757477, -0.22179925441741943, 0.04414123296737671, 0.23078376054763794, -0.01644626259803772, -0.01827748864889145, -0.11827869713306427, 0.23885373771190643, -0.33923977613449097, -0.20398558676242828, -0.10016053169965744, -0.26540830731391907, 0.028408046811819077, 0.12395887821912766, 0.18440721929073334, 0.032208263874053955, -0.12662196159362793, 0.04371343553066254, 0.13596399128437042, 0.13246341049671173, 0.11938329041004181, 0.2938385605812073, 0.039534397423267365, 0.04798634722828865, -0.3687019348144531, 0.32352662086486816, -0.19636601209640503, 0.059668753296136856, 0.08938979357481003, 0.24247336387634277, 0.5059559345245361, -0.05187685042619705, -0.1219668909907341, -0.14888626337051392, -0.2594757676124573, 0.1518929898738861, 0.22751528024673462, -0.1954062581062317, 0.12288284301757812, -0.024677392095327377, 0.04748895764350891, -0.1707400381565094, -0.19474071264266968, -0.07350398600101471, -0.5424302816390991, -0.11156290024518967, 0.27437883615493774, -0.40874865651130676, 0.17775306105613708, -0.3823961019515991, -0.18706277012825012, 0.2629019320011139, 0.012626191601157188, 0.023970648646354675, -0.09336161613464355, 0.04737892001867294, -0.03200468420982361, 0.4437195956707001, 0.13984675705432892, 0.10288578271865845, -0.11052596569061279, -0.020595744252204895, -0.5600925087928772, -0.005880862474441528, 0.16628697514533997, -0.1003769189119339, 0.08530788123607635, 0.20185774564743042, -0.1319066286087036, -0.02786673977971077, -0.385656476020813, 0.16456454992294312, -0.0974668636918068, 0.03973832726478577, 0.5179474353790283, 0.1012248769402504, 0.07391095161437988, 0.16862383484840393, -0.44629573822021484, 0.05391066521406174, -0.4113641083240509, -0.03431927040219307, -0.04448305070400238, 0.24551059305667877, -0.04470188543200493, 0.008647497743368149, -0.11531931161880493, 0.24237129092216492, -0.29062992334365845, -0.047836799174547195, -0.28901249170303345, 0.22524328529834747, -0.23081457614898682, -0.25233176350593567, -0.10044857114553452, -0.08465811610221863, 0.04036732763051987, 0.2026907056570053, -0.3353070616722107, 0.5409305095672607, -0.11044429242610931, 0.15327709913253784, 0.054353825747966766, -0.11912894248962402, 0.3324001431465149, 0.14356815814971924, -0.0167330801486969, -0.07638774067163467, 0.15976297855377197, -0.07824812829494476, -0.22069285809993744, 0.22515755891799927, 0.016101505607366562, 0.38758569955825806, 0.19957181811332703, 0.8008944988250732, 0.08712093532085419, -0.21172268688678741, 0.3181616961956024, 0.04786843806505203, -0.15943534672260284, -0.00504637137055397, -0.4321867823600769, 0.14884158968925476, -0.17597927153110504, -0.22254008054733276, 0.17707253992557526, -0.1393132507801056, -0.1661672294139862, 0.04961993545293808, -0.16427677869796753, 0.0558350533246994, -0.41685938835144043, 0.2628035545349121, -0.12832441926002502, 0.29465028643608093, -0.04014792665839195, 0.15651562809944153, 0.010776914656162262, -0.29810285568237305, -0.1432410180568695, 0.1143587976694107, 0.1395328938961029, -0.08204783499240875, -0.07235288619995117, 0.11901050806045532, -0.3381306827068329, 0.3269035816192627, 0.24589461088180542, 0.5223236083984375, 0.17046597599983215, -0.3455694019794464, 0.07765015214681625, 0.07001899182796478, 0.4913504421710968, -0.14523804187774658, 0.052420008927583694, 0.10914488136768341, -0.11817087233066559, -0.2523905038833618, -0.11002233624458313, -0.15723955631256104, 0.6813249588012695, 0.2064385563135147, 0.35917234420776367, -0.13642098009586334, -0.16711586713790894, 0.07672164589166641, -0.11894358694553375, -0.18317961692810059, -0.27558374404907227, -0.41504526138305664, -0.1429484486579895, -0.09259918332099915, 0.39226630330085754, 0.09156960248947144, 0.3258490562438965, -0.010322920978069305, -0.07995223253965378, -0.43436646461486816, -0.31874215602874756, 0.015319332480430603, 0.0455060712993145, 0.13930237293243408, -0.2906055152416229, 0.4903109073638916, 0.10548681020736694, 0.28006747364997864, 0.16264712810516357, 0.20658189058303833, -0.12347374856472015, 0.09992282092571259, 0.23389652371406555, -0.2367369532585144, 0.17167411744594574, 0.2993243336677551, -0.10286767780780792, 0.10750813782215118, 0.03813745081424713, 0.2871139645576477, -0.21003392338752747, -0.22306419909000397, 0.08570864051580429, 0.06605561077594757, -0.35896044969558716, 0.002867288887500763, 0.21957933902740479, -0.13291719555854797, 0.11987555027008057, 0.24089503288269043, -0.19196583330631256, -0.042227838188409805, 0.31813135743141174, 0.1707494556903839, 0.7980759143829346, -0.11169441044330597, -0.155856654047966, 0.18495474755764008, 0.39763781428337097, 0.12332674115896225, -0.37463030219078064, 0.44500744342803955, -0.24254804849624634, -0.5292295813560486, 0.02541467547416687, -0.21296821534633636, 0.00625976175069809, 0.07795839011669159, 0.05230739712715149, 0.3415234386920929, -0.2717165946960449, -0.03298069164156914, -0.3577460050582886, 0.21510353684425354, -0.34070298075675964, -0.31247907876968384, 0.10991200804710388, -0.002352531999349594, 0.022973041981458664, 0.17978844046592712, 0.01003364846110344, -0.12466810643672943, 0.25398075580596924, -0.21319951117038727, 0.09406152367591858, 0.04120428115129471, 0.14820703864097595, 0.3950643539428711, 0.18744787573814392, -0.457807332277298, 0.17841270565986633, 0.08401927351951599, 0.0020345747470855713, -0.3836970329284668, 0.15634191036224365, 0.05886358395218849, 0.02934211865067482, 0.02995464578270912, 0.03590349107980728, 0.06647704541683197, 0.24922657012939453, 0.0687730461359024, -0.09829522669315338, -0.26716896891593933, 0.08007296919822693, -0.5441076755523682, -0.020266443490982056, 0.4983738660812378, -0.023849621415138245, -0.4951120615005493, 0.20486409962177277, 0.16571161150932312, -0.33130237460136414, -0.338945209980011, 0.08130699396133423, 0.06486108899116516, -0.27412575483322144, 0.23969799280166626, -0.06613902747631073, -0.21246305108070374, 0.07253146916627884, 0.24141040444374084, 0.06679999083280563, 0.13673913478851318, 0.23875561356544495, 0.38418900966644287, -0.3391035199165344, -0.22439929842948914, 0.13611510396003723, 0.2881627678871155, -0.32730773091316223, 0.16809430718421936, -0.6817811131477356, 0.16712269186973572, 0.04192555323243141, 0.10756072402000427, -0.053486816585063934, 0.23522034287452698, -0.2647675573825836, -0.3609103560447693, -0.18761605024337769, 0.16922669112682343, -0.19017387926578522, 0.09088478982448578, -0.3585607707500458, 0.3009413182735443, -0.07837677747011185, 0.2833218574523926, -0.19196617603302002, 0.10449861735105515, -0.25036200881004333, 0.37123510241508484, 0.3594561815261841, -0.1394890397787094, 0.20720194280147552, -0.014672618359327316, -0.07644155621528625, 0.2628307342529297, -0.028378766030073166, -0.1517658233642578, -0.026549652218818665, 0.084556944668293, 0.05889132618904114, -0.03217014670372009, -0.11266660690307617, -0.010733447968959808, -0.04890317842364311, -0.3369462490081787, 0.09212519228458405, 0.15427210927009583, -0.10413634777069092, -0.07781516015529633, 0.3401317596435547, 0.11216072738170624, -0.2310267984867096, 0.1092635914683342, -0.05362534895539284, 0.048359550535678864, -0.22230491042137146, 0.30777841806411743, 0.14588651061058044, 0.1078614667057991, 0.07473570108413696, -0.007430873811244965, 0.45512855052948, -0.08227663487195969, 0.20268507301807404, -0.3707015812397003, 0.019446812570095062, 0.10227389633655548, 0.25933340191841125, 0.28406837582588196, -0.24100889265537262, -0.26977959275245667, 0.07382255792617798, 0.1536070853471756, -0.04040451720356941, -0.13044333457946777, 0.008766904473304749, 0.25412410497665405, 0.008432351052761078, 0.32455867528915405, 0.20138520002365112, -0.17074362933635712, -0.3658846914768219, 0.22889889776706696, 0.10773167014122009, -0.5555316209793091, -0.04221409931778908, 0.2259974628686905, -0.3348045349121094, -0.15160386264324188, 0.44845470786094666, -0.10797494649887085, 0.1053956151008606, 0.6386840343475342, -0.32888779044151306, 0.6917989253997803, 0.4502895176410675, 0.04650295898318291, -0.0352647602558136, -0.2893158197402954, -0.1300385296344757, 0.1584775745868683, 0.08131128549575806, -0.03900061175227165, -0.126889169216156, 0.5756785273551941, 0.10583509504795074, 0.1932360976934433, -0.03449384495615959, 0.15215767920017242, -0.17565323412418365, -0.09567072987556458, -0.03509800136089325, -0.04379485547542572, -0.3183518052101135, -0.1622897833585739, 0.07982505857944489, 0.22904205322265625, 0.3686935603618622, 0.20221324265003204, -0.14544528722763062, -0.15695315599441528, 0.24044255912303925, 0.1969013214111328, 0.07290048897266388, -0.49579715728759766, 0.05238790810108185, 0.1520342230796814, 0.04074789583683014, 0.16955405473709106, -0.005256975069642067, 0.41977912187576294, 0.09432302415370941, -0.2429410219192505, 0.010428223758935928, -0.021739959716796875, -0.031197667121887207, -0.11776010692119598, 0.22224068641662598, -0.5038411617279053, -0.007595771923661232, 0.4173905849456787, 0.015115462243556976, -0.06838637590408325, -0.06676729023456573, 0.3372841775417328, 0.5952528715133667, -0.037178970873355865, 0.13875631988048553, -0.259573370218277, -0.06760063022375107, 0.07793234288692474, 0.05293336138129234, -0.11815958470106125, 0.013904109597206116, 0.43503591418266296, -0.39145055413246155, 0.1994735598564148, 0.08012169599533081, 0.04307737946510315, -0.26520511507987976, 0.2603907883167267, -0.06454484909772873, -0.1810779720544815, -0.30568593740463257, -0.08557318896055222, -0.28827399015426636, 0.04439615458250046, -0.26938748359680176, -0.06680061668157578, 0.17496445775032043, 0.6394560933113098, -0.18824654817581177, 0.1542435735464096, 0.2322542369365692, -0.12694716453552246, 0.03581786900758743, 0.511904776096344, -0.024080932140350342, -0.1004648506641388, -0.3710812032222748, 0.025487763807177544, 0.1378103792667389, -0.45650357007980347, 0.04752367362380028, 0.1902155578136444, 0.03421269357204437, -0.02019883319735527, -0.15831637382507324, 0.29096245765686035, -0.04865967482328415, 0.003985201939940453, 0.13636815547943115, 0.1310267597436905, 0.01951807737350464, 0.09167253226041794, -0.398184210062027, -0.5995730757713318, -0.22755590081214905, 0.2800934910774231, 0.21206073462963104, 0.2037011981010437, -0.1424187868833542, 0.048324085772037506, -0.48533159494400024, 0.3997977077960968, -0.20950493216514587, 0.38638433814048767, -0.31341177225112915, 0.1726750135421753, -0.3916029632091522, 0.4229358732700348, 0.03502563014626503, 0.3047019839286804, 0.06721025705337524, 0.1649753600358963, -0.08483660221099854, -0.6327115297317505, 0.18227559328079224, -0.5119244456291199, -0.27522826194763184, -0.21841859817504883, 0.1954069584608078, 0.5580602288246155, 0.2668323218822479, -0.31660473346710205, -0.1393490433692932, 0.11953988671302795, 0.02322189137339592, -0.09547615051269531, -0.24119055271148682, 0.3332935869693756, -0.1537964642047882, -0.07702012360095978, -0.42775171995162964, 0.2288769781589508, -0.14806292951107025, 0.15461556613445282, -0.15733899176120758 ]
https://github.com/huggingface/datasets/issues/5881
I couldn't reproduce with the latest version of `datasets` 2.16.1, can you update `datasets` and try again ?
Split dataset by node: index error when sharding iterable dataset
### Describe the bug Context: we're splitting an iterable dataset by node and then passing it to a torch data loader with multiple workers When we iterate over it for 5 steps, we don't get an error When we instead iterate over it for 8 steps, we get an `IndexError` when fetching the data if we have too many workers ### Steps to reproduce the bug Here, we have 2 JAX processes (`jax.process_count() = 2`) which we split the dataset over. The dataset loading script can be found here: https://huggingface.co/datasets/distil-whisper/librispeech_asr/blob/c6a1e805cbfeed5057400ac5937327d7e30281b8/librispeech_asr.py#L310 <details> <summary> Code to reproduce </summary> ```python from datasets import load_dataset import jax from datasets.distributed import split_dataset_by_node from torch.utils.data import DataLoader from tqdm import tqdm # load an example dataset (https://huggingface.co/datasets/distil-whisper/librispeech_asr) dataset = load_dataset("distil-whisper/librispeech_asr", "all", split="train.clean.100", streaming=True) # just keep the text column -> no need to define a collator dataset_text = dataset.remove_columns(set(dataset.features.keys()) - {"text"}) # define some constants batch_size = 256 num_examples = 5 # works for 5 examples, doesn't for 8 num_workers = dataset_text.n_shards # try with multiple workers dataloader = DataLoader(dataset_text, batch_size=batch_size, num_workers=num_workers, drop_last=True) for i, batch in tqdm(enumerate(dataloader), total=num_examples, desc="Multiple workers"): if i == num_examples: break # try splitting by node (we can't do this with `dataset_text` since `split_dataset_by_node` expects the Audio column for an ASR dataset) dataset = split_dataset_by_node(dataset, rank=jax.process_index(), world_size=jax.process_count()) # remove the text column again dataset_text = dataset.remove_columns(set(dataset.features.keys()) - {"text"}) dataloader = DataLoader(dataset_text, batch_size=16, num_workers=num_workers // 2, drop_last=True) for i, batch in tqdm(enumerate(dataloader), total=num_examples, desc="Split by node"): if i == num_examples: break # too many workers dataloader = DataLoader(dataset_text, batch_size=256, num_workers=num_workers, drop_last=True) for i, batch in tqdm(enumerate(dataloader), total=num_examples, desc="Too many workers"): if i == num_examples: break ``` </details> <details> <summary> With 5 examples: </summary> ``` Multiple workers: 100%|███████████████████████████████████████████████████████████████████| 5/5 [00:16<00:00, 3.33s/it] Assigning 7 shards (or data sources) of the dataset to each node. Split by node: 100%|██████████████████████████████████████████████████████████████████████| 5/5 [00:13<00:00, 2.76s/it] Assigning 7 shards (or data sources) of the dataset to each node. Too many dataloader workers: 14 (max is dataset.n_shards=7). Stopping 7 dataloader workers. To parallelize data loading, we give each process some shards (or data sources) to process. Therefore it's unnecessary t o have a number of workers greater than dataset.n_shards=7. To enable more parallelism, please split the dataset in more files than 7. Too many workers: 100%|███████████████████████████████████████████████████████████████████| 5/5 [00:15<00:00, 3.03s/it] ``` </details> <details> <summary> With 7 examples: </summary> ``` Multiple workers: 100%|███████████████████████████████████████████████████████████████████| 8/8 [00:13<00:00, 1.71s/it] Assigning 7 shards (or data sources) of the dataset to each node. Split by node: 100%|██████████████████████████████████████████████████████████████████████| 8/8 [00:11<00:00, 1.38s/it] Assigning 7 shards (or data sources) of the dataset to each node. Too many dataloader workers: 14 (max is dataset.n_shards=7). Stopping 7 dataloader workers. To parallelize data loading, we give each process some shards (or data sources) to process. Therefore it's unnecessary to have a number of workers greater than dataset.n_shards=7. To enable more parallelism, please split the dataset in more files than 7. Too many workers: 88%|██████████████████████████████████████████████████████████▋ | 7/8 [00:13<00:01, 1.89s/it] Traceback (most recent call last): File "distil-whisper/test_librispeech.py", line 36, in <module> for i, batch in tqdm(enumerate(dataloader), total=num_examples, desc="Too many workers"): File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/tqdm/std.py", line 1178, in __iter__ for obj in iterable: File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 633, in __next__ data = self._next_data() File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1325, in _next_data return self._process_data(data) File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1371, in _process_data data.reraise() File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/_utils.py", line 644, in reraise raise exception IndexError: Caught IndexError in DataLoader worker process 7. Original Traceback (most recent call last): File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop data = fetcher.fetch(index) File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 32, in fetch data.append(next(self.dataset_iter)) File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 986, in __iter__ yield from self._iter_pytorch(ex_iterable) File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 920, in _iter_pytorch for key, example in ex_iterable.shard_data_sources(worker_info.id, worker_info.num_workers): File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 540, in shard_data_sources self.ex_iterable.shard_data_sources(worker_id, num_workers), File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 796, in shard_data_sources self.ex_iterable.shard_data_sources(worker_id, num_workers), File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 126, in shard_data_sources requested_gen_kwargs = _merge_gen_kwargs([gen_kwargs_list[i] for i in shard_indices]) File "/home/sanchitgandhi/datasets/src/datasets/utils/sharding.py", line 76, in _merge_gen_kwargs for key in gen_kwargs_list[0] IndexError: list index out of range ``` </details> ### Expected behavior Should pass for both 5 and 7 examples ### Environment info - `datasets` version: 2.12.1.dev0 - Platform: Linux-5.13.0-1023-gcp-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.1
18
Split dataset by node: index error when sharding iterable dataset ### Describe the bug Context: we're splitting an iterable dataset by node and then passing it to a torch data loader with multiple workers When we iterate over it for 5 steps, we don't get an error When we instead iterate over it for 8 steps, we get an `IndexError` when fetching the data if we have too many workers ### Steps to reproduce the bug Here, we have 2 JAX processes (`jax.process_count() = 2`) which we split the dataset over. The dataset loading script can be found here: https://huggingface.co/datasets/distil-whisper/librispeech_asr/blob/c6a1e805cbfeed5057400ac5937327d7e30281b8/librispeech_asr.py#L310 <details> <summary> Code to reproduce </summary> ```python from datasets import load_dataset import jax from datasets.distributed import split_dataset_by_node from torch.utils.data import DataLoader from tqdm import tqdm # load an example dataset (https://huggingface.co/datasets/distil-whisper/librispeech_asr) dataset = load_dataset("distil-whisper/librispeech_asr", "all", split="train.clean.100", streaming=True) # just keep the text column -> no need to define a collator dataset_text = dataset.remove_columns(set(dataset.features.keys()) - {"text"}) # define some constants batch_size = 256 num_examples = 5 # works for 5 examples, doesn't for 8 num_workers = dataset_text.n_shards # try with multiple workers dataloader = DataLoader(dataset_text, batch_size=batch_size, num_workers=num_workers, drop_last=True) for i, batch in tqdm(enumerate(dataloader), total=num_examples, desc="Multiple workers"): if i == num_examples: break # try splitting by node (we can't do this with `dataset_text` since `split_dataset_by_node` expects the Audio column for an ASR dataset) dataset = split_dataset_by_node(dataset, rank=jax.process_index(), world_size=jax.process_count()) # remove the text column again dataset_text = dataset.remove_columns(set(dataset.features.keys()) - {"text"}) dataloader = DataLoader(dataset_text, batch_size=16, num_workers=num_workers // 2, drop_last=True) for i, batch in tqdm(enumerate(dataloader), total=num_examples, desc="Split by node"): if i == num_examples: break # too many workers dataloader = DataLoader(dataset_text, batch_size=256, num_workers=num_workers, drop_last=True) for i, batch in tqdm(enumerate(dataloader), total=num_examples, desc="Too many workers"): if i == num_examples: break ``` </details> <details> <summary> With 5 examples: </summary> ``` Multiple workers: 100%|███████████████████████████████████████████████████████████████████| 5/5 [00:16<00:00, 3.33s/it] Assigning 7 shards (or data sources) of the dataset to each node. Split by node: 100%|██████████████████████████████████████████████████████████████████████| 5/5 [00:13<00:00, 2.76s/it] Assigning 7 shards (or data sources) of the dataset to each node. Too many dataloader workers: 14 (max is dataset.n_shards=7). Stopping 7 dataloader workers. To parallelize data loading, we give each process some shards (or data sources) to process. Therefore it's unnecessary t o have a number of workers greater than dataset.n_shards=7. To enable more parallelism, please split the dataset in more files than 7. Too many workers: 100%|███████████████████████████████████████████████████████████████████| 5/5 [00:15<00:00, 3.03s/it] ``` </details> <details> <summary> With 7 examples: </summary> ``` Multiple workers: 100%|███████████████████████████████████████████████████████████████████| 8/8 [00:13<00:00, 1.71s/it] Assigning 7 shards (or data sources) of the dataset to each node. Split by node: 100%|██████████████████████████████████████████████████████████████████████| 8/8 [00:11<00:00, 1.38s/it] Assigning 7 shards (or data sources) of the dataset to each node. Too many dataloader workers: 14 (max is dataset.n_shards=7). Stopping 7 dataloader workers. To parallelize data loading, we give each process some shards (or data sources) to process. Therefore it's unnecessary to have a number of workers greater than dataset.n_shards=7. To enable more parallelism, please split the dataset in more files than 7. Too many workers: 88%|██████████████████████████████████████████████████████████▋ | 7/8 [00:13<00:01, 1.89s/it] Traceback (most recent call last): File "distil-whisper/test_librispeech.py", line 36, in <module> for i, batch in tqdm(enumerate(dataloader), total=num_examples, desc="Too many workers"): File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/tqdm/std.py", line 1178, in __iter__ for obj in iterable: File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 633, in __next__ data = self._next_data() File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1325, in _next_data return self._process_data(data) File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1371, in _process_data data.reraise() File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/_utils.py", line 644, in reraise raise exception IndexError: Caught IndexError in DataLoader worker process 7. Original Traceback (most recent call last): File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop data = fetcher.fetch(index) File "/home/sanchitgandhi/hf/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 32, in fetch data.append(next(self.dataset_iter)) File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 986, in __iter__ yield from self._iter_pytorch(ex_iterable) File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 920, in _iter_pytorch for key, example in ex_iterable.shard_data_sources(worker_info.id, worker_info.num_workers): File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 540, in shard_data_sources self.ex_iterable.shard_data_sources(worker_id, num_workers), File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 796, in shard_data_sources self.ex_iterable.shard_data_sources(worker_id, num_workers), File "/home/sanchitgandhi/datasets/src/datasets/iterable_dataset.py", line 126, in shard_data_sources requested_gen_kwargs = _merge_gen_kwargs([gen_kwargs_list[i] for i in shard_indices]) File "/home/sanchitgandhi/datasets/src/datasets/utils/sharding.py", line 76, in _merge_gen_kwargs for key in gen_kwargs_list[0] IndexError: list index out of range ``` </details> ### Expected behavior Should pass for both 5 and 7 examples ### Environment info - `datasets` version: 2.12.1.dev0 - Platform: Linux-5.13.0-1023-gcp-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.1 I couldn't reproduce with the latest version of `datasets` 2.16.1, can you update `datasets` and try again ?
[ -0.3438449800014496, -0.11162509024143219, -0.059762854129076004, 0.2692221403121948, 0.06411129981279373, -0.08080780506134033, 0.8632721900939941, 0.330071359872818, -0.07778079807758331, 0.38194793462753296, 0.10152041167020798, 0.276222825050354, -0.19482579827308655, -0.008883349597454071, -0.22051949799060822, -0.16358238458633423, -0.13677209615707397, 0.028592877089977264, -0.04727735370397568, 0.14974665641784668, -0.14812955260276794, 0.08956090360879898, -0.13839074969291687, -0.17494525015354156, -0.5069965124130249, -0.08194999396800995, -0.052564457058906555, 0.22942529618740082, 0.1871800720691681, -0.1730796992778778, 0.18940415978431702, -0.2384277582168579, 0.31375813484191895, 0.6929024457931519, -0.00011501891276566312, 0.25776606798171997, 0.26057422161102295, 0.03154964745044708, -0.03852492570877075, 0.017169184982776642, -0.31468719244003296, -0.21539029479026794, -0.025413895025849342, -0.19543904066085815, 0.014529570937156677, 0.19854187965393066, -0.16817604005336761, -0.4060784578323364, 0.19296258687973022, -0.004398193210363388, 0.1252109408378601, 0.42142942547798157, -0.22948682308197021, 0.08848123252391815, 0.37135154008865356, -0.04809847101569176, -0.2256813943386078, -0.34595006704330444, 0.14573663473129272, 0.3530295789241791, -0.4983476400375366, 0.3899678587913513, -0.011802241206169128, 0.30606189370155334, -0.06520858407020569, -0.12325949966907501, -0.07440686970949173, -0.2600533068180084, 0.030875418335199356, 0.2490033209323883, 0.15054675936698914, 0.05635581538081169, -0.2193720042705536, -0.34921592473983765, -0.27360302209854126, -0.4609352946281433, 0.23649658262729645, 0.13464310765266418, 0.010170649737119675, -0.1534854918718338, -0.03681666776537895, 0.3354247808456421, 0.16056641936302185, -0.01868608221411705, 0.034703731536865234, 0.44645002484321594, -0.055033959448337555, 0.2567899227142334, 0.14537152647972107, -0.0423869788646698, 0.4998518228530884, 0.2416340708732605, -0.022470485419034958, -0.027803611010313034, -0.4694574773311615, 0.005570530891418457, 0.25780051946640015, -0.4518275856971741, 0.07932440936565399, 0.1836942732334137, 0.012518517673015594, 0.1465364694595337, 0.4381676912307739, 0.06581627577543259, 0.2714841961860657, -0.04581703245639801, -0.03476007282733917, 0.23730899393558502, 0.09607915580272675, -0.014199990779161453, -0.18655958771705627, -0.06303967535495758, 0.23482052981853485, -0.594344437122345, -0.0746755301952362, 0.22123102843761444, 0.2145417332649231, 0.08825437724590302, -0.3502674102783203, -0.14902791380882263, 0.06731224060058594, -0.17589347064495087, 0.3210279643535614, 0.2829552888870239, 0.4365255832672119, 0.10689302533864975, -0.25760436058044434, 0.1853434145450592, -0.43111181259155273, -0.43715882301330566, -0.2631233334541321, -0.18361011147499084, -0.10531088709831238, 0.05340423434972763, 0.0325583890080452, -0.47668907046318054, 0.12241272628307343, -0.09812820702791214, 0.10560695827007294, -0.16971763968467712, 0.08566869795322418, -0.2834489941596985, 0.15386390686035156, 0.16695016622543335, 0.16956384479999542, 0.09462899714708328, 0.22358299791812897, -0.07868417352437973, -0.13108818233013153, -0.00807228498160839, -0.24845324456691742, -0.5659595131874084, 0.05551818758249283, 0.10174743086099625, 0.0014003664255142212, 0.24806931614875793, -0.032730069011449814, -0.10086999833583832, 0.68349689245224, 0.20576779544353485, 0.06986892223358154, -0.08470260351896286, -0.41655927896499634, -0.060385897755622864, -0.012896772474050522, 0.38937312364578247, 0.38848942518234253, 0.05406300723552704, -0.20576563477516174, 0.14869658648967743, 0.355957955121994, 0.29074761271476746, -0.20229575037956238, 0.2572838068008423, -0.3243243992328644, 0.4978307783603668, 0.2238818258047104, 0.020009055733680725, -0.23654574155807495, 0.610176682472229, -0.10847077518701553, -0.1348373293876648, 0.2252633273601532, 0.25122150778770447, 0.4450564682483673, -0.09887471795082092, 0.0020835231989622116, 0.3371255099773407, -0.2411145567893982, 0.12891457974910736, -0.20604625344276428, 0.12726999819278717, 0.22414907813072205, 0.0951991081237793, 0.2630665600299835, -0.10833574831485748, 0.22143124043941498, -0.2286709100008011, 0.33204373717308044, -0.008047889918088913, 0.1255904734134674, 0.20992185175418854, -0.26144444942474365, -0.01638040319085121, 0.1783977448940277, -0.07875107228755951, -0.16513420641422272, 0.21234583854675293, 0.045277804136276245, -0.16687685251235962, -0.11544281244277954, 0.05067187547683716, -0.05463682487607002, 0.08591650426387787, -0.3980554938316345, -0.1270928978919983, -0.006519149988889694, 0.02972489222884178, -0.20926231145858765, -0.36619752645492554, -0.21071100234985352, 0.004442421719431877, -0.293293833732605, 0.07524164021015167, -0.4437686502933502, 0.34814324975013733, 0.06757522374391556, -0.21426409482955933, 0.11930254101753235, 0.20214970409870148, 0.21025574207305908, -0.2823067605495453, -0.09134414792060852, 0.3711341917514801, 0.2723773121833801, 0.20008420944213867, 0.0033730219583958387, -0.06240759789943695, 0.0911707729101181, -0.2199992537498474, -0.1300281286239624, 0.262588232755661, 0.02250637114048004, -0.23306390643119812, 0.15338104963302612, 0.22076961398124695, -0.44566014409065247, 0.4176091253757477, -0.22179925441741943, 0.04414123296737671, 0.23078376054763794, -0.01644626259803772, -0.01827748864889145, -0.11827869713306427, 0.23885373771190643, -0.33923977613449097, -0.20398558676242828, -0.10016053169965744, -0.26540830731391907, 0.028408046811819077, 0.12395887821912766, 0.18440721929073334, 0.032208263874053955, -0.12662196159362793, 0.04371343553066254, 0.13596399128437042, 0.13246341049671173, 0.11938329041004181, 0.2938385605812073, 0.039534397423267365, 0.04798634722828865, -0.3687019348144531, 0.32352662086486816, -0.19636601209640503, 0.059668753296136856, 0.08938979357481003, 0.24247336387634277, 0.5059559345245361, -0.05187685042619705, -0.1219668909907341, -0.14888626337051392, -0.2594757676124573, 0.1518929898738861, 0.22751528024673462, -0.1954062581062317, 0.12288284301757812, -0.024677392095327377, 0.04748895764350891, -0.1707400381565094, -0.19474071264266968, -0.07350398600101471, -0.5424302816390991, -0.11156290024518967, 0.27437883615493774, -0.40874865651130676, 0.17775306105613708, -0.3823961019515991, -0.18706277012825012, 0.2629019320011139, 0.012626191601157188, 0.023970648646354675, -0.09336161613464355, 0.04737892001867294, -0.03200468420982361, 0.4437195956707001, 0.13984675705432892, 0.10288578271865845, -0.11052596569061279, -0.020595744252204895, -0.5600925087928772, -0.005880862474441528, 0.16628697514533997, -0.1003769189119339, 0.08530788123607635, 0.20185774564743042, -0.1319066286087036, -0.02786673977971077, -0.385656476020813, 0.16456454992294312, -0.0974668636918068, 0.03973832726478577, 0.5179474353790283, 0.1012248769402504, 0.07391095161437988, 0.16862383484840393, -0.44629573822021484, 0.05391066521406174, -0.4113641083240509, -0.03431927040219307, -0.04448305070400238, 0.24551059305667877, -0.04470188543200493, 0.008647497743368149, -0.11531931161880493, 0.24237129092216492, -0.29062992334365845, -0.047836799174547195, -0.28901249170303345, 0.22524328529834747, -0.23081457614898682, -0.25233176350593567, -0.10044857114553452, -0.08465811610221863, 0.04036732763051987, 0.2026907056570053, -0.3353070616722107, 0.5409305095672607, -0.11044429242610931, 0.15327709913253784, 0.054353825747966766, -0.11912894248962402, 0.3324001431465149, 0.14356815814971924, -0.0167330801486969, -0.07638774067163467, 0.15976297855377197, -0.07824812829494476, -0.22069285809993744, 0.22515755891799927, 0.016101505607366562, 0.38758569955825806, 0.19957181811332703, 0.8008944988250732, 0.08712093532085419, -0.21172268688678741, 0.3181616961956024, 0.04786843806505203, -0.15943534672260284, -0.00504637137055397, -0.4321867823600769, 0.14884158968925476, -0.17597927153110504, -0.22254008054733276, 0.17707253992557526, -0.1393132507801056, -0.1661672294139862, 0.04961993545293808, -0.16427677869796753, 0.0558350533246994, -0.41685938835144043, 0.2628035545349121, -0.12832441926002502, 0.29465028643608093, -0.04014792665839195, 0.15651562809944153, 0.010776914656162262, -0.29810285568237305, -0.1432410180568695, 0.1143587976694107, 0.1395328938961029, -0.08204783499240875, -0.07235288619995117, 0.11901050806045532, -0.3381306827068329, 0.3269035816192627, 0.24589461088180542, 0.5223236083984375, 0.17046597599983215, -0.3455694019794464, 0.07765015214681625, 0.07001899182796478, 0.4913504421710968, -0.14523804187774658, 0.052420008927583694, 0.10914488136768341, -0.11817087233066559, -0.2523905038833618, -0.11002233624458313, -0.15723955631256104, 0.6813249588012695, 0.2064385563135147, 0.35917234420776367, -0.13642098009586334, -0.16711586713790894, 0.07672164589166641, -0.11894358694553375, -0.18317961692810059, -0.27558374404907227, -0.41504526138305664, -0.1429484486579895, -0.09259918332099915, 0.39226630330085754, 0.09156960248947144, 0.3258490562438965, -0.010322920978069305, -0.07995223253965378, -0.43436646461486816, -0.31874215602874756, 0.015319332480430603, 0.0455060712993145, 0.13930237293243408, -0.2906055152416229, 0.4903109073638916, 0.10548681020736694, 0.28006747364997864, 0.16264712810516357, 0.20658189058303833, -0.12347374856472015, 0.09992282092571259, 0.23389652371406555, -0.2367369532585144, 0.17167411744594574, 0.2993243336677551, -0.10286767780780792, 0.10750813782215118, 0.03813745081424713, 0.2871139645576477, -0.21003392338752747, -0.22306419909000397, 0.08570864051580429, 0.06605561077594757, -0.35896044969558716, 0.002867288887500763, 0.21957933902740479, -0.13291719555854797, 0.11987555027008057, 0.24089503288269043, -0.19196583330631256, -0.042227838188409805, 0.31813135743141174, 0.1707494556903839, 0.7980759143829346, -0.11169441044330597, -0.155856654047966, 0.18495474755764008, 0.39763781428337097, 0.12332674115896225, -0.37463030219078064, 0.44500744342803955, -0.24254804849624634, -0.5292295813560486, 0.02541467547416687, -0.21296821534633636, 0.00625976175069809, 0.07795839011669159, 0.05230739712715149, 0.3415234386920929, -0.2717165946960449, -0.03298069164156914, -0.3577460050582886, 0.21510353684425354, -0.34070298075675964, -0.31247907876968384, 0.10991200804710388, -0.002352531999349594, 0.022973041981458664, 0.17978844046592712, 0.01003364846110344, -0.12466810643672943, 0.25398075580596924, -0.21319951117038727, 0.09406152367591858, 0.04120428115129471, 0.14820703864097595, 0.3950643539428711, 0.18744787573814392, -0.457807332277298, 0.17841270565986633, 0.08401927351951599, 0.0020345747470855713, -0.3836970329284668, 0.15634191036224365, 0.05886358395218849, 0.02934211865067482, 0.02995464578270912, 0.03590349107980728, 0.06647704541683197, 0.24922657012939453, 0.0687730461359024, -0.09829522669315338, -0.26716896891593933, 0.08007296919822693, -0.5441076755523682, -0.020266443490982056, 0.4983738660812378, -0.023849621415138245, -0.4951120615005493, 0.20486409962177277, 0.16571161150932312, -0.33130237460136414, -0.338945209980011, 0.08130699396133423, 0.06486108899116516, -0.27412575483322144, 0.23969799280166626, -0.06613902747631073, -0.21246305108070374, 0.07253146916627884, 0.24141040444374084, 0.06679999083280563, 0.13673913478851318, 0.23875561356544495, 0.38418900966644287, -0.3391035199165344, -0.22439929842948914, 0.13611510396003723, 0.2881627678871155, -0.32730773091316223, 0.16809430718421936, -0.6817811131477356, 0.16712269186973572, 0.04192555323243141, 0.10756072402000427, -0.053486816585063934, 0.23522034287452698, -0.2647675573825836, -0.3609103560447693, -0.18761605024337769, 0.16922669112682343, -0.19017387926578522, 0.09088478982448578, -0.3585607707500458, 0.3009413182735443, -0.07837677747011185, 0.2833218574523926, -0.19196617603302002, 0.10449861735105515, -0.25036200881004333, 0.37123510241508484, 0.3594561815261841, -0.1394890397787094, 0.20720194280147552, -0.014672618359327316, -0.07644155621528625, 0.2628307342529297, -0.028378766030073166, -0.1517658233642578, -0.026549652218818665, 0.084556944668293, 0.05889132618904114, -0.03217014670372009, -0.11266660690307617, -0.010733447968959808, -0.04890317842364311, -0.3369462490081787, 0.09212519228458405, 0.15427210927009583, -0.10413634777069092, -0.07781516015529633, 0.3401317596435547, 0.11216072738170624, -0.2310267984867096, 0.1092635914683342, -0.05362534895539284, 0.048359550535678864, -0.22230491042137146, 0.30777841806411743, 0.14588651061058044, 0.1078614667057991, 0.07473570108413696, -0.007430873811244965, 0.45512855052948, -0.08227663487195969, 0.20268507301807404, -0.3707015812397003, 0.019446812570095062, 0.10227389633655548, 0.25933340191841125, 0.28406837582588196, -0.24100889265537262, -0.26977959275245667, 0.07382255792617798, 0.1536070853471756, -0.04040451720356941, -0.13044333457946777, 0.008766904473304749, 0.25412410497665405, 0.008432351052761078, 0.32455867528915405, 0.20138520002365112, -0.17074362933635712, -0.3658846914768219, 0.22889889776706696, 0.10773167014122009, -0.5555316209793091, -0.04221409931778908, 0.2259974628686905, -0.3348045349121094, -0.15160386264324188, 0.44845470786094666, -0.10797494649887085, 0.1053956151008606, 0.6386840343475342, -0.32888779044151306, 0.6917989253997803, 0.4502895176410675, 0.04650295898318291, -0.0352647602558136, -0.2893158197402954, -0.1300385296344757, 0.1584775745868683, 0.08131128549575806, -0.03900061175227165, -0.126889169216156, 0.5756785273551941, 0.10583509504795074, 0.1932360976934433, -0.03449384495615959, 0.15215767920017242, -0.17565323412418365, -0.09567072987556458, -0.03509800136089325, -0.04379485547542572, -0.3183518052101135, -0.1622897833585739, 0.07982505857944489, 0.22904205322265625, 0.3686935603618622, 0.20221324265003204, -0.14544528722763062, -0.15695315599441528, 0.24044255912303925, 0.1969013214111328, 0.07290048897266388, -0.49579715728759766, 0.05238790810108185, 0.1520342230796814, 0.04074789583683014, 0.16955405473709106, -0.005256975069642067, 0.41977912187576294, 0.09432302415370941, -0.2429410219192505, 0.010428223758935928, -0.021739959716796875, -0.031197667121887207, -0.11776010692119598, 0.22224068641662598, -0.5038411617279053, -0.007595771923661232, 0.4173905849456787, 0.015115462243556976, -0.06838637590408325, -0.06676729023456573, 0.3372841775417328, 0.5952528715133667, -0.037178970873355865, 0.13875631988048553, -0.259573370218277, -0.06760063022375107, 0.07793234288692474, 0.05293336138129234, -0.11815958470106125, 0.013904109597206116, 0.43503591418266296, -0.39145055413246155, 0.1994735598564148, 0.08012169599533081, 0.04307737946510315, -0.26520511507987976, 0.2603907883167267, -0.06454484909772873, -0.1810779720544815, -0.30568593740463257, -0.08557318896055222, -0.28827399015426636, 0.04439615458250046, -0.26938748359680176, -0.06680061668157578, 0.17496445775032043, 0.6394560933113098, -0.18824654817581177, 0.1542435735464096, 0.2322542369365692, -0.12694716453552246, 0.03581786900758743, 0.511904776096344, -0.024080932140350342, -0.1004648506641388, -0.3710812032222748, 0.025487763807177544, 0.1378103792667389, -0.45650357007980347, 0.04752367362380028, 0.1902155578136444, 0.03421269357204437, -0.02019883319735527, -0.15831637382507324, 0.29096245765686035, -0.04865967482328415, 0.003985201939940453, 0.13636815547943115, 0.1310267597436905, 0.01951807737350464, 0.09167253226041794, -0.398184210062027, -0.5995730757713318, -0.22755590081214905, 0.2800934910774231, 0.21206073462963104, 0.2037011981010437, -0.1424187868833542, 0.048324085772037506, -0.48533159494400024, 0.3997977077960968, -0.20950493216514587, 0.38638433814048767, -0.31341177225112915, 0.1726750135421753, -0.3916029632091522, 0.4229358732700348, 0.03502563014626503, 0.3047019839286804, 0.06721025705337524, 0.1649753600358963, -0.08483660221099854, -0.6327115297317505, 0.18227559328079224, -0.5119244456291199, -0.27522826194763184, -0.21841859817504883, 0.1954069584608078, 0.5580602288246155, 0.2668323218822479, -0.31660473346710205, -0.1393490433692932, 0.11953988671302795, 0.02322189137339592, -0.09547615051269531, -0.24119055271148682, 0.3332935869693756, -0.1537964642047882, -0.07702012360095978, -0.42775171995162964, 0.2288769781589508, -0.14806292951107025, 0.15461556613445282, -0.15733899176120758 ]
https://github.com/huggingface/datasets/issues/5880
This sounds related to #5281. Can you try passing `storage_options=s3_client.storage_options` instead passing it to `use_auth_token=` ?
load_dataset from s3 file system through streaming can't not iterate data
### Describe the bug I have a JSON file in my s3 file system(minio), I can use load_dataset to get the file link, but I can't iterate it <img width="816" alt="image" src="https://github.com/huggingface/datasets/assets/59083384/cc0778d3-36f3-45b5-ac68-4e7c664c2ed0"> <img width="1144" alt="image" src="https://github.com/huggingface/datasets/assets/59083384/76872af3-8b3c-42ff-9f55-528c920a7af1"> we can change 4 lines to fix this bug, you can check whether it is ok for us. <img width="941" alt="image" src="https://github.com/huggingface/datasets/assets/59083384/5a22155a-ece7-496c-8506-047e5c235cd3"> ### Steps to reproduce the bug 1. storage a file in you s3 file system 2. use load_dataset to read it through streaming 3. iterate it ### Expected behavior can iterate it successfully ### Environment info - `datasets` version: 2.12.0 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.1
16
load_dataset from s3 file system through streaming can't not iterate data ### Describe the bug I have a JSON file in my s3 file system(minio), I can use load_dataset to get the file link, but I can't iterate it <img width="816" alt="image" src="https://github.com/huggingface/datasets/assets/59083384/cc0778d3-36f3-45b5-ac68-4e7c664c2ed0"> <img width="1144" alt="image" src="https://github.com/huggingface/datasets/assets/59083384/76872af3-8b3c-42ff-9f55-528c920a7af1"> we can change 4 lines to fix this bug, you can check whether it is ok for us. <img width="941" alt="image" src="https://github.com/huggingface/datasets/assets/59083384/5a22155a-ece7-496c-8506-047e5c235cd3"> ### Steps to reproduce the bug 1. storage a file in you s3 file system 2. use load_dataset to read it through streaming 3. iterate it ### Expected behavior can iterate it successfully ### Environment info - `datasets` version: 2.12.0 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.1 This sounds related to #5281. Can you try passing `storage_options=s3_client.storage_options` instead passing it to `use_auth_token=` ?
[ -0.02854137122631073, -0.35016191005706787, -0.03122340887784958, 0.5485132336616516, 0.4296378791332245, 0.08875328302383423, 0.3991794288158417, -0.013566541485488415, 0.10982269793748856, 0.05558111146092415, -0.018526790663599968, 0.3006925582885742, 0.08064774423837662, 0.39347076416015625, -0.06836661696434021, 0.1394219696521759, 0.03763732314109802, 0.1514856219291687, -0.018770966678857803, -0.00940065085887909, -0.17236879467964172, 0.19756357371807098, -0.11181474477052689, -0.2984839379787445, 0.007139142602682114, 0.004947880282998085, -0.11563350260257721, 0.21305805444717407, -0.29512810707092285, -0.45158129930496216, 0.11284732073545456, 0.08307528495788574, 0.2954024076461792, 0.6031535863876343, -0.00011792917212005705, -0.044219061732292175, 0.34390103816986084, -0.07980141043663025, -0.3780965507030487, -0.4204360842704773, -0.4179036021232605, -0.09802728146314621, 0.13323767483234406, -0.19210585951805115, 0.00984223186969757, -0.027299348264932632, 0.13593484461307526, -0.3827868700027466, 0.7073437571525574, 0.2031153291463852, 0.09530899673700333, 0.1905898153781891, -0.24096037447452545, 0.12079477310180664, 0.17973992228507996, 0.3661175072193146, -0.1857762336730957, 0.4463149905204773, 0.1768157035112381, 0.17488518357276917, 0.049594782292842865, 0.21568797528743744, -0.17124566435813904, 0.14390262961387634, 0.3648325204849243, -0.025646544992923737, -0.2369106411933899, -0.0712650939822197, -0.033093102276325226, 0.23343481123447418, 0.6152034997940063, -0.09848937392234802, -0.5188028216362, -0.3326629102230072, 0.0009925849735736847, -0.18054866790771484, 0.3391876220703125, 0.07109532505273819, 0.06893759965896606, 0.07101185619831085, -0.27575379610061646, -0.13054367899894714, -0.21321091055870056, 0.3044358193874359, 0.12140724062919617, -0.03405613452196121, -0.358112096786499, 0.07598285377025604, -0.03854210302233696, -0.1323593109846115, 0.4488039016723633, -0.09801851212978363, -0.1715715527534485, 0.10585683584213257, -0.5292040109634399, 0.13419264554977417, 0.044877417385578156, -0.045972567051649094, 0.23509252071380615, 0.42582589387893677, 0.34901314973831177, -0.0478200763463974, -0.04500701278448105, 0.19463074207305908, 0.27785828709602356, 0.027789562940597534, 0.006732231006026268, -0.07945570349693298, 0.05717702955007553, 0.421352744102478, 0.10135963559150696, -0.43100833892822266, -0.23610249161720276, -0.06294678896665573, -0.24283765256404877, -0.20601192116737366, 0.35691678524017334, -0.09332798421382904, -0.10034815222024918, -0.1570875197649002, -0.30082398653030396, -0.10817627608776093, 0.1672143042087555, 0.2998378872871399, 0.06077402085065842, 0.20455977320671082, -0.12154944241046906, 0.27473124861717224, -0.07439115643501282, 0.07220624387264252, -0.10176317393779755, -0.12970061600208282, -0.07400888949632645, 0.27838394045829773, 0.12973211705684662, -0.38862520456314087, 0.391399085521698, 0.16927585005760193, -0.0984925776720047, -0.359266459941864, 0.08968643099069595, -0.13478344678878784, 0.21791133284568787, 0.0062510110437870026, 0.17527562379837036, 0.2953804135322571, -0.18233780562877655, -0.012969575822353363, 0.048094913363456726, -0.24996910989284515, -0.35338419675827026, -0.05178084596991539, -0.034515053033828735, 0.04816605523228645, -0.43263310194015503, -0.11905644088983536, -0.3815847635269165, -0.013139594346284866, 0.08454041182994843, -0.14045031368732452, 0.18221260607242584, 0.16418501734733582, -0.1734759360551834, 0.002975478768348694, 0.2651156485080719, 0.42867511510849, 0.039195477962493896, 0.00147981196641922, -0.05431481823325157, -0.0063577014952898026, 0.2304563820362091, 0.2234041392803192, -0.085854172706604, -0.16184133291244507, -0.3960661292076111, 0.4206233620643616, 0.1667936146259308, -0.5139704346656799, -0.3879682123661041, 0.5026646852493286, -0.12148571759462357, 0.13577502965927124, 0.4039806127548218, 0.07729161530733109, -0.019599689170718193, 0.06646811217069626, -0.266215980052948, 0.2990476191043854, 0.022243523970246315, 0.07891858369112015, -0.10956485569477081, -0.03097625821828842, -0.0970454066991806, 0.24779373407363892, -0.26658082008361816, 0.30802303552627563, 0.15348650515079498, 0.23560252785682678, 0.2821839451789856, -0.19259585440158844, 0.07525039464235306, 0.24957923591136932, 0.5205853581428528, 0.1762993484735489, 0.07495395839214325, -0.025822289288043976, -0.33854928612709045, 0.1400405317544937, 0.448429673910141, -0.35873928666114807, -0.11550392955541611, -0.06490407884120941, 0.008258871734142303, -0.030853793025016785, -0.34287700057029724, 0.059858985245227814, 0.045265719294548035, 0.4793016016483307, 0.03434529900550842, -0.09082656353712082, -0.21604028344154358, 0.22655102610588074, -0.03807315602898598, 0.01787056028842926, -0.5260735750198364, 0.3058730959892273, 0.15589389204978943, -0.18651162087917328, 0.16401182115077972, -0.08993858098983765, 0.3456358313560486, -0.29745280742645264, -0.12718065083026886, 0.38716205954551697, 0.33551153540611267, 0.5172498822212219, -0.07982060313224792, -0.048167988657951355, 0.2583000957965851, -0.07629841566085815, -0.1868954449892044, -0.00968947447836399, 0.12144825607538223, -0.029853269457817078, 0.005521624349057674, 0.24951805174350739, -0.33680275082588196, 0.40523868799209595, -0.021324381232261658, 0.057828955352306366, 0.0936606302857399, -0.25592881441116333, -0.2882790267467499, 0.062321096658706665, 0.3113754093647003, -0.058403417468070984, 0.10249689966440201, -0.10962247103452682, -0.2846795320510864, -0.1763884425163269, 0.528866171836853, 0.09079821407794952, -0.31966423988342285, 0.016206884756684303, -0.07059718668460846, -0.0826287716627121, 0.34143102169036865, 0.31508925557136536, 0.4767119288444519, -0.006204348057508469, -0.01257329061627388, 0.031083425506949425, 0.35476192831993103, -0.13699792325496674, -0.007977485656738281, 0.28704121708869934, 0.5247265696525574, 0.27189531922340393, 0.10189875960350037, -0.012668643146753311, -0.16076523065567017, -0.17286035418510437, 0.11497634649276733, -0.0030812397599220276, -0.2713016867637634, 0.30334794521331787, -0.3115522861480713, -0.15197288990020752, -0.030080007389187813, -0.06054645776748657, -0.17384597659111023, -0.2880667746067047, -0.3617580831050873, 0.6276470422744751, 0.015997357666492462, -0.07044561952352524, 0.11562030017375946, 0.07814992964267731, 0.30184799432754517, -0.08115587383508682, -0.6177608966827393, 0.03558063507080078, 0.04775818809866905, -0.10302864760160446, 0.42845460772514343, -0.0926211029291153, 0.15572576224803925, -0.15470217168331146, -0.13824687898159027, -0.5026077628135681, -0.048335298895835876, 0.15032005310058594, 0.02812628448009491, 0.45312920212745667, 0.16496892273426056, 0.21665255725383759, -0.24154016375541687, 0.04437658190727234, 0.15219369530677795, -0.10058082640171051, -0.23489205539226532, 0.3345807194709778, 0.11117219924926758, 0.06913453340530396, -0.06073339283466339, -0.12167992442846298, 0.025132441893219948, -0.31836098432540894, 0.5907989144325256, 0.015519857406616211, 0.08663788437843323, 0.10959640145301819, 0.19127292931079865, 0.24584396183490753, -0.0981670618057251, 0.16144967079162598, -0.28917115926742554, -0.5735071301460266, 0.2714526355266571, -0.3057861924171448, -0.4573414623737335, 0.16982224583625793, 0.11308544129133224, 0.37140312790870667, -0.0025991424918174744, -0.5437296032905579, -0.35950708389282227, -0.03043210506439209, -0.08421775698661804, -0.4473299980163574, -0.13848137855529785, 0.12126179039478302, -0.20947858691215515, 0.07710093259811401, -0.3504604399204254, -0.008875653147697449, -0.06742449104785919, 0.04030560329556465, 0.230192631483078, 0.2907332181930542, 0.6479679942131042, 0.27001774311065674, 0.3294580578804016, 0.540217936038971, 0.016540702432394028, 0.5986292362213135, -0.37315288186073303, 0.2065925896167755, 0.04716167226433754, -0.37753528356552124, 0.03131667524576187, -0.0479840487241745, -0.08488835394382477, 0.02383197471499443, -0.08664955198764801, 0.12802056968212128, -0.3266212046146393, 0.03617227077484131, -0.3113462030887604, -0.1004667729139328, -0.19002598524093628, -0.2788694202899933, 0.05089670047163963, 0.01036081463098526, 0.10779634863138199, 0.10361634194850922, -0.022174321115016937, -0.05328426882624626, 0.280403196811676, 0.32237741351127625, 0.0974794328212738, -0.12052532285451889, -0.35446399450302124, -0.4181356430053711, 0.07473362982273102, -0.001335885375738144, 0.49204686284065247, 0.04372614622116089, 0.024545617401599884, 0.1659875065088272, -0.299537718296051, 0.959144115447998, -0.17528986930847168, 0.0836801528930664, -0.049635738134384155, -0.14636735618114471, -0.4484614133834839, 0.14612337946891785, -0.15370944142341614, 0.16064339876174927, 0.25349706411361694, 0.6260908246040344, -0.11283309757709503, -0.25102168321609497, -0.1296270787715912, -0.07243742793798447, -0.0020577162504196167, -0.40446215867996216, -0.18122726678848267, -0.20974716544151306, -0.40470412373542786, -0.40771207213401794, 0.14050957560539246, 0.24384789168834686, 0.00205051526427269, -0.15345799922943115, -0.07658141851425171, 0.08382466435432434, 0.08514928817749023, 0.07799932360649109, 0.16764520108699799, 0.18452399969100952, 0.3542253375053406, 0.3661002516746521, 0.08058628439903259, 0.5673603415489197, 0.7291521430015564, 0.5587792992591858, -0.2646791934967041, 0.09095874428749084, 0.01258930191397667, 0.21496134996414185, 0.13303889334201813, -0.0714406967163086, 0.08841125667095184, 0.1128620058298111, 0.011075029149651527, -0.2796034514904022, 0.08510278165340424, 0.31193286180496216, 0.02387940138578415, 0.16459348797798157, -0.2570265531539917, 0.4078822135925293, -0.03952297568321228, 0.06585825979709625, 0.25067755579948425, -0.022795159369707108, -0.19111953675746918, 0.1099478006362915, -0.05344550311565399, 0.623607873916626, -0.009853329509496689, 0.07698610424995422, 0.4425843358039856, -0.11937622725963593, 0.4572945833206177, -0.13756105303764343, -0.043500468134880066, -0.20197877287864685, -0.2897638976573944, -0.14529140293598175, -0.24575382471084595, 0.11789888888597488, 0.0993942841887474, -0.1713619828224182, 0.02402563765645027, 0.12038618326187134, 0.45941162109375, 0.002737145870923996, 0.29606226086616516, -0.5312509536743164, -0.06279011070728302, -0.41741129755973816, 0.07760761678218842, -0.08376118540763855, -0.018620310351252556, 0.12850099802017212, -0.335262268781662, -0.0667039155960083, 0.04977297782897949, -0.0272553488612175, 0.16303923726081848, -0.11439412832260132, -0.135406494140625, -0.08265355229377747, -0.27774590253829956, 0.06350471079349518, 0.31070011854171753, -0.14335982501506805, -0.05917488783597946, -0.4634731113910675, 0.04717155545949936, -0.03241733834147453, -0.16039833426475525, -0.3380936086177826, -0.12080273032188416, 0.18130937218666077, -0.03727784752845764, -0.03614106774330139, -0.032431308180093765, 0.15042755007743835, -0.2021980583667755, 0.1835750937461853, -0.018591083586215973, -0.07196441292762756, -0.20877790451049805, -0.19482845067977905, -0.022462990134954453, -0.11512238532304764, -0.17824164032936096, 0.08230745792388916, -0.03511686250567436, -0.15328018367290497, -0.11065232753753662, -0.13338690996170044, -0.07910539209842682, -0.0404990017414093, 0.7419382929801941, -0.2643105983734131, 0.09041020274162292, 0.5423687100410461, 0.22102981805801392, -0.019749555736780167, -0.15116505324840546, 0.3164859414100647, -0.13116544485092163, -0.052746765315532684, 0.00607757642865181, -0.038519326597452164, 0.20692765712738037, -0.2581678628921509, -0.22676631808280945, 0.05585373565554619, -0.2061580866575241, 0.16697318851947784, -0.45683714747428894, 0.019088052213191986, -0.014160547405481339, -0.1525636464357376, 0.09833556413650513, -0.07734508812427521, -0.015279227867722511, -0.09382964670658112, -0.1865520477294922, -0.2194131314754486, 0.0901145413517952, -0.26434463262557983, 0.0318971686065197, 0.12470714747905731, -0.010528957471251488, 0.1258852481842041, -0.13151827454566956, 0.04022740572690964, 0.2571547329425812, -0.09629793465137482, -0.16034552454948425, -0.2181764394044876, 0.146487295627594, 0.42062854766845703, -0.164127379655838, -0.08547203242778778, -0.2007799595594406, -0.4037645757198334, -0.186409592628479, -0.023836471140384674, 0.20601288974285126, 0.023770013824105263, 0.2243376076221466, 0.14296066761016846, 0.0061157867312431335, -0.16700604557991028, -0.08312550187110901, 0.0011702291667461395, 0.08902954310178757, -0.3083365559577942, 0.334136039018631, 0.040015168488025665, 0.028208233416080475, -0.27018505334854126, 0.01161424070596695, 0.1085955947637558, 0.03603803738951683, 0.4040782153606415, -0.29083818197250366, -0.014086984097957611, 0.005127862095832825, 0.26847973465919495, 0.6415137052536011, -0.28460532426834106, 0.12898632884025574, 0.0569896325469017, 0.12492489814758301, 0.024242043495178223, 0.08012010157108307, -0.1805962175130844, 0.03627379238605499, 0.0066369324922561646, 0.09351951628923416, -0.007835127413272858, -0.10870480537414551, 0.017381004989147186, 0.0643661618232727, 0.35609060525894165, 0.1353437900543213, 0.13297238945960999, 0.05108706280589104, -0.26419851183891296, 0.055148594081401825, 0.25562936067581177, 0.2681010961532593, 0.013312213122844696, 0.3727480173110962, -0.2150452882051468, 0.028296517208218575, -0.22919383645057678, 0.4659232199192047, -0.15769635140895844, -0.21518166363239288, -0.24116383492946625, 0.014587342739105225, -0.2206072062253952, 0.17839501798152924, -0.18514902889728546, 0.19826555252075195, 0.0054921954870224, 0.03313691169023514, -0.17682726681232452, 0.07268546521663666, 0.08638280630111694, -0.045772381126880646, -0.47990161180496216, -0.050011686980724335, -0.1614675223827362, 0.022792227566242218, 0.13363517820835114, -0.21038083732128143, 0.2161293476819992, 0.2989114224910736, -0.030085153877735138, -0.43522900342941284, 0.12307997792959213, 0.39080482721328735, 0.09376877546310425, -0.4326154589653015, 0.25846678018569946, -0.08980046212673187, 0.15592166781425476, 0.14169880747795105, 0.20729874074459076, 0.21047228574752808, 0.30120089650154114, 0.21074536442756653, 0.011489275842905045, 0.028043322265148163, -0.16787156462669373, 0.11687731742858887, 0.4368216097354889, -0.09855276346206665, 0.023939520120620728, 0.2386009246110916, 0.026323046535253525, -0.06957017630338669, 0.09042645245790482, -0.07820816338062286, 0.3698577582836151, -0.5544125437736511, 0.09626220166683197, -0.3886357545852661, -0.048511117696762085, -0.10476928949356079, 0.014104193076491356, -0.5125844478607178, 0.18659338355064392, 0.3688836991786957, -0.09731536358594894, 0.2981964349746704, -0.06509555131196976, 0.053605884313583374, -0.2991322875022888, 0.34200742840766907, 0.26879462599754333, 0.07533932477235794, -0.2320874184370041, -0.18954521417617798, -0.34785526990890503, -0.019475571811199188, 0.1473434865474701, -0.3080429136753082, 0.12575969099998474, 0.24127542972564697, -0.17123639583587646, 0.08785948902368546, -0.0033758655190467834, 0.03528289869427681, -0.0832514837384224, 0.477988064289093, -0.1646852046251297, -0.6372490525245667, -0.10230034589767456, 0.1344136893749237, 0.04255785793066025, -0.1921008825302124, 0.3941594064235687, -0.3290611207485199, -0.012656237930059433, -0.05512268841266632, 0.0011822357773780823, -0.1617949903011322, -0.13310007750988007, 0.44793781638145447, 0.09753832966089249, 0.038030222058296204, -0.2419784814119339, 0.08898315578699112, -0.42044827342033386, -0.4426286220550537, -0.27279314398765564, 0.14426769316196442, -0.16654238104820251, 0.34887439012527466, -0.19670772552490234, -0.08147000521421432, -0.30465564131736755, 0.09388421475887299, -0.07897603511810303, -0.28864893317222595, -0.09760061651468277, 0.40842992067337036, -0.21033036708831787, 0.27458614110946655, -0.16509033739566803, 0.13601574301719666, -0.1382853090763092, 0.16785115003585815, -0.30485662817955017, -0.3425382971763611, 0.3725784122943878, -0.7227141261100769, -0.07881897687911987, 0.3301694691181183, 0.18460284173488617, 0.15787681937217712, -0.2221997231245041, -0.48588883876800537, 0.27630865573883057, 0.42064663767814636, -0.12673541903495789, -0.17433758080005646, 0.28729447722435, 0.15173158049583435, 0.03270632028579712, -0.09283746778964996, 0.19009092450141907, 0.40958982706069946, -0.2793750464916229, 0.28408825397491455, -0.08260189741849899 ]
https://github.com/huggingface/datasets/issues/5880
I tried `storage_options` before, but it doesn't work, I checked our source code and I found that we even didn't pass this parameter to the following process. if I use `storage_options` instead of `use_auth_token`, then I also need to change another place of the code. the last line of `streaming_download_manager.py`. our code only passes the `use_auth_token` to the following handler, but does nothing to the `storage_options` <img width="1050" alt="image" src="https://github.com/huggingface/datasets/assets/59083384/5be90933-3331-4ecf-9e11-34f9852d8f92">
load_dataset from s3 file system through streaming can't not iterate data
### Describe the bug I have a JSON file in my s3 file system(minio), I can use load_dataset to get the file link, but I can't iterate it <img width="816" alt="image" src="https://github.com/huggingface/datasets/assets/59083384/cc0778d3-36f3-45b5-ac68-4e7c664c2ed0"> <img width="1144" alt="image" src="https://github.com/huggingface/datasets/assets/59083384/76872af3-8b3c-42ff-9f55-528c920a7af1"> we can change 4 lines to fix this bug, you can check whether it is ok for us. <img width="941" alt="image" src="https://github.com/huggingface/datasets/assets/59083384/5a22155a-ece7-496c-8506-047e5c235cd3"> ### Steps to reproduce the bug 1. storage a file in you s3 file system 2. use load_dataset to read it through streaming 3. iterate it ### Expected behavior can iterate it successfully ### Environment info - `datasets` version: 2.12.0 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.1
70
load_dataset from s3 file system through streaming can't not iterate data ### Describe the bug I have a JSON file in my s3 file system(minio), I can use load_dataset to get the file link, but I can't iterate it <img width="816" alt="image" src="https://github.com/huggingface/datasets/assets/59083384/cc0778d3-36f3-45b5-ac68-4e7c664c2ed0"> <img width="1144" alt="image" src="https://github.com/huggingface/datasets/assets/59083384/76872af3-8b3c-42ff-9f55-528c920a7af1"> we can change 4 lines to fix this bug, you can check whether it is ok for us. <img width="941" alt="image" src="https://github.com/huggingface/datasets/assets/59083384/5a22155a-ece7-496c-8506-047e5c235cd3"> ### Steps to reproduce the bug 1. storage a file in you s3 file system 2. use load_dataset to read it through streaming 3. iterate it ### Expected behavior can iterate it successfully ### Environment info - `datasets` version: 2.12.0 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.1 I tried `storage_options` before, but it doesn't work, I checked our source code and I found that we even didn't pass this parameter to the following process. if I use `storage_options` instead of `use_auth_token`, then I also need to change another place of the code. the last line of `streaming_download_manager.py`. our code only passes the `use_auth_token` to the following handler, but does nothing to the `storage_options` <img width="1050" alt="image" src="https://github.com/huggingface/datasets/assets/59083384/5be90933-3331-4ecf-9e11-34f9852d8f92">
[ -0.028941556811332703, -0.3251906633377075, -0.05548103153705597, 0.5395929217338562, 0.4121260344982147, 0.09475596994161606, 0.3216099739074707, -0.0892593115568161, 0.08491154760122299, 0.16818025708198547, -0.043760765343904495, 0.30375683307647705, 0.07043804228305817, 0.27038541436195374, -0.045362360775470734, 0.1393456757068634, 0.021782103925943375, 0.20719975233078003, 0.05748514086008072, 0.07159225642681122, -0.1592271476984024, 0.16487573087215424, -0.10626810044050217, -0.40650472044944763, 0.10991379618644714, 0.036149412393569946, -0.12653908133506775, 0.11795824766159058, -0.29226136207580566, -0.5158582329750061, 0.015359453856945038, 0.10274507105350494, 0.29423466324806213, 0.6071954965591431, -0.00012175798474345356, 0.0033920928835868835, 0.35639628767967224, -0.16472232341766357, -0.4122476577758789, -0.3499815762042999, -0.40938833355903625, -0.06687581539154053, 0.05313299596309662, -0.12624211609363556, 0.06268757581710815, -0.06430728733539581, 0.22684696316719055, -0.44114017486572266, 0.5971985459327698, 0.20823931694030762, 0.05230160802602768, 0.17431685328483582, -0.21726582944393158, 0.13965238630771637, 0.18009646236896515, 0.32149967551231384, -0.21693429350852966, 0.4524988532066345, 0.2011677771806717, 0.2852637767791748, 0.009428247809410095, 0.18613623082637787, -0.24499516189098358, 0.16698363423347473, 0.3792702853679657, -0.0237719863653183, -0.19692400097846985, -0.08107851445674896, 0.0062746331095695496, 0.1627933382987976, 0.6155344247817993, -0.0882260650396347, -0.5161035656929016, -0.33865880966186523, 0.008055269718170166, -0.1921127438545227, 0.32320261001586914, 0.07584461569786072, -0.021422244608402252, 0.08060085773468018, -0.27320802211761475, -0.15042370557785034, -0.22600695490837097, 0.3597809374332428, 0.1445179581642151, 0.08959823101758957, -0.3287242650985718, 0.053907960653305054, 0.07447272539138794, 0.009330406785011292, 0.4862780272960663, -0.125958651304245, -0.1515578031539917, 0.10462059825658798, -0.4806393086910248, 0.17481757700443268, 0.04559873044490814, -0.07879187911748886, 0.17654281854629517, 0.409728080034256, 0.3649020791053772, -0.07254721224308014, 0.07052655518054962, 0.1781812310218811, 0.20020151138305664, 0.04902717471122742, -0.06963321566581726, -0.08206887543201447, 0.026240801438689232, 0.5454880595207214, 0.20162250101566315, -0.43201398849487305, -0.22316035628318787, 0.00001621246337890625, -0.20627889037132263, -0.2556284964084625, 0.33127763867378235, -0.007836073637008667, -0.10437976568937302, -0.1725519299507141, -0.3212449550628662, -0.1302250176668167, 0.20639124512672424, 0.3553653359413147, -0.013954747468233109, 0.22736826539039612, -0.13489729166030884, 0.24221044778823853, 0.004637077450752258, 0.04056961089372635, -0.08655426651239395, -0.14583717286586761, -0.09563770890235901, 0.2986488938331604, 0.12839406728744507, -0.4520382881164551, 0.37421685457229614, 0.17871199548244476, -0.1422734260559082, -0.3368346691131592, 0.08951372653245926, -0.1519973874092102, 0.2630971372127533, 0.09476715326309204, 0.2008606493473053, 0.28534913063049316, -0.205849289894104, 0.009143941104412079, 0.054227426648139954, -0.14229492843151093, -0.3366606831550598, -0.1204352155327797, -0.045997560024261475, 0.015726126730442047, -0.4067247211933136, -0.11441706120967865, -0.44766533374786377, 0.02997415140271187, 0.08889155089855194, -0.22530913352966309, 0.21670322120189667, 0.25221139192581177, -0.14674867689609528, -0.037617702037096024, 0.28577694296836853, 0.45194917917251587, 0.02363785356283188, -0.03089931607246399, -0.19128486514091492, -0.025366222485899925, 0.36977091431617737, 0.19871021807193756, -0.01784212328493595, -0.16436982154846191, -0.4269799590110779, 0.42556047439575195, 0.2233337163925171, -0.4061688184738159, -0.45895156264305115, 0.4946541488170624, -0.13301679491996765, 0.09141520410776138, 0.5638394951820374, 0.08246396481990814, 0.09194834530353546, 0.0673871636390686, -0.2928137481212616, 0.24109803140163422, -0.02855256199836731, 0.1322842538356781, -0.06209728866815567, -0.10766777396202087, -0.1235581561923027, 0.2697751522064209, -0.2216762900352478, 0.3004612624645233, 0.17824959754943848, 0.28792157769203186, 0.24704422056674957, -0.14893490076065063, 0.08990803360939026, 0.2672538161277771, 0.4896688163280487, 0.19584019482135773, -0.02020452916622162, -0.03251226618885994, -0.38756218552589417, 0.10604775696992874, 0.46074962615966797, -0.42519500851631165, -0.10273724049329758, -0.07224330306053162, -0.028271034359931946, -0.04568108916282654, -0.3096294403076172, 0.054409995675086975, 0.003470994532108307, 0.6463304162025452, -0.0031315386295318604, -0.12437444180250168, -0.2222329080104828, 0.21991665661334991, -0.04318434000015259, -0.020995426923036575, -0.46385979652404785, 0.23945827782154083, 0.12313921004533768, -0.2593365013599396, 0.11275181174278259, -0.17475607991218567, 0.2984919846057892, -0.2598707973957062, -0.1023906022310257, 0.4630483090877533, 0.33474358916282654, 0.5652827024459839, -0.13773298263549805, -0.05596669018268585, 0.26389944553375244, -0.08410552889108658, -0.1811700463294983, 0.09333907812833786, 0.1510898768901825, -0.011449821293354034, -0.021175848320126534, 0.14164948463439941, -0.32407060265541077, 0.3495209813117981, 0.019785702228546143, -0.015114925801753998, 0.09456731379032135, -0.1769949048757553, -0.2962832450866699, 0.023272372782230377, 0.29074400663375854, -0.018825773149728775, 0.1717505306005478, -0.058107890188694, -0.33353501558303833, -0.18363218009471893, 0.5600237846374512, 0.11476759612560272, -0.2523426413536072, -0.00042029417818412185, -0.05659294128417969, -0.1684272587299347, 0.3402973711490631, 0.34599044919013977, 0.480771541595459, -0.012199662625789642, 0.02960207872092724, 0.03730606287717819, 0.3703356087207794, -0.15999916195869446, 0.054788731038570404, 0.2972522974014282, 0.5271713137626648, 0.3931705057621002, 0.09902101755142212, -0.04629521071910858, -0.16522353887557983, -0.16990268230438232, 0.1830468624830246, -0.047306716442108154, -0.28306519985198975, 0.24940702319145203, -0.3759632110595703, -0.1617007702589035, -0.05012626200914383, -0.05244560167193413, -0.14163005352020264, -0.24835622310638428, -0.32759609818458557, 0.7372050285339355, 0.00003499537706375122, -0.05819123983383179, 0.06917966902256012, 0.0996774286031723, 0.2352427840232849, -0.1719258576631546, -0.6176291704177856, 0.11165120452642441, -0.013667741790413857, -0.14928415417671204, 0.40937167406082153, -0.19671712815761566, 0.16860255599021912, -0.14099878072738647, -0.20527149736881256, -0.4934014678001404, 0.03107905387878418, 0.15027257800102234, 0.09778101742267609, 0.42706143856048584, 0.17483162879943848, 0.25730055570602417, -0.21548202633857727, 0.09395331144332886, 0.1169285923242569, -0.08369340747594833, -0.23481890559196472, 0.294321745634079, 0.13239014148712158, 0.1355430781841278, -0.08104018867015839, -0.12263675034046173, -0.02581246756017208, -0.3929155468940735, 0.4801677167415619, -0.09079156070947647, 0.07514627277851105, 0.03814978525042534, 0.18555444478988647, 0.27830660343170166, -0.047705214470624924, 0.18455497920513153, -0.25129178166389465, -0.604698121547699, 0.34871572256088257, -0.2747889757156372, -0.3544391095638275, 0.1588253378868103, 0.12038315832614899, 0.3257616460323334, 0.056732017546892166, -0.5593644380569458, -0.2726536989212036, 0.02586074359714985, -0.10716401040554047, -0.48213282227516174, -0.1053936704993248, 0.20415759086608887, -0.21431198716163635, 0.1119885966181755, -0.3783809542655945, -0.049058131873607635, -0.14489923417568207, 0.07064832001924515, 0.33658134937286377, 0.28167808055877686, 0.6826820373535156, 0.2627193033695221, 0.4416087567806244, 0.49071866273880005, 0.07947253435850143, 0.7151522040367126, -0.33233702182769775, 0.2892322540283203, 0.02412283420562744, -0.3042621910572052, 0.0060483552515506744, 0.027311503887176514, -0.16119584441184998, 0.01717451587319374, -0.13674700260162354, 0.07655971497297287, -0.2850797474384308, 0.016726411879062653, -0.26495516300201416, -0.0497305653989315, -0.09944671392440796, -0.21959525346755981, 0.09260188043117523, -0.049504417926073074, 0.10316185653209686, 0.13311494886875153, -0.04483041539788246, -0.13286922872066498, 0.3641599714756012, 0.29256972670555115, 0.1482688933610916, -0.012632474303245544, -0.3218141794204712, -0.36453157663345337, 0.0488293394446373, 0.04944904148578644, 0.5159381031990051, 0.05211159586906433, 0.03209960460662842, 0.1896008849143982, -0.30984312295913696, 0.9405340552330017, -0.14893044531345367, 0.04742182791233063, -0.051218897104263306, -0.1229691207408905, -0.3435370922088623, 0.05822443962097168, -0.1402522176504135, 0.11873363703489304, 0.21258771419525146, 0.4827081859111786, -0.16388848423957825, -0.21791647374629974, -0.12801629304885864, -0.02607014589011669, 0.02013956755399704, -0.3672311305999756, -0.22173452377319336, -0.22617842257022858, -0.413964182138443, -0.34830087423324585, 0.14166055619716644, 0.24412831664085388, 0.06120716780424118, -0.1540643721818924, -0.033028122037649155, 0.09383530169725418, -0.011010739952325821, 0.04185052216053009, 0.1603998839855194, 0.23942136764526367, 0.26199251413345337, 0.3690057694911957, 0.10523627698421478, 0.5801745653152466, 0.6529549360275269, 0.6335623264312744, -0.26901331543922424, 0.18407639861106873, 0.0012674741446971893, 0.24117964506149292, 0.11574626713991165, -0.085471972823143, 0.0968538224697113, 0.21561601758003235, 0.014504434540867805, -0.21913285553455353, 0.04023686796426773, 0.3100925087928772, -0.09849008917808533, 0.23749947547912598, -0.30470919609069824, 0.40932831168174744, 0.0037233158946037292, 0.0569944828748703, 0.28014910221099854, -0.08153632283210754, -0.19761046767234802, -0.011936891824007034, 0.024366119876503944, 0.6131526827812195, 0.03164013475179672, 0.0756167620420456, 0.44552332162857056, -0.18368004262447357, 0.37359246611595154, -0.13311728835105896, 0.02859869971871376, -0.11709816008806229, -0.270046204328537, -0.1431979537010193, -0.24500015377998352, 0.15864069759845734, 0.060642607510089874, -0.23875842988491058, 0.09142827242612839, 0.10328483581542969, 0.5431159734725952, 0.025112804025411606, 0.2127816081047058, -0.6289317607879639, -0.11796952039003372, -0.4272043704986572, 0.03211791440844536, -0.12753340601921082, -0.05346176400780678, 0.0747729241847992, -0.2737535834312439, -0.011923231184482574, 0.14041167497634888, -0.10153753310441971, 0.11142081022262573, -0.19142943620681763, -0.1314304620027542, -0.15335851907730103, -0.2330588698387146, -0.009196363389492035, 0.3114888668060303, -0.2585147023200989, -0.08438093960285187, -0.4331381022930145, -0.009462451562285423, -0.05971201881766319, -0.13019606471061707, -0.34273621439933777, -0.08742126077413559, 0.19855840504169464, -0.035978347063064575, -0.032424524426460266, 0.007788556627929211, 0.11401596665382385, -0.2669517993927002, 0.21062687039375305, -0.1050749346613884, 0.029230386018753052, -0.11861380934715271, -0.2530001401901245, -0.08959397673606873, -0.0985310897231102, -0.1593683362007141, 0.03949267044663429, -0.07137492299079895, -0.14082540571689606, -0.10273394733667374, -0.2269192636013031, -0.09561934322118759, -0.05861605331301689, 0.7336450815200806, -0.2823083996772766, 0.14145709574222565, 0.4912394881248474, 0.1551213264465332, -0.042822305113077164, -0.1548783928155899, 0.29129886627197266, -0.2876811623573303, -0.007577881217002869, 0.0887695848941803, -0.09111875295639038, 0.10826794803142548, -0.2983795702457428, -0.23169566690921783, 0.10371609777212143, -0.15801098942756653, 0.04009612649679184, -0.44995421171188354, -0.023874584585428238, 0.006066462025046349, -0.13851836323738098, 0.10058966279029846, -0.08625400066375732, -0.030825749039649963, -0.04703044891357422, -0.28571832180023193, -0.1758178472518921, 0.05327077955007553, -0.25479602813720703, 0.004743192344903946, 0.12404482066631317, 0.06458490341901779, 0.07266971468925476, -0.1517518162727356, -0.014914896339178085, 0.27104485034942627, -0.08852092921733856, -0.10008855164051056, -0.2028828263282776, 0.17071279883384705, 0.41790610551834106, -0.047666117548942566, -0.0909074991941452, -0.28045186400413513, -0.4272911846637726, -0.17052671313285828, -0.0398545004427433, 0.14378409087657928, 0.05148858577013016, 0.23024405539035797, 0.16876807808876038, 0.005528201349079609, -0.18269243836402893, -0.06931653618812561, 0.011008162051439285, 0.07468543946743011, -0.38057318329811096, 0.359042763710022, 0.08092556893825531, 0.023073576390743256, -0.3255821466445923, 0.005052836611866951, 0.14011968672275543, 0.07056774944067001, 0.40167778730392456, -0.24448034167289734, -0.003015846014022827, 0.034839265048503876, 0.17699740827083588, 0.6493374109268188, -0.23834724724292755, 0.07311191409826279, 0.08341063559055328, 0.0701894760131836, 0.05295085906982422, 0.07482748478651047, -0.22097399830818176, 0.03527757525444031, 0.0272044837474823, 0.13067205250263214, 0.002419702708721161, -0.10515393316745758, 0.044452644884586334, 0.08922729641199112, 0.3592159152030945, 0.18393394351005554, 0.1302681416273117, 0.13657252490520477, -0.1874084323644638, 0.14233672618865967, 0.22106368839740753, 0.22354432940483093, 0.010874342173337936, 0.2685171365737915, -0.18833467364311218, 0.05698224902153015, -0.17867398262023926, 0.5295495986938477, -0.18614411354064941, -0.19941195845603943, -0.26706117391586304, 0.04969741031527519, -0.2797592282295227, 0.22478927671909332, -0.14190520346164703, 0.08986835181713104, 0.04090763255953789, 0.05049285292625427, -0.16697752475738525, 0.09912656247615814, 0.12421950697898865, -0.08180243521928787, -0.5577245950698853, -0.047025904059410095, -0.17402562499046326, 0.09863798320293427, 0.18278752267360687, -0.12260604649782181, 0.23446011543273926, 0.275344580411911, -0.016426146030426025, -0.45338261127471924, 0.13426344096660614, 0.3514750003814697, 0.09788183867931366, -0.4750019311904907, 0.2879277169704437, -0.10425004363059998, 0.10693846642971039, 0.10605663061141968, 0.21922431886196136, 0.16441252827644348, 0.24726346135139465, 0.23359046876430511, -0.04524055868387222, 0.049172598868608475, -0.18039585649967194, 0.04300256073474884, 0.41365116834640503, -0.021428056061267853, -0.02224775403738022, 0.13492493331432343, -0.014728765934705734, -0.05470583215355873, 0.16215506196022034, -0.07056082040071487, 0.32271695137023926, -0.5276942849159241, 0.15397517383098602, -0.29375916719436646, -0.07585594058036804, -0.0014407038688659668, 0.006803523749113083, -0.5196665525436401, 0.2277640998363495, 0.3539861738681793, -0.14645957946777344, 0.2912648916244507, -0.0020481981337070465, 0.026500292122364044, -0.22386085987091064, 0.3270414471626282, 0.22047452628612518, 0.024170605465769768, -0.14081326127052307, -0.22420716285705566, -0.4081479012966156, -0.0537719763815403, 0.2512376010417938, -0.34905070066452026, 0.11503981053829193, 0.27163416147232056, -0.14056351780891418, 0.07798349857330322, 0.03732335567474365, 0.03706793114542961, 0.0253838449716568, 0.5271070003509521, -0.1314796805381775, -0.7182748317718506, -0.09533939510583878, 0.21288084983825684, 0.015625908970832825, -0.2388269007205963, 0.40643420815467834, -0.33189308643341064, -0.05745501071214676, -0.0908629521727562, 0.06140999495983124, -0.12495596706867218, -0.13157792389392853, 0.41263264417648315, 0.002370903268456459, -0.04267195239663124, -0.2768743634223938, 0.10042478144168854, -0.40736570954322815, -0.25155073404312134, -0.27966639399528503, 0.09552444517612457, -0.14285963773727417, 0.4414544105529785, -0.2435779571533203, -0.03143006190657616, -0.3671933114528656, 0.12310149520635605, -0.03134133666753769, -0.22166810929775238, -0.11187227070331573, 0.3641888499259949, -0.26331567764282227, 0.2581024467945099, -0.12451969087123871, 0.11138203740119934, -0.18070456385612488, 0.1369885951280594, -0.3364325165748596, -0.328993558883667, 0.2987130582332611, -0.6428592205047607, -0.10138659179210663, 0.28456050157546997, 0.16089335083961487, 0.14912717044353485, -0.15650291740894318, -0.45904311537742615, 0.30017369985580444, 0.408505916595459, -0.13576829433441162, -0.1996346116065979, 0.32151976227760315, 0.12427301704883575, 0.07654686272144318, -0.08074761182069778, 0.2125113308429718, 0.4024067223072052, -0.28534504771232605, 0.19041208922863007, -0.1465044617652893 ]
https://github.com/huggingface/datasets/issues/5880
Cloud storage support is still experimental indeed and you can expect some bugs. I think we need to pass the storage options anywhere use_auth_token is passed in indeed. Let me know if you'd be interested in contributing a fix !
load_dataset from s3 file system through streaming can't not iterate data
### Describe the bug I have a JSON file in my s3 file system(minio), I can use load_dataset to get the file link, but I can't iterate it <img width="816" alt="image" src="https://github.com/huggingface/datasets/assets/59083384/cc0778d3-36f3-45b5-ac68-4e7c664c2ed0"> <img width="1144" alt="image" src="https://github.com/huggingface/datasets/assets/59083384/76872af3-8b3c-42ff-9f55-528c920a7af1"> we can change 4 lines to fix this bug, you can check whether it is ok for us. <img width="941" alt="image" src="https://github.com/huggingface/datasets/assets/59083384/5a22155a-ece7-496c-8506-047e5c235cd3"> ### Steps to reproduce the bug 1. storage a file in you s3 file system 2. use load_dataset to read it through streaming 3. iterate it ### Expected behavior can iterate it successfully ### Environment info - `datasets` version: 2.12.0 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.1
40
load_dataset from s3 file system through streaming can't not iterate data ### Describe the bug I have a JSON file in my s3 file system(minio), I can use load_dataset to get the file link, but I can't iterate it <img width="816" alt="image" src="https://github.com/huggingface/datasets/assets/59083384/cc0778d3-36f3-45b5-ac68-4e7c664c2ed0"> <img width="1144" alt="image" src="https://github.com/huggingface/datasets/assets/59083384/76872af3-8b3c-42ff-9f55-528c920a7af1"> we can change 4 lines to fix this bug, you can check whether it is ok for us. <img width="941" alt="image" src="https://github.com/huggingface/datasets/assets/59083384/5a22155a-ece7-496c-8506-047e5c235cd3"> ### Steps to reproduce the bug 1. storage a file in you s3 file system 2. use load_dataset to read it through streaming 3. iterate it ### Expected behavior can iterate it successfully ### Environment info - `datasets` version: 2.12.0 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.1 Cloud storage support is still experimental indeed and you can expect some bugs. I think we need to pass the storage options anywhere use_auth_token is passed in indeed. Let me know if you'd be interested in contributing a fix !
[ -0.02695624530315399, -0.29852840304374695, -0.02578524872660637, 0.49376577138900757, 0.41069313883781433, 0.04066244512796402, 0.35842058062553406, -0.07718323916196823, 0.0702420100569725, 0.11812220513820648, 0.01759123057126999, 0.2411087453365326, 0.08481022715568542, 0.3905630111694336, -0.006751440465450287, 0.22295351326465607, 0.05686921998858452, 0.10815613716840744, 0.05294463783502579, -0.052024807780981064, -0.14147697389125824, 0.18752238154411316, -0.12782861292362213, -0.3429829478263855, -0.029809461906552315, -0.051176078617572784, -0.16741956770420074, 0.1837589591741562, -0.2523903250694275, -0.3331598937511444, 0.14490589499473572, 0.04545417055487633, 0.2348000556230545, 0.5824021100997925, -0.0001219933619722724, 0.017892852425575256, 0.32846859097480774, -0.08153797686100006, -0.41245216131210327, -0.4400266408920288, -0.3710032105445862, 0.04024814814329147, 0.13043475151062012, -0.1496717631816864, -0.03224319964647293, -0.055718082934617996, 0.16550911962985992, -0.3907587230205536, 0.7093198299407959, 0.16087082028388977, 0.0483931303024292, 0.18733549118041992, -0.2525399625301361, 0.1559951901435852, 0.185979962348938, 0.40848368406295776, -0.2262198030948639, 0.42765194177627563, 0.23696857690811157, 0.14828090369701385, 0.04302861541509628, 0.197988361120224, -0.16190475225448608, 0.11157509684562683, 0.3312322497367859, 0.00018139556050300598, -0.2619854807853699, -0.08723925054073334, -0.05849340930581093, 0.19020840525627136, 0.6777195334434509, -0.10400377213954926, -0.5187743902206421, -0.29996442794799805, -0.018053775653243065, -0.13848257064819336, 0.41005390882492065, 0.10074964165687561, 0.038102149963378906, 0.1705116480588913, -0.28082677721977234, -0.1388869285583496, -0.27566903829574585, 0.4551413953304291, 0.14180736243724823, 0.006681665778160095, -0.34639090299606323, 0.08743592351675034, 0.030864238739013672, -0.09387225657701492, 0.33123934268951416, -0.06160767003893852, -0.15017279982566833, 0.10352741181850433, -0.4920342266559601, 0.07409323751926422, -0.025879759341478348, -0.062482766807079315, 0.2936086356639862, 0.48509690165519714, 0.4455651640892029, -0.01705317012965679, -0.12069860100746155, 0.1918855905532837, 0.2857302129268646, 0.117585688829422, 0.010286491364240646, -0.07989350706338882, 0.10556011646986008, 0.42220497131347656, 0.12933439016342163, -0.44282689690589905, -0.21219877898693085, -0.017890844494104385, -0.285338819026947, -0.2736022174358368, 0.3458653688430786, -0.07096701860427856, -0.08514305204153061, -0.1458415389060974, -0.2807677388191223, -0.09309961646795273, 0.16596375405788422, 0.38156795501708984, 0.0848986953496933, 0.11398488283157349, -0.10636010766029358, 0.32935860753059387, -0.029480252414941788, 0.07904970645904541, -0.10844821482896805, -0.09469381719827652, -0.03371371328830719, 0.31436237692832947, 0.12906552851200104, -0.392624169588089, 0.39950862526893616, 0.09941574931144714, -0.03783196583390236, -0.3327147960662842, 0.10171403735876083, -0.12806883454322815, 0.24462786316871643, 0.03654952719807625, 0.1404784768819809, 0.27221041917800903, -0.18565481901168823, 0.010936178267002106, 0.06711989641189575, -0.2211458384990692, -0.41645967960357666, -0.10818461328744888, -0.0913182869553566, -0.002012212760746479, -0.4150446653366089, -0.10481590032577515, -0.4127252399921417, -0.0014500236138701439, 0.08070746809244156, -0.16848617792129517, 0.23525314033031464, 0.2250176966190338, -0.12597300112247467, 0.02094656229019165, 0.24358412623405457, 0.37577080726623535, 0.08481940627098083, 0.010428100824356079, -0.1645466685295105, 0.01849893108010292, 0.2526044249534607, 0.24233795702457428, -0.07138265669345856, -0.13103961944580078, -0.41673117876052856, 0.4365733861923218, 0.2029624730348587, -0.6026992797851562, -0.39743390679359436, 0.5299043655395508, -0.11995687335729599, 0.14178957045078278, 0.3652172088623047, 0.09224624931812286, -0.018550364300608635, 0.11200259625911713, -0.19954082369804382, 0.3084522485733032, 0.08485604077577591, 0.062383346259593964, -0.10083134472370148, -0.09589262306690216, -0.08952219784259796, 0.23355138301849365, -0.2622864544391632, 0.26919686794281006, 0.21699641644954681, 0.22976893186569214, 0.24885240197181702, -0.16340231895446777, 0.04367890954017639, 0.2794867753982544, 0.5147988200187683, 0.0854623019695282, 0.035776764154434204, -0.0421321727335453, -0.44066882133483887, 0.12016485631465912, 0.4711324870586395, -0.3666350245475769, -0.1332370638847351, -0.060270823538303375, 0.02834482491016388, -0.01847347989678383, -0.3581198453903198, -0.008383560925722122, -0.01977214217185974, 0.4614667296409607, 0.0450376495718956, -0.06470641493797302, -0.25991207361221313, 0.2411872148513794, -0.034012697637081146, 0.01212196797132492, -0.4703354835510254, 0.3506260812282562, 0.16182120144367218, -0.22258040308952332, 0.10101078450679779, -0.0574125237762928, 0.34901025891304016, -0.30585551261901855, -0.10816531628370285, 0.45568954944610596, 0.3414917588233948, 0.49748799204826355, -0.12498600780963898, -0.0015758723020553589, 0.3487284779548645, -0.08187912404537201, -0.20675542950630188, -0.02524968422949314, 0.07741793245077133, -0.08067833632230759, -0.03619655221700668, 0.22832104563713074, -0.3769795894622803, 0.43501710891723633, -0.019706539809703827, 0.004292339086532593, 0.02965613454580307, -0.2006879597902298, -0.26476284861564636, 0.033615000545978546, 0.33853277564048767, -0.082524374127388, 0.19924956560134888, -0.20438572764396667, -0.26611337065696716, -0.17278480529785156, 0.5080811977386475, 0.09815643727779388, -0.2217921018600464, 0.040737949311733246, -0.0638202428817749, -0.10953903198242188, 0.40125054121017456, 0.18614129722118378, 0.4673665761947632, -0.036192387342453, -0.06714855134487152, 0.01297675259411335, 0.354215145111084, -0.1442660093307495, 0.0036482922732830048, 0.2859923839569092, 0.47033989429473877, 0.2720494270324707, 0.18871988356113434, -0.07541881501674652, -0.21464794874191284, -0.16814106702804565, 0.09862422198057175, 0.012455331161618233, -0.28770729899406433, 0.3221568465232849, -0.3676871359348297, -0.1341474950313568, 0.04915981367230415, -0.07496894896030426, -0.1434430480003357, -0.2820008397102356, -0.3051733076572418, 0.7067194581031799, 0.00975867360830307, -0.08904065191745758, 0.15027858316898346, 0.12456516921520233, 0.29627901315689087, -0.18729212880134583, -0.6374976634979248, 0.07214221358299255, 0.012575715780258179, -0.12478195875883102, 0.4102517068386078, -0.0731126070022583, 0.14425604045391083, -0.08629429340362549, -0.20647217333316803, -0.5691779851913452, -0.0839046984910965, 0.1888173371553421, 0.025147825479507446, 0.5261157155036926, 0.08838163316249847, 0.2287990152835846, -0.293032169342041, 0.10631760954856873, 0.1563183069229126, -0.07786208391189575, -0.2505808174610138, 0.3321434259414673, 0.10025110840797424, 0.08333972096443176, -0.06030678004026413, -0.1022564172744751, -0.04074122756719589, -0.25274404883384705, 0.6356229782104492, 0.025986462831497192, 0.039855606853961945, 0.12316619604825974, 0.2312307059764862, 0.18314698338508606, -0.11474161595106125, 0.08824209868907928, -0.30192238092422485, -0.626485288143158, 0.29001688957214355, -0.2965649664402008, -0.4653685688972473, 0.12976491451263428, 0.1373068392276764, 0.32374194264411926, 0.009324990212917328, -0.5617010593414307, -0.4167705178260803, 0.0021911580115556717, -0.06528571248054504, -0.44898027181625366, -0.1651087999343872, 0.20440849661827087, -0.28801172971725464, 0.11684781312942505, -0.3440307378768921, -0.056195370852947235, -0.016762256622314453, 0.12040287256240845, 0.253010094165802, 0.28511109948158264, 0.5930700302124023, 0.28090614080429077, 0.3229757249355316, 0.3917887210845947, 0.029613390564918518, 0.644891619682312, -0.36515045166015625, 0.24334871768951416, -0.003973424434661865, -0.3428749442100525, 0.09008638560771942, -0.004879169166088104, -0.16071051359176636, 0.014256946742534637, -0.06445502489805222, 0.18587496876716614, -0.321524441242218, 0.015936188399791718, -0.3024992346763611, -0.06793364882469177, -0.1561170369386673, -0.21276409924030304, 0.017798807471990585, 0.039196476340293884, 0.09889110922813416, 0.13924823701381683, -0.08593101799488068, -0.05906223878264427, 0.3040427565574646, 0.2894270420074463, 0.12906447052955627, -0.11311263591051102, -0.3438434302806854, -0.35066789388656616, 0.1111426129937172, -0.010246127843856812, 0.45718634128570557, -0.018406569957733154, 0.057340845465660095, 0.23843111097812653, -0.29164689779281616, 0.9706100225448608, -0.12001899629831314, 0.06530825048685074, -0.09342506527900696, -0.1418323665857315, -0.41132181882858276, 0.128561332821846, -0.1189996600151062, 0.12378257513046265, 0.22273606061935425, 0.6470974683761597, -0.10238087177276611, -0.24252037703990936, -0.1679101288318634, -0.04614603891968727, 0.0003444105386734009, -0.3710296154022217, -0.19611871242523193, -0.2207930088043213, -0.4443594515323639, -0.3417874872684479, 0.15943363308906555, 0.20922812819480896, 0.006887320429086685, -0.17346619069576263, -0.043412864208221436, 0.0628441795706749, 0.030749287456274033, 0.04534835368394852, 0.1848655641078949, 0.07869170606136322, 0.31030726432800293, 0.405957967042923, 0.045812565833330154, 0.5583285689353943, 0.7075912356376648, 0.6025534868240356, -0.1909303516149521, 0.14243948459625244, -0.008264515548944473, 0.2348308116197586, 0.20191985368728638, -0.12026955187320709, 0.1001984179019928, 0.17934855818748474, 0.049839600920677185, -0.22330069541931152, 0.0630013570189476, 0.3288174867630005, -0.04929184541106224, 0.09119593352079391, -0.22453001141548157, 0.4807779788970947, -0.04741475731134415, 0.06454367935657501, 0.2390582114458084, 0.07674331218004227, -0.20548206567764282, 0.16725079715251923, -0.0391111895442009, 0.6771043539047241, 0.011316219344735146, 0.1079941913485527, 0.4734920859336853, 0.02112596482038498, 0.421150803565979, -0.29286330938339233, -0.0527024120092392, -0.16830743849277496, -0.23912884294986725, -0.18233412504196167, -0.25623154640197754, 0.16899727284908295, 0.14199554920196533, -0.1515917330980301, 0.06874507665634155, 0.12291319668292999, 0.4908149242401123, 0.026107706129550934, 0.27937862277030945, -0.49766480922698975, -0.08858032524585724, -0.3048185408115387, 0.037937603890895844, -0.08389196544885635, 0.028857655823230743, 0.11108030378818512, -0.3343172073364258, -0.06172802299261093, 0.023054078221321106, -0.048450857400894165, 0.13655522465705872, -0.1986922025680542, -0.092588871717453, -0.07443401217460632, -0.29585447907447815, 0.046196818351745605, 0.26881131529808044, -0.1250540316104889, -0.048045266419649124, -0.5085051655769348, 0.04513674974441528, -0.0583544485270977, -0.17476192116737366, -0.3759284019470215, -0.1406758427619934, 0.1803889274597168, -0.06682001799345016, -0.04615329951047897, -0.04432497173547745, 0.1431371569633484, -0.33779090642929077, 0.14162303507328033, 0.012333206832408905, -0.08043868839740753, -0.11947481334209442, -0.2507537305355072, 0.008215144276618958, -0.11221574991941452, -0.20401014387607574, 0.034345731139183044, -0.0076013486832380295, -0.07527251541614532, -0.11128468811511993, -0.09286078810691833, -0.0749182179570198, -0.05067140609025955, 0.7962504029273987, -0.31058499217033386, 0.043999336659908295, 0.5582000613212585, 0.18562661111354828, -0.0348847471177578, -0.1499309241771698, 0.258638858795166, -0.18342088162899017, -0.027637802064418793, 0.011262081563472748, -0.03738274797797203, 0.22969597578048706, -0.27650102972984314, -0.12162692844867706, 0.045201726257801056, -0.18342939019203186, 0.14799244701862335, -0.4742274880409241, 0.033938340842723846, 0.07368320971727371, -0.09937746822834015, 0.0472586452960968, -0.060740724205970764, 0.06426839530467987, -0.08919121325016022, -0.2373783439397812, -0.1758117377758026, 0.07011302560567856, -0.19468820095062256, -0.001497587189078331, 0.18473169207572937, 0.08212199807167053, 0.22197625041007996, -0.15215641260147095, -0.009244006127119064, 0.2731156349182129, -0.08887127041816711, -0.12447972595691681, -0.24068574607372284, 0.18622371554374695, 0.4591183364391327, -0.0993562638759613, -0.10744844377040863, -0.24819166958332062, -0.33968472480773926, -0.17648930847644806, 0.0073118507862091064, 0.19906887412071228, 0.04157501459121704, 0.1855667680501938, 0.16991588473320007, 0.026125403121113777, -0.12644459307193756, -0.0650629848241806, 0.03136950731277466, 0.05934799090027809, -0.341418981552124, 0.2853489816188812, 0.014523468911647797, 0.03268778324127197, -0.20953866839408875, -0.03528350591659546, 0.11223888397216797, 0.12362146377563477, 0.35611629486083984, -0.3312147557735443, -0.023200996220111847, -0.06338699907064438, 0.18123596906661987, 0.583889901638031, -0.32178813219070435, 0.10513893514871597, 0.07434257119894028, 0.07534503191709518, 0.03966935724020004, 0.025907136499881744, -0.2692245543003082, 0.07999694347381592, -0.02885384112596512, 0.09028534591197968, 0.043399035930633545, -0.10813990235328674, 0.010384727269411087, 0.06805312633514404, 0.33345985412597656, 0.08607365190982819, 0.08075670897960663, -0.04438977688550949, -0.317371666431427, 0.09369224309921265, 0.21144913136959076, 0.2036026418209076, 0.021685127168893814, 0.3138699531555176, -0.2962750196456909, -0.027406811714172363, -0.07826697081327438, 0.45520374178886414, -0.1590617299079895, -0.23217390477657318, -0.24452874064445496, 0.05218060687184334, -0.17780686914920807, 0.18943539261817932, -0.21110908687114716, 0.18707875907421112, 0.08219222724437714, 0.08298914134502411, -0.1759856790304184, 0.06288766860961914, 0.110389843583107, -0.015195518732070923, -0.4539026916027069, -0.07949437201023102, -0.09270750731229782, 0.050990357995033264, 0.09008736908435822, -0.2877070903778076, 0.27810537815093994, 0.29751572012901306, -0.00021624937653541565, -0.44949227571487427, 0.1161690205335617, 0.3623998463153839, 0.11139210313558578, -0.4269416928291321, 0.3633618950843811, -0.0623440146446228, 0.07342961430549622, 0.15857958793640137, 0.15909475088119507, 0.20611821115016937, 0.2665635645389557, 0.2281859666109085, 0.06264540553092957, -0.04401923343539238, -0.1735248565673828, 0.1269107311964035, 0.4690876305103302, -0.08331654220819473, -0.0987844467163086, 0.22450673580169678, -0.0020159371197223663, -0.03345142677426338, 0.16555047035217285, -0.01964912749826908, 0.4002406597137451, -0.5966993570327759, 0.11903774738311768, -0.4026526212692261, -0.024382993578910828, -0.09296241402626038, 0.008533652871847153, -0.47332629561424255, 0.1792650669813156, 0.3365212082862854, -0.11809142678976059, 0.27694565057754517, -0.024306142702698708, 0.02754630148410797, -0.29000452160835266, 0.3378937840461731, 0.2858416438102722, -0.01632418856024742, -0.29282015562057495, -0.17574596405029297, -0.33377230167388916, -0.0019561760127544403, 0.10927461087703705, -0.24997764825820923, 0.026676099747419357, 0.2757057547569275, -0.16553151607513428, 0.12323474884033203, 0.027534473687410355, -0.009886275976896286, -0.08983679860830307, 0.49547821283340454, -0.15555745363235474, -0.5388219952583313, -0.12859107553958893, 0.20214593410491943, 0.04256610572338104, -0.20595961809158325, 0.3610589802265167, -0.28400906920433044, -0.09543296694755554, -0.038705457001924515, 0.06726162880659103, -0.1756356656551361, -0.19427022337913513, 0.4539686441421509, 0.04772205650806427, -0.0011673606932163239, -0.20743855834007263, 0.08639340102672577, -0.3926030397415161, -0.4255966544151306, -0.18737709522247314, 0.16705571115016937, -0.14508315920829773, 0.35772770643234253, -0.20573705434799194, -0.04093893989920616, -0.3034095764160156, 0.10790500044822693, -0.08528433740139008, -0.3352818191051483, -0.11235429346561432, 0.41560590267181396, -0.19672268629074097, 0.26988649368286133, -0.1653425246477127, 0.12472029030323029, -0.16054163873195648, 0.12612834572792053, -0.33028995990753174, -0.37211519479751587, 0.37573355436325073, -0.7545580863952637, -0.10086099058389664, 0.3921375572681427, 0.20820051431655884, 0.23023729026317596, -0.27843764424324036, -0.48260995745658875, 0.25696057081222534, 0.41357019543647766, -0.11023729294538498, -0.11103728413581848, 0.2830996513366699, 0.1710233837366104, 0.041157618165016174, -0.13921377062797546, 0.22140461206436157, 0.4409716725349426, -0.33053094148635864, 0.27657729387283325, -0.14988097548484802 ]
https://github.com/huggingface/datasets/issues/5880
Oh, that's great, I really like to fix it. because datasets is really useful and most of our projects need to use it, but we can store our data on the internet due to security reasons. fix it not only make our own work more efficient but also can benefit others who use it.
load_dataset from s3 file system through streaming can't not iterate data
### Describe the bug I have a JSON file in my s3 file system(minio), I can use load_dataset to get the file link, but I can't iterate it <img width="816" alt="image" src="https://github.com/huggingface/datasets/assets/59083384/cc0778d3-36f3-45b5-ac68-4e7c664c2ed0"> <img width="1144" alt="image" src="https://github.com/huggingface/datasets/assets/59083384/76872af3-8b3c-42ff-9f55-528c920a7af1"> we can change 4 lines to fix this bug, you can check whether it is ok for us. <img width="941" alt="image" src="https://github.com/huggingface/datasets/assets/59083384/5a22155a-ece7-496c-8506-047e5c235cd3"> ### Steps to reproduce the bug 1. storage a file in you s3 file system 2. use load_dataset to read it through streaming 3. iterate it ### Expected behavior can iterate it successfully ### Environment info - `datasets` version: 2.12.0 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.1
54
load_dataset from s3 file system through streaming can't not iterate data ### Describe the bug I have a JSON file in my s3 file system(minio), I can use load_dataset to get the file link, but I can't iterate it <img width="816" alt="image" src="https://github.com/huggingface/datasets/assets/59083384/cc0778d3-36f3-45b5-ac68-4e7c664c2ed0"> <img width="1144" alt="image" src="https://github.com/huggingface/datasets/assets/59083384/76872af3-8b3c-42ff-9f55-528c920a7af1"> we can change 4 lines to fix this bug, you can check whether it is ok for us. <img width="941" alt="image" src="https://github.com/huggingface/datasets/assets/59083384/5a22155a-ece7-496c-8506-047e5c235cd3"> ### Steps to reproduce the bug 1. storage a file in you s3 file system 2. use load_dataset to read it through streaming 3. iterate it ### Expected behavior can iterate it successfully ### Environment info - `datasets` version: 2.12.0 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.1 Oh, that's great, I really like to fix it. because datasets is really useful and most of our projects need to use it, but we can store our data on the internet due to security reasons. fix it not only make our own work more efficient but also can benefit others who use it.
[ -0.0944085493683815, -0.3428405523300171, -0.04900147393345833, 0.5541366934776306, 0.4153803288936615, 0.0999053567647934, 0.34636640548706055, -0.01778057962656021, 0.14946052432060242, 0.10418137907981873, -0.02822217345237732, 0.2770599126815796, 0.01125609502196312, 0.34685996174812317, -0.05204653739929199, 0.10316438972949982, 0.06832770258188248, 0.2124418467283249, -0.1045723706483841, -0.02251587063074112, -0.13435474038124084, 0.15888506174087524, -0.13604438304901123, -0.3114793598651886, 0.010479792952537537, 0.014008721336722374, -0.10994847863912582, 0.1805964857339859, -0.3082553446292877, -0.4301016330718994, 0.15452821552753448, 0.05899612978100777, 0.30099958181381226, 0.6936176419258118, -0.0001189963732031174, -0.024473734200000763, 0.3598552644252777, -0.05842140316963196, -0.37660616636276245, -0.30288267135620117, -0.4268292188644409, -0.09730347245931625, 0.0430770069360733, -0.1738308072090149, 0.08265884220600128, -0.06894919276237488, 0.15592221915721893, -0.44922173023223877, 0.6466591358184814, 0.16224005818367004, 0.0827505886554718, 0.18677425384521484, -0.20030228793621063, 0.15131157636642456, 0.17179906368255615, 0.3812403380870819, -0.1884486973285675, 0.48178791999816895, 0.11194571852684021, 0.1977141946554184, 0.07078000158071518, 0.27173539996147156, -0.2641162872314453, 0.15605045855045319, 0.35006389021873474, -0.06565269827842712, -0.2740228772163391, -0.08134923875331879, -0.04261445626616478, 0.28051820397377014, 0.6652984023094177, -0.1651565432548523, -0.4968850016593933, -0.33196914196014404, -0.02137741819024086, -0.15361540019512177, 0.2702390253543854, 0.04428569972515106, 0.1055145412683487, 0.12318132817745209, -0.22457580268383026, -0.1636430323123932, -0.20871245861053467, 0.3244542181491852, 0.16821874678134918, -0.0049804262816905975, -0.3626691401004791, 0.05833161249756813, -0.00851957593113184, -0.004951428156346083, 0.5111279487609863, -0.14026880264282227, -0.16416522860527039, 0.07270351052284241, -0.49692434072494507, 0.15177781879901886, 0.022863667458295822, -0.013850457966327667, 0.22252380847930908, 0.3795003592967987, 0.35803717374801636, -0.05380960553884506, -0.0059114061295986176, 0.13790690898895264, 0.2994570732116699, -0.06855160742998123, -0.03902469947934151, -0.0662507712841034, 0.10639287531375885, 0.4535693824291229, 0.08532270789146423, -0.39421409368515015, -0.19363832473754883, -0.030313920229673386, -0.1974629908800125, -0.18967661261558533, 0.3716282248497009, -0.07748575508594513, -0.08266454190015793, -0.18943002820014954, -0.31465721130371094, -0.1462671011686325, 0.17343857884407043, 0.24579115211963654, -0.01847182959318161, 0.2754509449005127, -0.13233864307403564, 0.3086071312427521, -0.05021104961633682, -0.07581976056098938, -0.08318311721086502, -0.16116176545619965, -0.07692722976207733, 0.32828131318092346, 0.12597861886024475, -0.4257583022117615, 0.3257703185081482, 0.16103073954582214, -0.12866008281707764, -0.3871338367462158, 0.041717298328876495, -0.1782291680574417, 0.1822691559791565, 0.047783758491277695, 0.1108909398317337, 0.3003910481929779, -0.1368388533592224, 0.0234220027923584, 0.03156076371669769, -0.22897657752037048, -0.3355361819267273, -0.05087796226143837, -0.01583561673760414, 0.04610300064086914, -0.4299435615539551, -0.10728752613067627, -0.43931320309638977, 0.06324617564678192, 0.032378748059272766, -0.23264537751674652, 0.21115638315677643, 0.19173544645309448, -0.18925365805625916, 0.02144814282655716, 0.27315276861190796, 0.40496498346328735, -0.06296045333147049, 0.08323386311531067, -0.1629125475883484, 0.005307566374540329, 0.2864474952220917, 0.18849386274814606, -0.010263018310070038, -0.03967883065342903, -0.41138383746147156, 0.27622222900390625, 0.22397270798683167, -0.37313228845596313, -0.4289975166320801, 0.5331472754478455, -0.12471247464418411, 0.1015419140458107, 0.40746307373046875, 0.14055177569389343, -0.05758196860551834, 0.0672525092959404, -0.2755212187767029, 0.26653963327407837, -0.002815036103129387, 0.10037433356046677, -0.08539944887161255, -0.00784716010093689, -0.10965735465288162, 0.2229774445295334, -0.2645691931247711, 0.3586079180240631, 0.1848609745502472, 0.218698650598526, 0.2839752733707428, -0.18519355356693268, 0.06793516129255295, 0.30392783880233765, 0.4624912738800049, 0.2184709906578064, 0.10417086631059647, -0.2111946940422058, -0.4065628945827484, 0.1125662624835968, 0.4712705910205841, -0.44220659136772156, -0.06455357372760773, -0.07442082464694977, -0.031702421605587006, 0.012375585734844208, -0.3486413359642029, 0.07816262543201447, 0.013112179934978485, 0.4960019290447235, 0.07142816483974457, -0.0806390792131424, -0.278154194355011, 0.24370452761650085, -0.046711552888154984, 0.0028778836131095886, -0.5677569508552551, 0.3067401349544525, 0.13613547384738922, -0.1313909888267517, 0.12490156292915344, -0.07248576730489731, 0.2423548400402069, -0.28685641288757324, -0.09373109042644501, 0.41982585191726685, 0.2847852408885956, 0.47895726561546326, -0.023853987455368042, -0.023936599493026733, 0.20739947259426117, -0.23409447073936462, -0.18370871245861053, 0.06922593712806702, 0.17162181437015533, -0.03610342741012573, -0.030694253742694855, 0.18794995546340942, -0.4166851043701172, 0.4311303496360779, -0.06383328139781952, -0.00043816864490509033, 0.08051371574401855, -0.21573111414909363, -0.3809579312801361, 0.1068134754896164, 0.335741251707077, -0.0890454575419426, 0.0865737795829773, -0.07199543714523315, -0.304429829120636, -0.22410184144973755, 0.5664255619049072, 0.09191608428955078, -0.23250116407871246, 0.03544619679450989, -0.10798600316047668, -0.10295577347278595, 0.25480496883392334, 0.30412957072257996, 0.4472801089286804, 0.026729192584753036, 0.007281607948243618, 0.062399134039878845, 0.36488017439842224, -0.13450203835964203, -0.023310929536819458, 0.3564629554748535, 0.5875917077064514, 0.32458749413490295, 0.058919791132211685, 0.038175955414772034, -0.1690540909767151, -0.21672973036766052, -0.009654071182012558, -0.028777379542589188, -0.2711254954338074, 0.37001287937164307, -0.3083523213863373, -0.1695013791322708, -0.044466838240623474, -0.019461166113615036, -0.21775780618190765, -0.2528109848499298, -0.36891722679138184, 0.6093323230743408, 0.010036192834377289, -0.08166217803955078, 0.03870421648025513, 0.11864986270666122, 0.23872706294059753, -0.13778291642665863, -0.6559612154960632, -0.025716889649629593, -0.03849141299724579, -0.12216474115848541, 0.40249764919281006, -0.08524425327777863, 0.19975095987319946, -0.14455005526542664, -0.13923287391662598, -0.45945650339126587, -0.00753263384103775, 0.13626667857170105, 0.08597949892282486, 0.4347912669181824, 0.19115082919597626, 0.23834878206253052, -0.25548842549324036, 0.04407249018549919, 0.16371411085128784, -0.1379258632659912, -0.2224988341331482, 0.34684669971466064, 0.08798368275165558, 0.18015629053115845, -0.011827945709228516, -0.14223219454288483, 0.05197609215974808, -0.36129093170166016, 0.533841609954834, -0.10664057731628418, 0.05047658458352089, 0.18204517662525177, 0.2021109163761139, 0.21776419878005981, -0.06877483427524567, 0.17823615670204163, -0.24613553285598755, -0.5661965608596802, 0.2783246636390686, -0.22681006789207458, -0.46969568729400635, 0.11039744317531586, 0.07090581953525543, 0.2796606719493866, 0.0266663059592247, -0.6131221652030945, -0.25858208537101746, -0.0177090335637331, -0.06958896666765213, -0.4082528054714203, -0.08610638231039047, 0.04262778162956238, -0.18643958866596222, 0.07498249411582947, -0.3576219081878662, 0.015443459153175354, -0.18182817101478577, -0.029901258647441864, 0.2767462730407715, 0.3305751383304596, 0.6678256988525391, 0.2286091446876526, 0.2709055244922638, 0.545173704624176, 0.03235641121864319, 0.6441780924797058, -0.3568589389324188, 0.3006856441497803, -0.028305932879447937, -0.42773258686065674, 0.03122253343462944, -0.08518485724925995, -0.12788422405719757, -0.015109043568372726, -0.1349860280752182, 0.13489088416099548, -0.366628497838974, 0.1399223953485489, -0.31114891171455383, -0.04342035949230194, -0.13716760277748108, -0.268644243478775, 0.00038070231676101685, -0.007124118506908417, 0.04011325538158417, 0.1794816106557846, -0.007311642169952393, -0.004293236881494522, 0.2744119465351105, 0.24906644225120544, 0.11386993527412415, -0.10746970027685165, -0.369291752576828, -0.3311280608177185, 0.0354313924908638, 0.008353926241397858, 0.4133042097091675, 0.03354897350072861, 0.07042203098535538, 0.11409980058670044, -0.23804311454296112, 1.0194205045700073, -0.21162503957748413, 0.06794445961713791, -0.04270339384675026, -0.03990430384874344, -0.4409196972846985, 0.1674027144908905, -0.19278335571289062, 0.19667211174964905, 0.262484073638916, 0.608150839805603, -0.12067149579524994, -0.24432367086410522, -0.014278138056397438, 0.09981260448694229, -0.0017075315117835999, -0.455069899559021, -0.2416844666004181, -0.17656883597373962, -0.35195425152778625, -0.3810296058654785, 0.1545732021331787, 0.2867904007434845, 0.05937648564577103, -0.14574331045150757, -0.1122070699930191, 0.0660380870103836, 0.003325723111629486, 0.01626524329185486, 0.11146978288888931, 0.23861342668533325, 0.29808640480041504, 0.40108370780944824, 0.10145857185125351, 0.48795533180236816, 0.7291924357414246, 0.5162679553031921, -0.3079097270965576, 0.08960974216461182, 0.06967704743146896, 0.2492418885231018, 0.06589237600564957, -0.05616694316267967, -0.06185726448893547, 0.21495547890663147, 0.011473745107650757, -0.2996096611022949, 0.04863552004098892, 0.303205668926239, 0.011253539472818375, 0.08174578845500946, -0.35558974742889404, 0.4755266606807709, -0.0014921650290489197, 0.08711819350719452, 0.33509355783462524, -0.0624132938683033, -0.11929314583539963, 0.038115937262773514, -0.1070132851600647, 0.6427116394042969, -0.011714253574609756, 0.028687043115496635, 0.401754766702652, -0.10958175361156464, 0.5414825081825256, -0.15150462090969086, -0.07034051418304443, -0.11745702475309372, -0.3232054114341736, -0.13459277153015137, -0.23077060282230377, 0.09694373607635498, 0.11648714542388916, -0.15301933884620667, 0.10092076659202576, 0.17086881399154663, 0.3945503234863281, 0.01966504380106926, 0.20265313982963562, -0.4236900508403778, -0.05127977579832077, -0.45940259099006653, 0.061638880521059036, -0.11719106137752533, 0.002522178925573826, 0.08882072567939758, -0.271169513463974, -0.015897609293460846, 0.05696713924407959, -0.0829227939248085, 0.17916369438171387, -0.06706242263317108, -0.15686434507369995, -0.12515291571617126, -0.3130143880844116, -0.00046744197607040405, 0.34307193756103516, -0.15613728761672974, -0.05156320706009865, -0.4167855381965637, 0.012208133935928345, -0.09317544102668762, -0.12791605293750763, -0.3420148193836212, -0.12136460840702057, 0.14348727464675903, -0.01575261354446411, -0.04527107626199722, -0.03224722668528557, 0.11943425238132477, -0.19132348895072937, 0.28706425428390503, -0.05233088880777359, -0.048346031457185745, -0.12470075488090515, -0.15853895246982574, -0.012026727199554443, -0.0070302486419677734, -0.2018163502216339, 0.06438424438238144, -0.04447764530777931, -0.11008605360984802, -0.11465441435575485, -0.14256611466407776, -0.12914198637008667, -0.05624033883213997, 0.726831316947937, -0.32281363010406494, 0.10056187212467194, 0.43619173765182495, 0.28619682788848877, -0.057797469198703766, -0.19067922234535217, 0.37875640392303467, -0.07639360427856445, -0.10663759708404541, 0.060473036020994186, -0.07496606558561325, 0.22874006628990173, -0.25612306594848633, -0.2732014060020447, 0.10885262489318848, -0.29679957032203674, 0.09186632186174393, -0.4738595485687256, -0.0001577809453010559, 0.030847687274217606, -0.08117567002773285, 0.0943099781870842, -0.020749568939208984, -0.11646473407745361, -0.054620638489723206, -0.17606070637702942, -0.1933729350566864, -0.010051194578409195, -0.19824203848838806, -0.044991232454776764, 0.12991531193256378, 0.032809868454933167, 0.14577676355838776, -0.1280817836523056, 0.019685208797454834, 0.21244758367538452, -0.052081335335969925, -0.1585841178894043, -0.22150008380413055, 0.15295153856277466, 0.3682909905910492, -0.0784158855676651, -0.08985058963298798, -0.22885406017303467, -0.41085290908813477, -0.19342041015625, -0.053321804851293564, 0.15446540713310242, 0.051240112632513046, 0.25368475914001465, 0.14276544749736786, -0.009886085987091064, -0.17372208833694458, -0.08881857991218567, -0.029512643814086914, 0.11544078588485718, -0.31889283657073975, 0.37420815229415894, 0.15011854469776154, -0.0445309653878212, -0.36952024698257446, -0.03615349903702736, 0.12666288018226624, -0.03862510621547699, 0.45169007778167725, -0.3213423788547516, 0.02322004735469818, 0.1335655301809311, 0.3183702528476715, 0.6973112225532532, -0.23056578636169434, 0.11754067987203598, 0.022301137447357178, 0.11084058880805969, -0.005478613078594208, 0.08695963770151138, -0.16426578164100647, 0.060452401638031006, -0.017902716994285583, 0.04105646163225174, -0.09585313498973846, -0.07953639328479767, 0.016824400052428246, 0.05775059014558792, 0.38996422290802, 0.12206503748893738, 0.17564955353736877, 0.11143676191568375, -0.13433563709259033, 0.06950679421424866, 0.16240733861923218, 0.3253890872001648, 0.023239079862833023, 0.4163981080055237, -0.1594007909297943, -0.00018029287457466125, -0.17211522161960602, 0.5136962532997131, -0.17888325452804565, -0.22864656150341034, -0.1883871704339981, 0.06065226346254349, -0.2208440750837326, 0.17248186469078064, -0.1416572630405426, 0.08904285728931427, 0.0022817514836788177, 0.06672176718711853, -0.13211992383003235, 0.04389530420303345, 0.16236218810081482, -0.02888805791735649, -0.5583792328834534, -0.02098594605922699, -0.12303834408521652, 0.04949028789997101, 0.17191678285598755, -0.14388097822666168, 0.2829437851905823, 0.26876094937324524, -0.0264103002846241, -0.5262747406959534, 0.09972827136516571, 0.36435577273368835, 0.10633976757526398, -0.4028094410896301, 0.1993684470653534, -0.04580439627170563, 0.1349228322505951, 0.10346560925245285, 0.2580150365829468, 0.19696202874183655, 0.2668665647506714, 0.20987097918987274, 0.04318181797862053, -0.06452236324548721, -0.23129655420780182, 0.035889044404029846, 0.435964971780777, -0.13185754418373108, -0.037470996379852295, 0.23823650181293488, 0.017050746828317642, -0.03609374910593033, 0.19389468431472778, -0.11145196855068207, 0.3912205696105957, -0.5231247544288635, 0.044242341071367264, -0.33785688877105713, -0.0338883101940155, -0.10123284161090851, 0.0007904693484306335, -0.4845893383026123, 0.19624800980091095, 0.37937986850738525, -0.15769612789154053, 0.21887502074241638, -0.03627697005867958, 0.05336552858352661, -0.25454196333885193, 0.37513598799705505, 0.34976935386657715, 0.18731147050857544, -0.16006934642791748, -0.14037184417247772, -0.3639897406101227, -0.016396503895521164, 0.13197024166584015, -0.22182101011276245, 0.19643794000148773, 0.22454556822776794, -0.1512148678302765, 0.16493527591228485, 0.026792924851179123, 0.01809333637356758, -0.04356984794139862, 0.522672176361084, -0.13753747940063477, -0.6675164699554443, -0.05271989479660988, 0.23140430450439453, 0.03368471562862396, -0.23316052556037903, 0.38822710514068604, -0.25660282373428345, -0.048696015030145645, -0.053424008190631866, 0.0070301443338394165, -0.16123037040233612, -0.17266428470611572, 0.41841554641723633, 0.11129855364561081, 0.03440140560269356, -0.2976011037826538, 0.044984400272369385, -0.4728729724884033, -0.4080260992050171, -0.25106003880500793, 0.21258577704429626, -0.10627269744873047, 0.29553526639938354, -0.2867319583892822, -0.12199006974697113, -0.2992960214614868, 0.10980462282896042, -0.021614879369735718, -0.16931289434432983, -0.13257119059562683, 0.31823575496673584, -0.1984553337097168, 0.2765117585659027, -0.18439733982086182, 0.08486413955688477, -0.13674867153167725, 0.1548587679862976, -0.25559550523757935, -0.31990063190460205, 0.32303014397621155, -0.6372717618942261, -0.08595269173383713, 0.318147212266922, 0.20702271163463593, 0.16376712918281555, -0.200219064950943, -0.42551636695861816, 0.2754654288291931, 0.4749852418899536, -0.10371701419353485, -0.1333521008491516, 0.29078149795532227, 0.1273542195558548, 0.06005318462848663, -0.052759431302547455, 0.2336561381816864, 0.3454417586326599, -0.3234880864620209, 0.33854562044143677, -0.12356273084878922 ]
https://github.com/huggingface/datasets/issues/5878
Very cool! Do you have a link to the code that you're using to eagerly fetch the data? Would also be interested in hacking around something here for pre-fetching iterable datasets
Prefetching for IterableDataset
### Feature request Add support for prefetching the next n batches through iterabledataset to reduce batch loading bottleneck in training loop. ### Motivation The primary motivation behind this is to use hardware accelerators alongside a streaming dataset. This is required when you are in a low ram or low disk space setting as well as quick iteration where you're iterating though different accelerator environments (e.x changing ec2 instances quickly to figure out batch/sec for a particular architecture). Currently, using the IterableDataset results in accelerators becoming basically useless due to the massive bottleneck induced by the dataset lazy loading/transform/mapping. I've considered two alternatives: PyTorch dataloader that handles this. However, I'm using jax, and I believe this is a piece of functionality that should live in the stream class. Replicating the "num_workers" part of the PyTorch DataLoader to eagerly load batches and apply the transform so Arrow caching will automatically cache results and make them accessible. ### Your contribution I may or may not have time to do this. Currently, I've written the basic multiprocessor approach to handle the eager DataLoader for my own use case with code that's not integrated to datasets. I'd definitely see this as being the default over the regular Dataset for most people given that they wouldn't have to wait on the datasets while also not worrying about performance.
31
Prefetching for IterableDataset ### Feature request Add support for prefetching the next n batches through iterabledataset to reduce batch loading bottleneck in training loop. ### Motivation The primary motivation behind this is to use hardware accelerators alongside a streaming dataset. This is required when you are in a low ram or low disk space setting as well as quick iteration where you're iterating though different accelerator environments (e.x changing ec2 instances quickly to figure out batch/sec for a particular architecture). Currently, using the IterableDataset results in accelerators becoming basically useless due to the massive bottleneck induced by the dataset lazy loading/transform/mapping. I've considered two alternatives: PyTorch dataloader that handles this. However, I'm using jax, and I believe this is a piece of functionality that should live in the stream class. Replicating the "num_workers" part of the PyTorch DataLoader to eagerly load batches and apply the transform so Arrow caching will automatically cache results and make them accessible. ### Your contribution I may or may not have time to do this. Currently, I've written the basic multiprocessor approach to handle the eager DataLoader for my own use case with code that's not integrated to datasets. I'd definitely see this as being the default over the regular Dataset for most people given that they wouldn't have to wait on the datasets while also not worrying about performance. Very cool! Do you have a link to the code that you're using to eagerly fetch the data? Would also be interested in hacking around something here for pre-fetching iterable datasets
[ -0.46986472606658936, -0.127451553940773, -0.1026519387960434, -0.35069331526756287, -0.0030778180807828903, 0.011188313364982605, 0.2757582366466522, 0.19776809215545654, 0.1885717809200287, 0.07481328397989273, 0.06472859531641006, 0.059693120419979095, -0.31767842173576355, 0.4955103397369385, 0.1719263643026352, -0.019090021029114723, 0.07153715938329697, 0.2798957824707031, -0.14557825028896332, 0.3154006600379944, -0.15610668063163757, -0.08727371692657471, -0.16931144893169403, -0.202773779630661, -0.24983519315719604, 0.035234905779361725, 0.0662727802991867, -0.02633606269955635, 0.20805366337299347, -0.5754081606864929, 0.40248170495033264, 0.417948842048645, 0.36239612102508545, 0.1628202646970749, -0.00010346478666178882, -0.024845480918884277, 0.10782572627067566, -0.04750998318195343, -0.5291281938552856, 0.09110252559185028, -0.09974252432584763, -0.1252802461385727, -0.04574614018201828, -0.22211101651191711, -0.4186864495277405, -0.38446885347366333, 0.330448180437088, -0.6283243894577026, 0.39963141083717346, -0.0028899498283863068, 0.18061819672584534, 0.07124058902263641, -0.39002448320388794, -0.03368666395545006, -0.27266982197761536, 0.0013395994901657104, -0.18168258666992188, -0.23980161547660828, 0.6534546613693237, 0.030169546604156494, -0.341665655374527, 0.27275604009628296, 0.10481403768062592, 0.113870769739151, 0.30340656638145447, -0.078912153840065, -0.09361179172992706, -0.28437289595603943, -0.21617649495601654, 0.08868066966533661, 0.2963629364967346, -0.2825266122817993, -0.36215925216674805, -0.6201227903366089, -0.08874303102493286, -0.4903995096683502, -0.04478272795677185, -0.11016404628753662, -0.14113514125347137, 0.07475680112838745, -0.16305555403232574, -0.02846481278538704, -0.21930164098739624, -0.05471513420343399, 0.2822752594947815, 0.2998058795928955, -0.10956642031669617, -0.04095439985394478, 0.09285734593868256, -0.05949580296874046, 0.6615742444992065, -0.2995166480541229, 0.1335846334695816, 0.22494050860404968, -0.29388973116874695, -0.2041601538658142, -0.12069125473499298, -0.11365021765232086, 0.019910044968128204, 0.40593042969703674, 0.1533065289258957, 0.22541843354701996, 0.031649064272642136, -0.12450302392244339, 0.20752768218517303, -0.034269824624061584, -0.07653333246707916, -0.03745990991592407, 0.059514760971069336, 0.30944016575813293, 0.09498049318790436, 0.017872385680675507, 0.04854816943407059, -0.02001401036977768, 0.28339195251464844, 0.12378039211034775, -0.13717497885227203, 0.12671276926994324, -0.11992068588733673, -0.29126229882240295, -0.14117129147052765, -0.2637568414211273, 0.1028003990650177, -0.0010642074048519135, -0.11923350393772125, 0.28338706493377686, -0.2427840232849121, 0.058686453849077225, -0.08357994258403778, -0.4560505449771881, -0.14312419295310974, -0.20164987444877625, -0.17285184562206268, 0.4065966308116913, 0.4248321056365967, -0.24446648359298706, 0.11059144884347916, -0.14823484420776367, 0.22984951734542847, 0.26324397325515747, 0.4229828417301178, -0.05182524025440216, 0.21409836411476135, 0.15483033657073975, -0.09302671253681183, 0.023276150226593018, -0.02261977642774582, 0.12299025058746338, -0.1248549148440361, 0.2704007029533386, 0.0004253219813108444, -0.39889973402023315, 0.30731746554374695, 0.22228676080703735, -0.11844402551651001, -0.20620444416999817, -0.2844966948032379, 0.4111158847808838, -0.0898849219083786, -0.01259450614452362, 0.08442796766757965, -0.12820498645305634, -0.17868942022323608, -0.12552419304847717, 0.1684674322605133, 0.0879921093583107, -0.12975123524665833, -0.0825267806649208, -0.07743684947490692, -0.0122469961643219, 0.24518580734729767, 0.015792351216077805, -0.3198609948158264, 0.2216448336839676, -0.10704852640628815, 0.1633390337228775, 0.051432933658361435, -0.10613849014043808, -0.26993268728256226, 0.23188123106956482, 0.02492929995059967, 0.5680654048919678, 0.048324551433324814, 0.35114189982414246, 0.29695719480514526, -0.2727963328361511, 0.11677420884370804, 0.626932680606842, -0.3012518286705017, -0.08492285758256912, -0.11192039400339127, -0.2532213032245636, -0.11404377967119217, 0.4865720272064209, 0.13898605108261108, 0.1150883287191391, -0.08001164346933365, -0.007128141820430756, 0.2935427725315094, -0.23223230242729187, 0.2805067300796509, -0.031132351607084274, -0.0886254757642746, -0.09149043262004852, 0.06703391671180725, -0.27638012170791626, -0.6010253429412842, 0.3611132800579071, -0.03407973423600197, -0.24983049929141998, 0.13358740508556366, -0.11983946710824966, 0.01023411750793457, 0.18261559307575226, -0.20826546847820282, -0.11668461561203003, 0.10595989972352982, 0.22609269618988037, 0.009573444724082947, -0.21462631225585938, -0.43605315685272217, 0.6274983286857605, -0.21978303790092468, -0.06641501933336258, -0.26912856101989746, 0.018646813929080963, 0.2528158724308014, -0.005500011146068573, -0.0012194737792015076, 0.19104140996932983, -0.21231240034103394, -0.22502294182777405, 0.038612931966781616, 0.3107419013977051, 0.1679321974515915, 0.20214849710464478, -0.009045574814081192, 0.6330761313438416, 0.20147158205509186, 0.046217143535614014, -0.13134217262268066, 0.07990314066410065, -0.03754624351859093, -0.24347028136253357, -0.15077058970928192, 0.5461516976356506, -0.2732660472393036, 0.1407698094844818, -0.05333522707223892, -0.16916829347610474, 0.21910005807876587, 0.1049126386642456, -0.43352222442626953, 0.10114871710538864, -0.049029894173145294, -0.18396955728530884, 0.12763167917728424, -0.12305808067321777, -0.26766476035118103, 0.18947207927703857, 0.08251716941595078, 0.006124213337898254, -0.13442184031009674, -0.06274381279945374, -0.11847874522209167, -0.14662028849124908, 0.13699984550476074, 0.09483380615711212, 0.19004175066947937, 0.23776058852672577, 0.1255027949810028, -0.1034633070230484, 0.07887642085552216, -0.1643601655960083, 0.1667480319738388, 0.03908367455005646, 0.4224052131175995, 0.07365106791257858, -0.01733524538576603, -0.04647373780608177, -0.11350245773792267, -0.3050907254219055, -0.03720221668481827, -0.05930153280496597, -0.03903036192059517, 0.0167451873421669, 0.012916788458824158, -0.22334176301956177, 0.052924253046512604, -0.28545597195625305, 0.35094037652015686, -0.16111204028129578, 0.1061544343829155, 0.5092464089393616, -0.08467653393745422, 0.12828397750854492, -0.37326523661613464, 0.6875240802764893, 0.02015279233455658, -0.1736672967672348, -0.386424720287323, 0.08767717331647873, -0.110105499625206, 0.17463365197181702, 0.08929526805877686, -0.4080481231212616, 0.3795766830444336, 0.3671213388442993, 0.22176629304885864, -0.25220340490341187, 0.023219794034957886, 0.049935247749090195, 0.10525070130825043, 0.2061624377965927, -0.010111957788467407, 0.07989193499088287, 0.027598708868026733, -0.17380103468894958, -0.04479750990867615, -0.17516876757144928, 0.029720835387706757, -0.26506224274635315, 0.007471717894077301, 0.10172465443611145, 0.11513501405715942, -0.08299370110034943, -0.1924140304327011, -0.31418317556381226, -0.10835181176662445, 0.156560480594635, 0.008543981239199638, 0.22099454700946808, -0.11914211511611938, 0.01878281682729721, 0.37813568115234375, -0.4310411214828491, -0.0371200256049633, -0.44706061482429504, 0.31699615716934204, -0.33535221219062805, -0.11149724572896957, -0.206630676984787, -0.2540152370929718, -0.02685149572789669, 0.44127851724624634, -0.3307557702064514, 0.2668410837650299, -0.006632918491959572, 0.31117963790893555, -0.11384814977645874, -0.38284415006637573, 0.22572825849056244, 0.10340723395347595, -0.09739606827497482, -0.1491350382566452, 0.10685564577579498, 0.022115305066108704, -0.060838617384433746, 0.0474729984998703, 0.35322076082229614, -0.06039002910256386, 0.1674054116010666, 0.965434193611145, 0.15942206978797913, -0.11372130364179611, 0.32484254240989685, 0.25066763162612915, -0.03046942874789238, -0.10662181675434113, -0.16987286508083344, -0.07467547804117203, -0.19574764370918274, 0.040579356253147125, 0.20911091566085815, -0.21550284326076508, -0.3869848847389221, -0.11232107877731323, 0.27041327953338623, 0.01412692666053772, -0.030478443950414658, 0.26818227767944336, -0.4207676649093628, 0.3293435573577881, -0.00986519455909729, 0.004298284649848938, -0.17130878567695618, -0.14725710451602936, -0.06885930895805359, -0.3299417197704315, 0.3600803315639496, -0.14472688734531403, -0.2305188775062561, 0.215437114238739, -0.5181394815444946, 0.18394562602043152, 0.15525229275226593, 0.2152126580476761, 0.12589558959007263, -0.284833699464798, -0.08124566078186035, -0.12037330865859985, 0.42219942808151245, -0.42275071144104004, -0.2939317226409912, -0.028560690581798553, -0.13386891782283783, 0.009880639612674713, -0.1299070417881012, -0.16133689880371094, 0.45075494050979614, -0.021475911140441895, 0.4738519489765167, -0.07537470757961273, -0.31579142808914185, 0.1586562544107437, -0.2739637494087219, -0.1355399489402771, -0.11026691645383835, 0.03767593204975128, -0.06315280497074127, 0.09480214864015579, 0.23465107381343842, 0.16028010845184326, 0.2691993713378906, -0.05524091422557831, -0.17422625422477722, -0.3040412366390228, 0.27989357709884644, -0.054296232759952545, -0.022121991962194443, -0.04233120009303093, 0.26364773511886597, 0.397937148809433, 0.32629841566085815, 0.3105386793613434, 0.17493224143981934, 0.07936446368694305, -0.07756601274013519, -0.1909855157136917, 0.12570229172706604, 0.13740083575248718, 0.2359025776386261, 0.34503647685050964, -0.008325044065713882, 0.05639716982841492, 0.40759921073913574, 0.08963306248188019, -0.41056573390960693, 0.0425068698823452, 0.19417819380760193, 0.014258775860071182, -0.5602481365203857, -0.7593398690223694, 0.3593137264251709, 0.09765250235795975, -0.04607289284467697, 0.6402131915092468, -0.187826469540596, -0.16470998525619507, 0.1474599391222, 0.4250026047229767, 0.6723805665969849, -0.10709939152002335, 0.2664896547794342, 0.19544507563114166, -0.03012295812368393, 0.15233153104782104, -0.4397652745246887, 0.37793901562690735, -0.10957347601652145, -0.5833059549331665, -0.012924082577228546, -0.12950319051742554, 0.12974128127098083, 0.37172016501426697, -0.07916063815355301, 0.13740143179893494, 0.2303045243024826, -0.055968716740608215, 0.005219269543886185, 0.16972249746322632, -0.07022411376237869, -0.4632582664489746, 0.0324564203619957, 0.19816352427005768, -0.04777003079652786, 0.04727744683623314, -0.23610875010490417, -0.13490697741508484, 0.42446330189704895, 0.260052353143692, -0.15467190742492676, 0.07731978595256805, -0.3884388506412506, 0.009702600538730621, -0.009478823281824589, -0.07446988672018051, 0.03212243318557739, 0.10299936681985855, 0.19347065687179565, -0.24741855263710022, -0.24917075037956238, 0.17012301087379456, 0.02704084850847721, 0.20460669696331024, -0.12779167294502258, -0.271697074174881, 0.5531572699546814, -0.23538067936897278, 0.008701816201210022, 0.15609854459762573, -0.01210920512676239, -0.5813443660736084, -0.04412485659122467, -0.10093656182289124, 0.3220489025115967, -0.268477201461792, -0.16199910640716553, 0.36215585470199585, 0.017896510660648346, -0.25315216183662415, 0.1465730220079422, -0.0641975849866867, -0.06739674508571625, 0.24287837743759155, -0.1968369334936142, -0.11020535975694656, -0.1143236756324768, 0.11687478423118591, 0.23624667525291443, -0.35187068581581116, 0.4412720501422882, 0.1480911374092102, -0.15018175542354584, -0.21332600712776184, -0.12862160801887512, 0.42023375630378723, -0.18006224930286407, 0.16681963205337524, -0.1420917809009552, 0.008073747158050537, 0.1590123325586319, 0.3269023895263672, 0.21511878073215485, -0.18138188123703003, -0.12368903309106827, -0.06290288269519806, -0.2642696797847748, 0.05574465170502663, -0.01998344250023365, 0.3417384624481201, 0.04474836587905884, -0.15058454871177673, 0.06393995136022568, 0.18017569184303284, -0.40595394372940063, -0.32892924547195435, 0.051563747227191925, -0.060547325760126114, 0.004779456183314323, -0.014688907191157341, 0.32832637429237366, 0.2176240086555481, 0.06887531280517578, 0.041926708072423935, -0.31456902623176575, -0.2807309627532959, -0.0680067166686058, 0.09071146696805954, -0.09776531159877777, -0.2412138283252716, -0.10366524755954742, -0.1458330601453781, -0.30390265583992004, -0.223585844039917, 0.12497195601463318, -0.046080734580755234, -0.007474984973669052, -0.12361577898263931, 0.4744172990322113, 0.048364993184804916, -0.17044106125831604, 0.08298882097005844, 0.23361173272132874, 0.0033315420150756836, -0.0985233262181282, 0.20457401871681213, 0.0733792781829834, -0.18093976378440857, -0.02136995457112789, 0.05731169134378433, 0.7580236196517944, 0.1757776439189911, 0.18619723618030548, -0.41382771730422974, -0.11683905124664307, 0.19385221600532532, 0.338090717792511, 0.2612910270690918, -0.10675916075706482, -0.1664869338274002, 0.17918901145458221, 0.26945266127586365, -0.21188366413116455, -0.050446175038814545, -0.03493442386388779, 0.06219479441642761, 0.08387157320976257, 0.23386919498443604, 0.2364538013935089, 0.17003841698169708, 0.25327160954475403, 0.12707647681236267, -0.04897836968302727, -0.3801476061344147, 0.1088186651468277, 0.06884487718343735, 0.21252566576004028, -0.18628376722335815, 0.21436378359794617, 0.20624060928821564, 0.18393471837043762, 0.29588398337364197, -0.018157735466957092, 0.528118371963501, 0.6312004923820496, -0.011132709681987762, -0.14218710362911224, -0.41429850459098816, -0.11117774248123169, 0.184803307056427, -0.09733790904283524, 0.3540351390838623, 0.22255414724349976, 0.20507358014583588, 0.05507165193557739, -0.19990554451942444, -0.21299201250076294, -0.05797209218144417, -0.019568398594856262, -0.12034276127815247, 0.11096914857625961, -0.10626320540904999, -0.11319512128829956, -0.0014387592673301697, -0.0573759526014328, 0.10570928454399109, 0.2875659763813019, 0.04972685128450394, 0.20104843378067017, -0.16931430995464325, 0.28649744391441345, 0.19601507484912872, 0.48550209403038025, -0.1509254276752472, 0.10687575489282608, 0.0016496703028678894, -0.15439048409461975, -0.06295892596244812, 0.3248006999492645, 0.04238675534725189, 0.18344511091709137, -0.28332769870758057, 0.23783302307128906, -0.11680001765489578, -0.07037052512168884, -0.05765173211693764, 0.2664170265197754, 0.1459120512008667, -0.2084806263446808, 0.45712438225746155, 0.1535675823688507, -0.08239518851041794, 0.20647817850112915, 0.13337986171245575, -0.08763346076011658, -0.4126008450984955, 0.11261503398418427, 0.36033734679222107, -0.06344641000032425, 0.06580213457345963, 0.08182626217603683, -0.16182677447795868, -0.09884732961654663, 0.22653689980506897, -0.5566081404685974, 0.0433008074760437, -0.014897404238581657, 0.14155185222625732, 0.03210184723138809, 0.5753603577613831, 0.19232414662837982, 0.15923455357551575, -0.23452726006507874, -0.21700835227966309, -0.26714104413986206, -0.06250791251659393, -0.06413352489471436, 0.18828371167182922, 0.09155791997909546, 0.297211229801178, 0.05256063491106033, 0.1550024151802063, -0.1472252905368805, -0.20415319502353668, -0.09297476708889008, 0.5204262733459473, -0.30421942472457886, 0.04648075997829437, 0.12180054187774658, 0.3171519339084625, -0.023887209594249725, -0.2543880343437195, 0.04777141287922859, 0.15312686562538147, 0.04916630685329437, 0.1520763486623764, -0.11789294332265854, 0.4820179045200348, -0.2276616394519806, 0.3427085280418396, -0.12721048295497894, -0.10248415172100067, -0.044431306421756744, -0.0026360079646110535, -0.30007269978523254, -0.1246776282787323, -0.20350250601768494, 0.040549613535404205, 0.1841679811477661, 0.20375759899616241, -0.1718209981918335, -0.001296183094382286, -0.27475032210350037, -0.09332960098981857, 0.2199442982673645, -0.13568225502967834, -0.21577592194080353, -0.04323749244213104, -0.31188589334487915, 0.3078949451446533, 0.05767589807510376, 0.3721076250076294, 0.0426015630364418, 0.04239855706691742, -0.25677359104156494, -0.13623449206352234, 0.22701331973075867, -0.4133192300796509, -0.20844817161560059, -0.18500155210494995, 0.0925694927573204, 0.2759020924568176, 0.1276511251926422, -0.13564185798168182, -0.019206151366233826, 0.3243696093559265, -0.1371823251247406, 0.0636100322008133, 0.4804898798465729, 0.1524725705385208, 0.007471732795238495, -0.28082695603370667, 0.25889328122138977, 0.12139450013637543, -0.08074012398719788, -0.3066229820251465, -0.34976762533187866 ]
https://github.com/huggingface/datasets/issues/5878
I ended up just switching back to the pytorch dataloader and using it's multiprocessing functionality to handle this :(. I'm just not that familiar with python multiprocessing to get something to work in jupyter (kept having weird behaviors happening with zombies living after the cell finished).
Prefetching for IterableDataset
### Feature request Add support for prefetching the next n batches through iterabledataset to reduce batch loading bottleneck in training loop. ### Motivation The primary motivation behind this is to use hardware accelerators alongside a streaming dataset. This is required when you are in a low ram or low disk space setting as well as quick iteration where you're iterating though different accelerator environments (e.x changing ec2 instances quickly to figure out batch/sec for a particular architecture). Currently, using the IterableDataset results in accelerators becoming basically useless due to the massive bottleneck induced by the dataset lazy loading/transform/mapping. I've considered two alternatives: PyTorch dataloader that handles this. However, I'm using jax, and I believe this is a piece of functionality that should live in the stream class. Replicating the "num_workers" part of the PyTorch DataLoader to eagerly load batches and apply the transform so Arrow caching will automatically cache results and make them accessible. ### Your contribution I may or may not have time to do this. Currently, I've written the basic multiprocessor approach to handle the eager DataLoader for my own use case with code that's not integrated to datasets. I'd definitely see this as being the default over the regular Dataset for most people given that they wouldn't have to wait on the datasets while also not worrying about performance.
46
Prefetching for IterableDataset ### Feature request Add support for prefetching the next n batches through iterabledataset to reduce batch loading bottleneck in training loop. ### Motivation The primary motivation behind this is to use hardware accelerators alongside a streaming dataset. This is required when you are in a low ram or low disk space setting as well as quick iteration where you're iterating though different accelerator environments (e.x changing ec2 instances quickly to figure out batch/sec for a particular architecture). Currently, using the IterableDataset results in accelerators becoming basically useless due to the massive bottleneck induced by the dataset lazy loading/transform/mapping. I've considered two alternatives: PyTorch dataloader that handles this. However, I'm using jax, and I believe this is a piece of functionality that should live in the stream class. Replicating the "num_workers" part of the PyTorch DataLoader to eagerly load batches and apply the transform so Arrow caching will automatically cache results and make them accessible. ### Your contribution I may or may not have time to do this. Currently, I've written the basic multiprocessor approach to handle the eager DataLoader for my own use case with code that's not integrated to datasets. I'd definitely see this as being the default over the regular Dataset for most people given that they wouldn't have to wait on the datasets while also not worrying about performance. I ended up just switching back to the pytorch dataloader and using it's multiprocessing functionality to handle this :(. I'm just not that familiar with python multiprocessing to get something to work in jupyter (kept having weird behaviors happening with zombies living after the cell finished).
[ -0.3687434196472168, -0.027363792061805725, -0.0655829906463623, -0.4458175003528595, 0.017838124185800552, -0.05689702555537224, 0.3682127594947815, 0.20443123579025269, 0.18082527816295624, 0.11739921569824219, 0.035193853080272675, 0.11722812056541443, -0.3320203721523285, 0.4991907477378845, 0.1900806427001953, -0.011784637346863747, 0.04767271876335144, 0.28068798780441284, -0.16340596973896027, 0.33790305256843567, -0.18431442975997925, -0.12471795827150345, -0.14513418078422546, -0.20273490250110626, -0.34173354506492615, 0.06976637989282608, 0.04828242212533951, 0.005783922038972378, 0.2497294545173645, -0.6091845035552979, 0.3840181827545166, 0.39453259110450745, 0.3053176999092102, 0.26381775736808777, -0.00010609932360239327, 0.014869384467601776, 0.1323169767856598, -0.07129592448472977, -0.5507566928863525, 0.15182997286319733, 0.06179375946521759, -0.18188869953155518, -0.005098748952150345, -0.2696290612220764, -0.40977829694747925, -0.4009745121002197, 0.325080931186676, -0.6452895402908325, 0.44492027163505554, 0.025178927928209305, 0.14877434074878693, 0.18318486213684082, -0.3288425803184509, 0.06496352702379227, -0.3237449824810028, 0.006309971213340759, -0.1292204111814499, -0.2497580200433731, 0.6369304060935974, -0.07706249505281448, -0.39795252680778503, 0.3028269410133362, 0.11565389484167099, 0.17653103172779083, 0.2984854280948639, -0.07010773569345474, 0.014241878874599934, -0.2935507893562317, -0.2507314085960388, 0.05272673815488815, 0.24726375937461853, -0.32706570625305176, -0.41112783551216125, -0.6695537567138672, -0.06724586337804794, -0.47064733505249023, -0.019291464239358902, -0.16628441214561462, -0.19012808799743652, 0.03501518815755844, -0.07228013873100281, 0.07137845456600189, -0.17843475937843323, -0.025484777987003326, 0.22179840505123138, 0.2907850742340088, -0.05120662599802017, -0.017436601221561432, 0.0905507355928421, -0.050871774554252625, 0.6933618187904358, -0.24918238818645477, 0.2182922214269638, 0.2808646559715271, -0.287254273891449, -0.19568246603012085, -0.07380379736423492, -0.1723833531141281, -0.08104926347732544, 0.289292573928833, 0.14672759175300598, 0.12395040690898895, 0.032651569694280624, -0.0479033924639225, 0.315371572971344, -0.04797923192381859, -0.13464780151844025, 0.03326098993420601, 0.14264604449272156, 0.2749555706977844, 0.024026311933994293, 0.07401779294013977, 0.08835650980472565, -0.10235504806041718, 0.37162119150161743, 0.16966041922569275, -0.06028222292661667, 0.15693077445030212, -0.15037739276885986, -0.27364739775657654, -0.09957225620746613, -0.2708059251308441, 0.07088575512170792, 0.01722889021039009, -0.13910140097141266, 0.35591429471969604, -0.1847096085548401, 0.02966216951608658, -0.1214054599404335, -0.396506130695343, -0.10466515272855759, -0.12614867091178894, -0.17645567655563354, 0.31968533992767334, 0.44673269987106323, -0.16782553493976593, 0.1388666033744812, -0.14241966605186462, 0.3179359436035156, 0.22901037335395813, 0.4253743588924408, -0.10520917177200317, 0.17342185974121094, 0.292771577835083, -0.12870363891124725, -0.04478068649768829, -0.009572021663188934, 0.06343038380146027, -0.1177743524312973, 0.3163444399833679, 0.039428092539310455, -0.38018667697906494, 0.3518376052379608, 0.1752285212278366, -0.1421353965997696, -0.19275212287902832, -0.3100970983505249, 0.2673618495464325, -0.03895508870482445, -0.017101094126701355, 0.043713413178920746, -0.18654081225395203, -0.0965973436832428, -0.17861616611480713, 0.17870894074440002, 0.10937750339508057, -0.13064779341220856, -0.16162607073783875, -0.10680940747261047, 0.05933267995715141, 0.30666446685791016, 0.05901677533984184, -0.2946965992450714, 0.23016703128814697, -0.009619288146495819, 0.1253400593996048, 0.03638958930969238, -0.18180996179580688, -0.26782095432281494, 0.13941669464111328, 0.0023739710450172424, 0.6649261116981506, 0.07822619378566742, 0.3675016164779663, 0.3384421765804291, -0.3037855625152588, 0.11425701528787613, 0.7195884585380554, -0.24919456243515015, 0.0195334330201149, -0.10458893328905106, -0.1587611436843872, -0.083851657807827, 0.543389081954956, 0.14478027820587158, 0.05993659049272537, -0.11215680837631226, 0.010034613311290741, 0.28256356716156006, -0.22040101885795593, 0.27207696437835693, -0.07066389173269272, -0.1439257562160492, -0.032391633838415146, 0.12409472465515137, -0.24228385090827942, -0.5463638305664062, 0.35123366117477417, -0.061561163514852524, -0.21891909837722778, 0.09518289566040039, -0.09934008866548538, -0.006033066660165787, 0.21491757035255432, -0.22555118799209595, -0.18017759919166565, 0.08602121472358704, 0.2496228963136673, 0.02212066948413849, -0.232997328042984, -0.4363199472427368, 0.6412495374679565, -0.10657703876495361, -0.020637398585677147, -0.28524288535118103, 0.03183776140213013, 0.25369828939437866, -0.1553356647491455, 0.025744765996932983, 0.22264404594898224, -0.20676854252815247, -0.22832736372947693, 0.013278819620609283, 0.3100428283214569, 0.2775614261627197, 0.18612544238567352, -0.11260244250297546, 0.5015684962272644, 0.1776253581047058, 0.22554686665534973, -0.14171536266803741, 0.2499491274356842, -0.020475298166275024, -0.1999954879283905, -0.10356561839580536, 0.6483961939811707, -0.24868325889110565, 0.09826484322547913, -0.06469236314296722, -0.1242547482252121, 0.213883638381958, 0.1118953675031662, -0.4522361755371094, 0.14034545421600342, -0.011954601854085922, -0.19619300961494446, 0.10322855412960052, -0.09022369235754013, -0.2748343348503113, 0.17107489705085754, 0.06144262105226517, -0.015239547938108444, -0.14949119091033936, -0.08179973065853119, -0.09549234807491302, -0.08033985644578934, 0.12334337085485458, 0.15827545523643494, 0.30092698335647583, 0.24887914955615997, 0.03810349479317665, -0.11750016361474991, 0.02666325867176056, -0.11470375955104828, 0.1220071017742157, -0.02907349169254303, 0.5108530521392822, 0.10688894987106323, 0.010259121656417847, -0.08672910183668137, -0.10454461723566055, -0.28837382793426514, -0.04685948044061661, -0.05873853713274002, -0.09040525555610657, 0.04572328180074692, 0.05873826891183853, -0.2077830284833908, 0.02968645840883255, -0.33385151624679565, 0.38800472021102905, -0.19944986701011658, 0.09872113168239594, 0.5348971486091614, -0.1525198072195053, 0.1579514741897583, -0.3199836313724518, 0.5830234289169312, -0.006102815270423889, -0.1918240785598755, -0.3468795716762543, 0.06325593590736389, -0.03322837874293327, 0.15205441415309906, 0.05125958472490311, -0.3737385869026184, 0.3070819675922394, 0.31514400243759155, 0.14421619474887848, -0.15547022223472595, 0.0665324255824089, 0.023308362811803818, 0.037544894963502884, 0.2656131684780121, -0.012066572904586792, 0.1285763829946518, 0.07584064453840256, -0.19073474407196045, 0.0012802332639694214, -0.2074887454509735, 0.0226476788520813, -0.2615162134170532, 0.08519480377435684, 0.09259787946939468, 0.1176651120185852, -0.058673735707998276, -0.3259693682193756, -0.2941259741783142, -0.06207602843642235, 0.20042046904563904, 0.05531391501426697, 0.10984858125448227, -0.09859636425971985, -0.005546942353248596, 0.470610111951828, -0.3609505593776703, 0.007501691579818726, -0.4109606146812439, 0.3474443256855011, -0.3211665153503418, -0.07899679243564606, -0.2669946849346161, -0.24464362859725952, -0.072781503200531, 0.32172369956970215, -0.30121058225631714, 0.21900753676891327, -0.10067548602819443, 0.35377466678619385, -0.13054996728897095, -0.2670747637748718, 0.21689483523368835, 0.14156584441661835, -0.10855469107627869, -0.16516581177711487, 0.09417954832315445, 0.028524743393063545, -0.07754161953926086, 0.039510577917099, 0.3116072714328766, -0.03924335166811943, 0.08121994882822037, 0.9196147322654724, 0.139690101146698, -0.16285553574562073, 0.32100415229797363, 0.20964151620864868, -0.08799323439598083, -0.1651477813720703, -0.22075852751731873, -0.015987534075975418, -0.268949031829834, 0.05813401937484741, 0.08443158864974976, -0.20607784390449524, -0.3192558288574219, -0.10829231888055801, 0.22293254733085632, -0.03725557029247284, -0.05774901807308197, 0.31944480538368225, -0.3804810047149658, 0.23175129294395447, -0.03174753487110138, -0.004007130861282349, -0.2695988416671753, -0.07864771038293839, -0.14183342456817627, -0.2545905113220215, 0.39024052023887634, -0.15988922119140625, -0.12105271220207214, 0.18574388325214386, -0.5330528616905212, 0.20381446182727814, 0.12677732110023499, 0.20588481426239014, 0.2011166661977768, -0.3380849361419678, -0.08044113218784332, -0.1534527689218521, 0.5012985467910767, -0.37359246611595154, -0.24745970964431763, 0.025609321892261505, -0.1283450871706009, -0.12345069646835327, -0.13502290844917297, -0.14456826448440552, 0.4432342052459717, 0.022661246359348297, 0.45603764057159424, -0.09708598256111145, -0.2834407687187195, 0.17456670105457306, -0.18778392672538757, -0.17089179158210754, -0.19540774822235107, -0.11163956671953201, -0.10603877156972885, 0.009315036237239838, 0.2076561152935028, 0.19243738055229187, 0.232932910323143, -0.02723507024347782, -0.1495988667011261, -0.3361016809940338, 0.17607034742832184, -0.04841919615864754, 0.07882601767778397, 0.011208828538656235, 0.18865641951560974, 0.3801703453063965, 0.3220944404602051, 0.31508588790893555, 0.22881373763084412, 0.05868551507592201, -0.18813693523406982, -0.21395307779312134, 0.11275564134120941, 0.15060469508171082, 0.2652221918106079, 0.34057581424713135, -0.022815659642219543, 0.08295342326164246, 0.2741554081439972, 0.057757455855607986, -0.3857468366622925, 0.02632930874824524, 0.21269869804382324, 0.1430334746837616, -0.43125462532043457, -0.7794299125671387, 0.29929113388061523, 0.139276385307312, -0.059199340641498566, 0.6095684170722961, -0.21311074495315552, -0.13437603414058685, 0.137328639626503, 0.38646572828292847, 0.6702949404716492, -0.10151124000549316, 0.3296351432800293, 0.20625251531600952, -0.05677918717265129, 0.09307137131690979, -0.39415037631988525, 0.41507697105407715, -0.1263791024684906, -0.5769921541213989, 0.025805659592151642, -0.18182502686977386, 0.16279259324073792, 0.3209744691848755, -0.17817892134189606, 0.1963912844657898, 0.09291693568229675, -0.19203445315361023, -0.04930195212364197, 0.20571506023406982, -0.043778352439403534, -0.4655449390411377, -0.1251426637172699, 0.1728915572166443, -0.06724786758422852, 0.10492326319217682, -0.14999261498451233, -0.09709301590919495, 0.29875409603118896, 0.26510757207870483, -0.13829606771469116, 0.08369378745555878, -0.3896200954914093, 0.02371668443083763, 0.05538191646337509, 0.03579936921596527, -0.053558751940727234, 0.15413658320903778, 0.1694873720407486, -0.2362935096025467, -0.12723763287067413, 0.10609099268913269, 0.03705231100320816, 0.265665203332901, -0.09758035838603973, -0.31680068373680115, 0.6353347897529602, -0.23567089438438416, -0.07927846163511276, 0.16728061437606812, -0.06475715339183807, -0.6554577350616455, 0.012755244970321655, -0.06220820173621178, 0.28122252225875854, -0.2860291302204132, -0.11693482100963593, 0.3348521888256073, -0.037146952003240585, -0.3273143470287323, 0.14296898245811462, -0.07508867979049683, -0.1352408528327942, 0.33853691816329956, -0.37612980604171753, -0.08299635350704193, -0.08964630961418152, 0.08440794050693512, 0.27279579639434814, -0.19084560871124268, 0.5364880561828613, 0.15272881090641022, -0.16507300734519958, -0.16503289341926575, -0.04577609896659851, 0.5068594217300415, -0.1420563906431198, 0.31442132592201233, -0.14798659086227417, -0.10188939422369003, 0.08769874274730682, 0.28816384077072144, 0.2136279046535492, -0.07258844375610352, -0.2580491304397583, -0.0921105444431305, -0.38623395562171936, 0.02859877049922943, 0.04073167219758034, 0.27788040041923523, 0.09062798321247101, 0.04532654583454132, 0.08965293318033218, 0.2460266649723053, -0.3924529552459717, -0.35433101654052734, -0.002132803201675415, 0.01503884419798851, 0.10282190144062042, -0.061688464134931564, 0.3273392915725708, 0.19621315598487854, 0.07352913916110992, 0.02963598072528839, -0.26137515902519226, -0.2687639892101288, -0.12094485759735107, 0.08795380592346191, -0.16580812633037567, -0.19513383507728577, -0.06938882172107697, -0.13116060197353363, -0.29436957836151123, -0.2093663364648819, 0.14754529297351837, -0.08411221206188202, -0.045830052345991135, -0.10353648662567139, 0.541837215423584, -0.012171734124422073, -0.05805040895938873, 0.05851772055029869, 0.12860843539237976, -0.06468989700078964, -0.12811949849128723, 0.25230491161346436, 0.11970722675323486, -0.1677064746618271, -0.06570837646722794, -0.011427059769630432, 0.6262801885604858, 0.2113020420074463, 0.15081638097763062, -0.4056242108345032, -0.18282519280910492, 0.0694744884967804, 0.4164981245994568, 0.34522950649261475, -0.08472398668527603, -0.15746340155601501, 0.19012509286403656, 0.23853528499603271, -0.2796818017959595, -0.08799390494823456, -0.03331563249230385, 0.01492677628993988, 0.15911753475666046, 0.3040962815284729, 0.10854130983352661, 0.22780092060565948, 0.16360501945018768, 0.14369529485702515, -0.08784200251102448, -0.37816399335861206, 0.04561029374599457, 0.10736541450023651, 0.19540733098983765, -0.19070586562156677, 0.25528469681739807, 0.14464688301086426, 0.09711328148841858, 0.23521220684051514, -0.054803114384412766, 0.48797017335891724, 0.6243381500244141, -0.08966817706823349, -0.19751501083374023, -0.3277736306190491, -0.012935258448123932, 0.22997191548347473, -0.11472326517105103, 0.4126276671886444, 0.294882595539093, 0.2767036557197571, 0.0016656816005706787, -0.2025527060031891, -0.2100130319595337, 0.03593092039227486, -0.04832310974597931, -0.21006785333156586, 0.12490910291671753, -0.10752224922180176, -0.108339823782444, -0.020541928708553314, -0.10317233204841614, 0.14587217569351196, 0.28187069296836853, 0.06520774960517883, 0.21085600554943085, -0.16451957821846008, 0.2864384651184082, 0.1281590759754181, 0.5426350831985474, -0.13610240817070007, 0.09340180456638336, 0.06306938827037811, -0.13371685147285461, -0.08986172825098038, 0.3056503236293793, 0.17123731970787048, 0.23902758955955505, -0.3135991096496582, 0.25943470001220703, -0.1267389953136444, -0.09253796935081482, -0.058481208980083466, 0.29079970717430115, 0.14272166788578033, -0.3087247610092163, 0.42272576689720154, 0.13330964744091034, -0.10156711935997009, 0.14319343864917755, 0.1301778107881546, -0.07605916261672974, -0.34345540404319763, 0.18394464254379272, 0.3798992931842804, -0.09575308859348297, 0.04536477103829384, 0.10291890054941177, -0.22112491726875305, -0.09150686115026474, 0.15585745871067047, -0.5804215669631958, 0.024208061397075653, -0.017091216519474983, 0.1319759488105774, 0.03892632946372032, 0.6393265724182129, 0.15208089351654053, 0.15818481147289276, -0.22153536975383759, -0.12579798698425293, -0.32392895221710205, -0.09901232272386551, -0.1867528259754181, -0.06125328689813614, 0.10773833096027374, 0.2188260406255722, 0.04233907163143158, 0.21733294427394867, -0.05939628183841705, -0.13751770555973053, -0.08653293550014496, 0.4834323823451996, -0.38279229402542114, 0.010623730719089508, 0.1871936321258545, 0.36322060227394104, 0.010144293308258057, -0.3019274175167084, 0.07062456756830215, 0.14655223488807678, 0.07208973914384842, 0.19907081127166748, -0.10798890888690948, 0.4362371861934662, -0.06178358197212219, 0.22652363777160645, -0.07624899595975876, -0.08807168900966644, -0.08748488873243332, -0.058194372802972794, -0.26707422733306885, -0.07351565361022949, -0.2971895933151245, -0.00828642025589943, 0.25793972611427307, 0.26978495717048645, -0.19692322611808777, -0.030406884849071503, -0.33551496267318726, -0.03492826223373413, 0.20170705020427704, -0.17560574412345886, -0.14371326565742493, -0.048506587743759155, -0.22534412145614624, 0.3298526406288147, -0.017503980547189713, 0.41562938690185547, -0.003383886069059372, 0.0975283607840538, -0.28821858763694763, -0.13265560567378998, 0.30910083651542664, -0.4461873769760132, -0.284978449344635, -0.22213789820671082, 0.021143514662981033, 0.148311585187912, 0.15547919273376465, -0.1350284367799759, 0.0000731348991394043, 0.22955827414989471, -0.06566204130649567, -0.05510561913251877, 0.47584637999534607, 0.10825613141059875, -0.033788055181503296, -0.26597511768341064, 0.1222148910164833, 0.15932312607765198, -0.050328515470027924, -0.3379136323928833, -0.3602851331233978 ]
https://github.com/huggingface/datasets/issues/5878
Ultimately settled on using webdataset to circumvent huggingface datasets entirely. Would definitely switch back if: https://github.com/huggingface/datasets/issues/5337 was resolved.
Prefetching for IterableDataset
### Feature request Add support for prefetching the next n batches through iterabledataset to reduce batch loading bottleneck in training loop. ### Motivation The primary motivation behind this is to use hardware accelerators alongside a streaming dataset. This is required when you are in a low ram or low disk space setting as well as quick iteration where you're iterating though different accelerator environments (e.x changing ec2 instances quickly to figure out batch/sec for a particular architecture). Currently, using the IterableDataset results in accelerators becoming basically useless due to the massive bottleneck induced by the dataset lazy loading/transform/mapping. I've considered two alternatives: PyTorch dataloader that handles this. However, I'm using jax, and I believe this is a piece of functionality that should live in the stream class. Replicating the "num_workers" part of the PyTorch DataLoader to eagerly load batches and apply the transform so Arrow caching will automatically cache results and make them accessible. ### Your contribution I may or may not have time to do this. Currently, I've written the basic multiprocessor approach to handle the eager DataLoader for my own use case with code that's not integrated to datasets. I'd definitely see this as being the default over the regular Dataset for most people given that they wouldn't have to wait on the datasets while also not worrying about performance.
18
Prefetching for IterableDataset ### Feature request Add support for prefetching the next n batches through iterabledataset to reduce batch loading bottleneck in training loop. ### Motivation The primary motivation behind this is to use hardware accelerators alongside a streaming dataset. This is required when you are in a low ram or low disk space setting as well as quick iteration where you're iterating though different accelerator environments (e.x changing ec2 instances quickly to figure out batch/sec for a particular architecture). Currently, using the IterableDataset results in accelerators becoming basically useless due to the massive bottleneck induced by the dataset lazy loading/transform/mapping. I've considered two alternatives: PyTorch dataloader that handles this. However, I'm using jax, and I believe this is a piece of functionality that should live in the stream class. Replicating the "num_workers" part of the PyTorch DataLoader to eagerly load batches and apply the transform so Arrow caching will automatically cache results and make them accessible. ### Your contribution I may or may not have time to do this. Currently, I've written the basic multiprocessor approach to handle the eager DataLoader for my own use case with code that's not integrated to datasets. I'd definitely see this as being the default over the regular Dataset for most people given that they wouldn't have to wait on the datasets while also not worrying about performance. Ultimately settled on using webdataset to circumvent huggingface datasets entirely. Would definitely switch back if: https://github.com/huggingface/datasets/issues/5337 was resolved.
[ -0.45579227805137634, -0.2268311083316803, -0.08260215073823929, -0.36152172088623047, 0.0228714719414711, -0.02254685014486313, 0.32513269782066345, 0.1921139806509018, 0.25648418068885803, 0.053930796682834625, 0.01316484808921814, -0.008307550102472305, -0.31766197085380554, 0.5462949872016907, 0.20778052508831024, -0.018122892826795578, 0.1058792844414711, 0.2095627784729004, -0.19600245356559753, 0.35340750217437744, -0.16373193264007568, -0.07581470906734467, -0.1420210897922516, -0.24205872416496277, -0.315477579832077, 0.04788307845592499, 0.06946272403001785, 0.053744807839393616, 0.23917153477668762, -0.5488300323486328, 0.4394153952598572, 0.42134296894073486, 0.3248788118362427, 0.21474240720272064, -0.0001042724761646241, -0.002132907509803772, 0.12630608677864075, -0.017639365047216415, -0.5211517810821533, 0.1495814025402069, -0.04250768572092056, -0.1159956082701683, -0.007753603160381317, -0.17797952890396118, -0.42170649766921997, -0.3320046365261078, 0.38781633973121643, -0.6245469450950623, 0.46383070945739746, -0.030404895544052124, 0.17786628007888794, 0.19095617532730103, -0.3752312958240509, -0.02314414642751217, -0.3411121368408203, 0.04781653732061386, -0.1993800848722458, -0.2196703851222992, 0.6209701299667358, 0.028004102408885956, -0.3824184834957123, 0.31372949481010437, 0.11753395199775696, 0.09725633263587952, 0.4146368205547333, -0.04093455523252487, -0.13300476968288422, -0.29132524132728577, -0.1786484718322754, 0.08734428882598877, 0.2491457462310791, -0.24355025589466095, -0.41971778869628906, -0.6468991041183472, -0.10701419413089752, -0.46430182456970215, -0.03136932849884033, -0.15195688605308533, -0.11932193487882614, 0.09960368275642395, -0.22513331472873688, -0.01098383218050003, -0.1783304214477539, -0.05676141381263733, 0.2646247446537018, 0.22265608608722687, -0.1347796469926834, -0.021814435720443726, 0.15800178050994873, -0.08176097273826599, 0.5094447135925293, -0.27125445008277893, 0.10908623039722443, 0.20169278979301453, -0.34320712089538574, -0.18230441212654114, -0.10465821623802185, 0.028874028474092484, 0.062218911945819855, 0.38675832748413086, 0.10998080670833588, 0.2270340472459793, -0.00714261457324028, -0.14291277527809143, 0.20106838643550873, 0.03746619075536728, -0.07611598074436188, -0.16375257074832916, 0.1798066794872284, 0.3309036195278168, 0.15148195624351501, 0.06687535345554352, 0.11693963408470154, -0.039386872202157974, 0.25825077295303345, 0.03880709782242775, -0.06833644211292267, 0.12307099997997284, -0.1387283205986023, -0.30099236965179443, -0.08026907593011856, -0.2290576696395874, 0.09441351145505905, 0.04259021207690239, -0.1343287080526352, 0.2558435797691345, -0.20912371575832367, 0.05310583859682083, -0.09028834849596024, -0.3804473876953125, -0.1626180112361908, -0.21611028909683228, -0.1598200649023056, 0.38261616230010986, 0.3963061571121216, -0.35582435131073, 0.15835268795490265, -0.12432961165904999, 0.2873584032058716, 0.28426629304885864, 0.29359057545661926, -0.05848022550344467, 0.18249031901359558, 0.21494247019290924, -0.10099001228809357, 0.04814989119768143, -0.019072197377681732, 0.11511819064617157, -0.0989515632390976, 0.19553926587104797, -0.020890329033136368, -0.389065146446228, 0.3536974787712097, 0.18233722448349, -0.12604951858520508, -0.229487806558609, -0.35860031843185425, 0.39428815245628357, -0.10972416400909424, 0.04599849879741669, 0.0675644800066948, -0.07784569263458252, -0.24930788576602936, -0.15380188822746277, 0.21053114533424377, 0.16747894883155823, -0.025197796523571014, -0.10948798060417175, -0.03971660137176514, -0.017104852944612503, 0.20527072250843048, 0.12009193003177643, -0.3304499387741089, 0.1411735564470291, -0.09731338173151016, 0.1270294487476349, -0.00008634477853775024, -0.1455783098936081, -0.28474098443984985, 0.25178399682044983, 0.014529593288898468, 0.6321879029273987, 0.04427853599190712, 0.32680457830429077, 0.2028437852859497, -0.3015032112598419, 0.13084307312965393, 0.5902175903320312, -0.23204806447029114, 0.0036864131689071655, -0.14011119306087494, -0.2649189829826355, -0.09693887829780579, 0.47901031374931335, 0.07174449414014816, 0.09656301140785217, -0.1101147010922432, -0.04786613956093788, 0.25033363699913025, -0.2391173094511032, 0.3032589852809906, -0.013580530881881714, -0.10987602919340134, -0.08480282872915268, 0.07254274934530258, -0.25695979595184326, -0.7171069383621216, 0.3459396958351135, -0.02404140681028366, -0.18439114093780518, 0.13923129439353943, -0.14140917360782623, 0.016101378947496414, 0.15423616766929626, -0.20548860728740692, -0.15239614248275757, 0.059900522232055664, 0.19097383320331573, 0.0624837726354599, -0.22105440497398376, -0.4960949420928955, 0.6944732069969177, -0.18628358840942383, 0.017162878066301346, -0.34040728211402893, -0.010581232607364655, 0.2598693072795868, -0.00713580846786499, 0.025591455399990082, 0.22239136695861816, -0.24466174840927124, -0.2289735972881317, 0.09298950433731079, 0.36717459559440613, 0.09878997504711151, 0.23091542720794678, -0.008770233020186424, 0.6148025989532471, 0.24302807450294495, 0.0956001728773117, -0.1376061737537384, 0.06930321455001831, -0.008878227323293686, -0.21171680092811584, -0.12969952821731567, 0.5589337944984436, -0.26320192217826843, 0.11993107944726944, -0.04270676150918007, -0.16405029594898224, 0.1969253271818161, 0.12287786602973938, -0.4668755531311035, 0.097683385014534, -0.004276135005056858, -0.17108745872974396, 0.19626876711845398, -0.07857916504144669, -0.32096412777900696, 0.18345510959625244, 0.12857139110565186, 0.012113146483898163, -0.16764774918556213, 0.03220663592219353, -0.10135578364133835, -0.17000648379325867, 0.11316961795091629, 0.0633179321885109, 0.2580920457839966, 0.24732407927513123, 0.110802561044693, -0.0711948499083519, 0.044276461005210876, -0.17372924089431763, 0.19017237424850464, 0.013542823493480682, 0.3686939477920532, -0.01906004548072815, -0.007388336583971977, -0.02646723948419094, -0.18831416964530945, -0.21133163571357727, -0.08121354877948761, -0.07607236504554749, -0.12385637313127518, 0.02631402015686035, -0.0011353343725204468, -0.2657583951950073, 0.007234405726194382, -0.2496321201324463, 0.20623841881752014, -0.13572481274604797, 0.071399986743927, 0.4841199219226837, -0.13908079266548157, 0.18065348267555237, -0.2681792378425598, 0.727281928062439, -0.052084289491176605, -0.13137561082839966, -0.44774729013442993, 0.14039084315299988, -0.1308068037033081, 0.1503174901008606, 0.1266663819551468, -0.42529618740081787, 0.3747752904891968, 0.29686155915260315, 0.18130606412887573, -0.2760111689567566, -0.04250994324684143, 0.04866979643702507, 0.022105218842625618, 0.25345584750175476, 0.02238798514008522, 0.12277381122112274, 0.017367854714393616, -0.18943913280963898, 0.011641070246696472, -0.2056041955947876, 0.01918376237154007, -0.29555708169937134, 0.027665521949529648, 0.11458305269479752, 0.04593855142593384, -0.022894520312547684, -0.20533475279808044, -0.3309977054595947, 0.028715830296278, 0.08848840743303299, -0.016184166073799133, 0.2723505198955536, -0.14981700479984283, 0.021834179759025574, 0.2812226414680481, -0.38040849566459656, -0.04249008744955063, -0.5091060400009155, 0.2889537513256073, -0.2559652626514435, -0.15917575359344482, -0.21733176708221436, -0.17884796857833862, -0.05431663990020752, 0.42617127299308777, -0.3195790648460388, 0.14745202660560608, -0.12258521467447281, 0.304134726524353, -0.06355820596218109, -0.268024742603302, 0.24689981341362, 0.053654689341783524, -0.10112283378839493, -0.14197948575019836, 0.08469405770301819, 0.11887326836585999, -0.10388535261154175, 0.06637480109930038, 0.3571561872959137, 0.0046041542664170265, 0.15539619326591492, 0.9938633441925049, 0.16115723550319672, -0.13667790591716766, 0.3285555839538574, 0.21840207278728485, 0.047002777457237244, -0.20352284610271454, -0.1975218951702118, -0.053767357021570206, -0.2352706640958786, 0.10884596407413483, 0.22392840683460236, -0.21453453600406647, -0.2331799566745758, -0.15447038412094116, 0.2523335814476013, 0.02129419893026352, -0.05135485902428627, 0.2882749140262604, -0.2931255102157593, 0.2957993745803833, 0.003322817385196686, -0.007354892790317535, -0.14687269926071167, -0.1518675535917282, 0.009849190711975098, -0.2054864764213562, 0.3688676655292511, -0.12047471106052399, -0.27195966243743896, 0.2559930980205536, -0.684565544128418, 0.2475418746471405, 0.16416901350021362, 0.19961382448673248, 0.07682977616786957, -0.31781524419784546, -0.10482048243284225, -0.11678403615951538, 0.505516767501831, -0.3405197262763977, -0.28957387804985046, -0.11667953431606293, -0.20581454038619995, -0.0923214927315712, -0.07812419533729553, -0.10017893463373184, 0.4463595151901245, 0.05489935353398323, 0.5298879146575928, -0.1564021110534668, -0.3753267228603363, 0.14815014600753784, -0.27393072843551636, -0.11709214746952057, -0.10138697922229767, -0.07317418605089188, -0.0636158138513565, 0.08185776323080063, 0.22840569913387299, 0.20443028211593628, 0.24363061785697937, -0.03282869607210159, -0.12213768064975739, -0.30449748039245605, 0.18335136771202087, -0.04582168534398079, 0.0009709633886814117, -0.006737595424056053, 0.25700026750564575, 0.3978816866874695, 0.35397210717201233, 0.3491581678390503, 0.17211094498634338, 0.12208381295204163, -0.12772199511528015, -0.2993200123310089, 0.10229840874671936, 0.19078221917152405, 0.2616735100746155, 0.37525996565818787, -0.016522875055670738, 0.09574718028306961, 0.4408014118671417, 0.0968218445777893, -0.4957239031791687, 0.04572392255067825, 0.1996772289276123, 0.06903339922428131, -0.48323526978492737, -0.7071266174316406, 0.37336617708206177, 0.09099222719669342, -0.016785435378551483, 0.6211583018302917, 0.001438479870557785, -0.15920719504356384, 0.08340289443731308, 0.3795711398124695, 0.6982003450393677, -0.09033650159835815, 0.3331517279148102, 0.24506635963916779, -0.0636187344789505, 0.19307179749011993, -0.3680172562599182, 0.36007189750671387, -0.1150151938199997, -0.5657041072845459, 0.016972221434116364, -0.13049212098121643, 0.16958829760551453, 0.25227704644203186, -0.07432831823825836, 0.18556909263134003, 0.2791140079498291, -0.05759448930621147, -0.05443894863128662, 0.14079488813877106, -0.08421128988265991, -0.49884504079818726, -0.13166286051273346, 0.17964762449264526, -0.025286760181188583, 0.11424665153026581, -0.20889915525913239, -0.10479465872049332, 0.37425824999809265, 0.20294588804244995, -0.10603277385234833, 0.028620988130569458, -0.42649272084236145, -0.03494373708963394, 0.07242916524410248, -0.05212464928627014, 0.062050431966781616, 0.153281569480896, 0.2725507915019989, -0.26274845004081726, -0.27818843722343445, 0.15648263692855835, -0.085526242852211, 0.2678777575492859, -0.151335671544075, -0.2981891334056854, 0.572428286075592, -0.22075384855270386, 0.026218846440315247, 0.10922360420227051, -0.05919014289975166, -0.6001960039138794, -0.012958481907844543, -0.1087341457605362, 0.21044740080833435, -0.29231882095336914, -0.1457478255033493, 0.3515847325325012, 0.0768447071313858, -0.2648981809616089, 0.12333521246910095, -0.06980286538600922, -0.020846541970968246, 0.2118624895811081, -0.2364458590745926, -0.14230918884277344, -0.10212958604097366, 0.23790131509304047, 0.13957279920578003, -0.30297428369522095, 0.4726177752017975, 0.12333981692790985, -0.15648213028907776, -0.1808699667453766, -0.15659624338150024, 0.45918625593185425, -0.21550685167312622, 0.2455459088087082, -0.10224688798189163, -0.06830556690692902, 0.07161682844161987, 0.3672473132610321, 0.15645623207092285, -0.20819295942783356, -0.11935590952634811, -0.030003249645233154, -0.33272671699523926, 0.10968165099620819, -0.031801894307136536, 0.3393101394176483, 0.13728082180023193, -0.0887388288974762, 0.10800076276063919, 0.1327119767665863, -0.39067935943603516, -0.3172360062599182, 0.06130436807870865, -0.0973052978515625, 0.030168108642101288, -0.09408082067966461, 0.4160940945148468, 0.22867271304130554, 0.03610096871852875, 0.09059368073940277, -0.34886568784713745, -0.27948012948036194, -0.09302704781293869, 0.10824194550514221, -0.121181920170784, -0.27942875027656555, -0.055771950632333755, -0.08848169445991516, -0.2972402572631836, -0.22259148955345154, 0.23785088956356049, -0.02649904415011406, -0.011230498552322388, -0.1855381727218628, 0.47546619176864624, 0.06415561586618423, -0.12107539176940918, 0.03785214200615883, 0.21869809925556183, -0.019188515841960907, -0.0722862109541893, 0.16232040524482727, 0.00846092775464058, -0.17661230266094208, 0.021161045879125595, 0.07321257889270782, 0.7995495796203613, 0.1544404923915863, 0.13144466280937195, -0.4107089042663574, -0.2294018715620041, 0.2031918317079544, 0.3928685188293457, 0.2680967450141907, -0.0907549113035202, -0.18417209386825562, 0.17942571640014648, 0.24376703798770905, -0.22383619844913483, -0.06688261777162552, -0.006637470796704292, 0.06262844055891037, 0.10311244428157806, 0.24489757418632507, 0.26582592725753784, 0.2322002351284027, 0.25577232241630554, 0.0945885106921196, -0.01816476881504059, -0.3377816081047058, 0.09258849918842316, -0.016954557970166206, 0.1922910511493683, -0.12998542189598083, 0.2440134435892105, 0.1747203767299652, 0.16399291157722473, 0.28355181217193604, -0.06545193493366241, 0.5586633682250977, 0.47733497619628906, 0.0711013451218605, -0.14485910534858704, -0.46469005942344666, -0.07674190402030945, 0.14759784936904907, -0.12450708448886871, 0.36533108353614807, 0.17460423707962036, 0.32366257905960083, 0.0028253979980945587, -0.2733791470527649, -0.19829504191875458, -0.019356509670615196, -0.07346245646476746, -0.21123799681663513, 0.15101251006126404, -0.08861784636974335, -0.06055724620819092, 0.08594582974910736, -0.09933635592460632, 0.062304820865392685, 0.3207758367061615, 0.006112586706876755, 0.20695552229881287, -0.18722550570964813, 0.14031435549259186, 0.18939252197742462, 0.5351106524467468, -0.07267473638057709, 0.16013993322849274, 0.07815499603748322, -0.2228264957666397, -0.002975194249302149, 0.3977283537387848, 0.08882561326026917, 0.12067568302154541, -0.19119583070278168, 0.2241242378950119, -0.1350659728050232, -0.006874218583106995, -0.10215185582637787, 0.27074843645095825, 0.169573575258255, -0.14376895129680634, 0.44246482849121094, 0.13082611560821533, -0.08106455206871033, 0.1700855791568756, 0.025230655446648598, -0.043702222406864166, -0.47409456968307495, 0.10876132547855377, 0.2610417306423187, -0.061911147087812424, 0.04024544730782509, 0.0852939784526825, -0.14660950005054474, -0.03175582364201546, 0.18199875950813293, -0.5301458239555359, 0.01025330275297165, -0.061823196709156036, 0.1362513303756714, 0.06922202557325363, 0.727211058139801, 0.2077959179878235, 0.11211691796779633, -0.2044171392917633, -0.20677848160266876, -0.31453436613082886, -0.06994841247797012, -0.012858915142714977, 0.2378297597169876, 0.0895453542470932, 0.22078219056129456, 0.025849446654319763, 0.14067013561725616, -0.0984346941113472, -0.2073756754398346, 0.008189212530851364, 0.3823661208152771, -0.2980482280254364, 0.09950777888298035, 0.059602875262498856, 0.2890361249446869, 0.019849814474582672, -0.2361675500869751, 0.08726772665977478, 0.1939089596271515, -0.010892432183027267, 0.15233999490737915, -0.016056597232818604, 0.3493591547012329, -0.2591469883918762, 0.3254307210445404, -0.07379990816116333, -0.14432242512702942, -0.041375782340765, -0.08791743218898773, -0.345495343208313, -0.10426779091358185, -0.23443274199962616, 0.0019465330988168716, 0.1805042028427124, 0.24611420929431915, -0.2330816388130188, -0.0860384851694107, -0.2974960207939148, -0.010103445500135422, 0.2743426561355591, -0.13376019895076752, -0.2289004772901535, -0.011707060039043427, -0.28165122866630554, 0.2451060712337494, 0.10512880235910416, 0.48740696907043457, 0.03577055782079697, 0.025422200560569763, -0.28761398792266846, -0.11970338225364685, 0.3020143508911133, -0.4846576750278473, -0.18611451983451843, -0.1621897667646408, 0.05360054969787598, 0.30453380942344666, 0.02790256030857563, -0.2747899889945984, -0.06075242906808853, 0.24587471783161163, -0.08474848419427872, 0.007154002785682678, 0.543297290802002, 0.06890954822301865, -0.05640137940645218, -0.25505924224853516, 0.2735896110534668, 0.1782083809375763, -0.08831342309713364, -0.1771639734506607, -0.3547368347644806 ]
https://github.com/huggingface/datasets/issues/5878
Hi! You can combine `datasets` with `torchdata` to prefetch `IterableDataset`'s samples: ```python from datasets import load_dataset from torchdata.datapipes.iter import IterableWrapper, HuggingFaceHubReader from torch.utils.data import DataLoader ds = load_dataset("sst", split="train", streaming=True) # processing... dp = IterableWrapper(ds) dp = dp.prefetch(100) dl = DataLoader(dp, batch_size=8) i = iter(dl) next(i) ```
Prefetching for IterableDataset
### Feature request Add support for prefetching the next n batches through iterabledataset to reduce batch loading bottleneck in training loop. ### Motivation The primary motivation behind this is to use hardware accelerators alongside a streaming dataset. This is required when you are in a low ram or low disk space setting as well as quick iteration where you're iterating though different accelerator environments (e.x changing ec2 instances quickly to figure out batch/sec for a particular architecture). Currently, using the IterableDataset results in accelerators becoming basically useless due to the massive bottleneck induced by the dataset lazy loading/transform/mapping. I've considered two alternatives: PyTorch dataloader that handles this. However, I'm using jax, and I believe this is a piece of functionality that should live in the stream class. Replicating the "num_workers" part of the PyTorch DataLoader to eagerly load batches and apply the transform so Arrow caching will automatically cache results and make them accessible. ### Your contribution I may or may not have time to do this. Currently, I've written the basic multiprocessor approach to handle the eager DataLoader for my own use case with code that's not integrated to datasets. I'd definitely see this as being the default over the regular Dataset for most people given that they wouldn't have to wait on the datasets while also not worrying about performance.
47
Prefetching for IterableDataset ### Feature request Add support for prefetching the next n batches through iterabledataset to reduce batch loading bottleneck in training loop. ### Motivation The primary motivation behind this is to use hardware accelerators alongside a streaming dataset. This is required when you are in a low ram or low disk space setting as well as quick iteration where you're iterating though different accelerator environments (e.x changing ec2 instances quickly to figure out batch/sec for a particular architecture). Currently, using the IterableDataset results in accelerators becoming basically useless due to the massive bottleneck induced by the dataset lazy loading/transform/mapping. I've considered two alternatives: PyTorch dataloader that handles this. However, I'm using jax, and I believe this is a piece of functionality that should live in the stream class. Replicating the "num_workers" part of the PyTorch DataLoader to eagerly load batches and apply the transform so Arrow caching will automatically cache results and make them accessible. ### Your contribution I may or may not have time to do this. Currently, I've written the basic multiprocessor approach to handle the eager DataLoader for my own use case with code that's not integrated to datasets. I'd definitely see this as being the default over the regular Dataset for most people given that they wouldn't have to wait on the datasets while also not worrying about performance. Hi! You can combine `datasets` with `torchdata` to prefetch `IterableDataset`'s samples: ```python from datasets import load_dataset from torchdata.datapipes.iter import IterableWrapper, HuggingFaceHubReader from torch.utils.data import DataLoader ds = load_dataset("sst", split="train", streaming=True) # processing... dp = IterableWrapper(ds) dp = dp.prefetch(100) dl = DataLoader(dp, batch_size=8) i = iter(dl) next(i) ```
[ -0.4951932728290558, -0.21732252836227417, -0.09793658554553986, -0.33331742882728577, 0.04191122204065323, 0.0207659974694252, 0.3390699326992035, 0.24473732709884644, 0.23043428361415863, 0.05596419423818588, -0.021707583218812943, 0.1356603503227234, -0.3293340504169464, 0.31185075640678406, 0.18406924605369568, -0.024314630776643753, 0.041955552995204926, 0.15691056847572327, -0.24780890345573425, 0.29258590936660767, -0.11745703220367432, -0.10540200024843216, -0.11400619149208069, -0.20475097000598907, -0.21116045117378235, 0.10707230120897293, 0.048122599720954895, -0.013647140935063362, 0.2744640111923218, -0.5814564228057861, 0.4063769578933716, 0.3707025349140167, 0.39114588499069214, 0.2318524569272995, -0.00010483978257980198, 0.011529654264450073, 0.05269814655184746, -0.10863689333200455, -0.5357719659805298, 0.09764239192008972, 0.11658109724521637, -0.18031197786331177, -0.017290741205215454, -0.2705055773258209, -0.48710912466049194, -0.35781329870224, 0.24512192606925964, -0.6928303241729736, 0.4164486527442932, 0.08369656652212143, 0.18702927231788635, 0.15786585211753845, -0.4023100733757019, 0.018449798226356506, -0.18728522956371307, -0.08688382804393768, -0.1500103771686554, -0.20743227005004883, 0.5920981168746948, 0.05978643149137497, -0.3402968645095825, 0.32542335987091064, 0.03626850247383118, 0.16497671604156494, 0.28792646527290344, -0.0274084210395813, -0.14187754690647125, -0.20932291448116302, -0.21173886954784393, 0.01783432997763157, 0.17990824580192566, -0.36798015236854553, -0.40619462728500366, -0.6289580464363098, -0.128091961145401, -0.4860098958015442, -0.044135965406894684, -0.12886491417884827, -0.18741558492183685, -0.041755445301532745, -0.10973385721445084, 0.08237108588218689, -0.1262730062007904, -0.0690719336271286, 0.2838539481163025, 0.35416778922080994, -0.06275472044944763, 0.002754267305135727, 0.1253739297389984, -0.09598810970783234, 0.7033771872520447, -0.2169666290283203, 0.18308183550834656, 0.26822221279144287, -0.32719218730926514, -0.08978152275085449, -0.04573645070195198, -0.1547604650259018, -0.04654993116855621, 0.346316397190094, 0.17475645244121552, 0.17793306708335876, 0.1393439769744873, -0.11619190871715546, 0.1503264307975769, -0.028682291507720947, -0.11910644173622131, 0.06679922342300415, 0.07718946784734726, 0.19966010749340057, 0.11081492155790329, 0.03130326047539711, 0.04692451283335686, -0.2310490906238556, 0.29239481687545776, 0.1832488775253296, -0.1209036335349083, 0.2084655910730362, -0.15553174912929535, -0.2950727939605713, -0.12001711130142212, -0.20560401678085327, 0.08778224885463715, 0.040565259754657745, -0.139765202999115, 0.2159358561038971, -0.0989643931388855, -0.02087019756436348, -0.14310148358345032, -0.27284756302833557, -0.1415666788816452, -0.17956121265888214, -0.19985920190811157, 0.32347074151039124, 0.38074934482574463, -0.3330064117908478, 0.13863563537597656, -0.14817455410957336, 0.17156758904457092, 0.33985084295272827, 0.33238935470581055, -0.059019073843955994, 0.33190542459487915, 0.20400017499923706, -0.052953384816646576, 0.08342424035072327, 0.0037778490222990513, 0.2169497162103653, -0.18711888790130615, 0.24345986545085907, -0.016152337193489075, -0.3192284405231476, 0.29880431294441223, 0.21233977377414703, -0.10045059770345688, -0.20564734935760498, -0.2691803276538849, 0.27403393387794495, 0.03336329758167267, -0.040277957916259766, 0.15812554955482483, -0.19000515341758728, -0.21172979474067688, -0.15682101249694824, 0.2612926959991455, 0.1743544340133667, -0.03962258622050285, -0.13086038827896118, 0.049458909779787064, 0.013813517987728119, 0.2576509714126587, 0.01789804920554161, -0.2764652371406555, 0.20068302750587463, -0.18584245443344116, 0.09362417459487915, 0.1510230302810669, -0.16570547223091125, -0.28422075510025024, 0.20949463546276093, 0.032403409481048584, 0.5697139501571655, 0.06575126200914383, 0.35482826828956604, 0.3089723587036133, -0.22682659327983856, 0.1458735167980194, 0.6119727492332458, -0.281728059053421, 0.00983487069606781, -0.14489741623401642, -0.10870195925235748, 0.027919694781303406, 0.5051798820495605, 0.09762535244226456, -0.0007781907916069031, -0.19692230224609375, -0.042625728994607925, 0.3264613747596741, -0.21953661739826202, 0.2785349488258362, 0.02519775554537773, -0.2045947015285492, -0.035389140248298645, 0.10168388485908508, -0.3052586317062378, -0.5352532863616943, 0.3461841940879822, 0.05810970067977905, -0.21858468651771545, 0.06845714151859283, -0.08310356736183167, 0.031014733016490936, 0.1536506712436676, -0.26045915484428406, -0.200979083776474, 0.10553868114948273, 0.24696175754070282, 0.04195823520421982, -0.3068690896034241, -0.38850468397140503, 0.6396682858467102, -0.14297468960285187, -0.0527225062251091, -0.35125932097435, -0.02451707050204277, 0.2289426177740097, -0.11869161576032639, -0.0171833336353302, 0.22134917974472046, -0.17483463883399963, -0.2501983344554901, 0.011961143463850021, 0.34551066160202026, 0.13497871160507202, 0.12355843186378479, -0.07443822175264359, 0.5302129983901978, 0.1381710320711136, 0.07575997710227966, -0.16704069077968597, 0.2652590274810791, -0.0331994965672493, -0.17054776847362518, -0.06198398768901825, 0.5921717882156372, -0.22209852933883667, 0.2082415074110031, -0.07504525780677795, -0.14376500248908997, 0.18281614780426025, 0.15330292284488678, -0.40678858757019043, 0.20158913731575012, 0.048876550048589706, -0.21357135474681854, 0.19390460848808289, -0.15573231875896454, -0.26079612970352173, 0.18636749684810638, 0.025977613404393196, 0.0639435350894928, -0.15029439330101013, -0.00291574839502573, -0.169526144862175, -0.07773324847221375, 0.08748246729373932, -0.003796212375164032, 0.24333038926124573, 0.2538779675960541, 0.13686884939670563, -0.0984070897102356, 0.08155863732099533, -0.12848421931266785, 0.18924114108085632, -0.027999382466077805, 0.2095487415790558, 0.08852171897888184, -0.016019156202673912, -0.04921926558017731, -0.09996810555458069, -0.2816110849380493, -0.1032571792602539, -0.05593106150627136, -0.11777985841035843, 0.11426321417093277, 0.04050685465335846, -0.213114395737648, -0.017078304663300514, -0.29560235142707825, 0.33130350708961487, -0.1539020538330078, 0.08857405185699463, 0.5099260210990906, -0.12257429957389832, 0.1943940967321396, -0.23401372134685516, 0.4803313612937927, 0.1368124634027481, -0.29248619079589844, -0.31009846925735474, 0.020169220864772797, -0.09178566932678223, 0.1633971929550171, 0.05450618267059326, -0.3656626045703888, 0.4188099503517151, 0.29596978425979614, 0.15415945649147034, -0.2883588969707489, 0.12281064689159393, 0.01641029119491577, 0.020707974210381508, 0.10722605884075165, 0.08809021860361099, 0.06797082722187042, 0.09281547367572784, -0.1986343115568161, 0.03370392695069313, -0.2343294322490692, 0.033577002584934235, -0.21209174394607544, -0.013846363872289658, 0.11230743676424026, 0.11658699065446854, -0.15688106417655945, -0.23365150392055511, -0.31212466955184937, -0.12819068133831024, 0.11031985282897949, 0.03968319296836853, 0.1123829036951065, -0.08365080505609512, 0.02605374902486801, 0.4212522506713867, -0.3732445240020752, 0.02048540487885475, -0.45427921414375305, 0.3924609124660492, -0.28281646966934204, -0.15885871648788452, -0.22791388630867004, -0.23956885933876038, -0.02996148355305195, 0.4710201025009155, -0.2955351769924164, 0.24510455131530762, -0.050766102969646454, 0.3612363040447235, -0.14107204973697662, -0.19983045756816864, 0.3065582513809204, 0.06522063910961151, -0.11603294312953949, -0.14738532900810242, 0.08723986893892288, 0.016019318252801895, -0.18736526370048523, 0.15269313752651215, 0.2757872939109802, 0.045317504554986954, 0.12040048837661743, 1.018608570098877, 0.1370391547679901, -0.26619473099708557, 0.30865761637687683, 0.11706843227148056, -0.061299122869968414, -0.12859228253364563, -0.22892139852046967, -0.037484973669052124, -0.21419626474380493, 0.05544882267713547, 0.14203210175037384, -0.19387823343276978, -0.2534145414829254, -0.11434543877840042, 0.2889145612716675, -0.027666084468364716, -0.08684471994638443, 0.3191802203655243, -0.48828187584877014, 0.28726619482040405, -0.09015324711799622, 0.007982328534126282, -0.2338537573814392, -0.1262463480234146, -0.0447922945022583, -0.2901013195514679, 0.33641400933265686, -0.12814128398895264, -0.1712372601032257, 0.24699276685714722, -0.533374011516571, 0.2058355063199997, 0.20615947246551514, 0.16092294454574585, 0.1769597977399826, -0.35772809386253357, -0.07849130779504776, -0.1838599145412445, 0.4760730564594269, -0.291141152381897, -0.20700183510780334, 0.015898026525974274, -0.1126592680811882, -0.21889671683311462, -0.12073956429958344, -0.12945398688316345, 0.4657492935657501, 0.055983368307352066, 0.37539008259773254, -0.09819324314594269, -0.3210335671901703, 0.09802140295505524, -0.1883362978696823, -0.15416215360164642, -0.0953790619969368, -0.06734056025743484, -0.09997954219579697, 0.07642847299575806, 0.2663101851940155, 0.1842646598815918, 0.2634047269821167, -0.0976618230342865, -0.1760430634021759, -0.33206239342689514, 0.17680320143699646, -0.045884378254413605, -0.018318478018045425, 0.07523782551288605, 0.19514305889606476, 0.44821059703826904, 0.2760797441005707, 0.43556174635887146, 0.2325083166360855, 0.14715483784675598, -0.0676218569278717, -0.14772990345954895, 0.13105882704257965, 0.18019616603851318, 0.13251620531082153, 0.2410748302936554, -0.05441989377140999, 0.055130280554294586, 0.16659311950206757, 0.1513819396495819, -0.3647651672363281, 0.12444375455379486, 0.13656321167945862, 0.07739676535129547, -0.48874202370643616, -0.7450986504554749, 0.36667776107788086, 0.12636668980121613, -0.011804923415184021, 0.6480212211608887, -0.23486094176769257, -0.16746139526367188, 0.15285976231098175, 0.393319696187973, 0.6695303916931152, -0.13897481560707092, 0.3278316557407379, 0.15492883324623108, -0.048721443861722946, 0.06696777045726776, -0.4700210690498352, 0.30688920617103577, -0.14243392646312714, -0.478991836309433, 0.0344676747918129, -0.11919353902339935, 0.06583908945322037, 0.26785534620285034, -0.11414041370153427, 0.14421555399894714, 0.14025695621967316, -0.09802703559398651, -0.08928453177213669, 0.09049433469772339, -0.11190062761306763, -0.4494534730911255, -0.008170228451490402, 0.19902974367141724, -0.04667329788208008, 0.1307346224784851, -0.15209248661994934, -0.06949488818645477, 0.29580360651016235, 0.1685207188129425, -0.18687759339809418, 0.032513104379177094, -0.42283308506011963, -0.0033057089895009995, -0.059766676276922226, -0.2013336569070816, -0.02831854671239853, 0.28769004344940186, 0.24027784168720245, -0.31753820180892944, -0.1465819776058197, 0.13404667377471924, 0.049760691821575165, 0.1872968077659607, -0.18197718262672424, -0.2572738528251648, 0.5105374455451965, -0.18148517608642578, 0.011765584349632263, 0.20291557908058167, 0.024967040866613388, -0.6244984865188599, 0.04028750956058502, -0.001100407913327217, 0.35527145862579346, -0.28806474804878235, -0.07494550943374634, 0.2947991192340851, -0.014731548726558685, -0.25030556321144104, 0.15281043946743011, -0.031588729470968246, -0.09357240796089172, 0.22030696272850037, -0.2811618447303772, -0.11321952193975449, -0.06666768342256546, 0.2974506616592407, 0.20778357982635498, -0.29095348715782166, 0.46866339445114136, 0.1486227959394455, -0.18989279866218567, -0.20924639701843262, -0.1421172022819519, 0.518685519695282, -0.18694943189620972, 0.2133307158946991, -0.13604840636253357, 0.004598066210746765, 0.05998673290014267, 0.3526420295238495, 0.11532017588615417, -0.11006713658571243, -0.16954776644706726, 0.02995234727859497, -0.37069451808929443, -0.02298588678240776, 0.029653184115886688, 0.38970640301704407, 0.05275367200374603, -0.05113692581653595, 0.0561336949467659, 0.13782194256782532, -0.39964255690574646, -0.26571881771087646, 0.06960098445415497, 0.04348840191960335, 0.05664847791194916, 0.011047285050153732, 0.34035754203796387, 0.19164714217185974, 0.09564588963985443, 0.08589603006839752, -0.28783077001571655, -0.3235388398170471, -0.08444463461637497, 0.06221403181552887, -0.1032426655292511, -0.27049362659454346, -0.13613475859165192, -0.09666268527507782, -0.20551025867462158, -0.2578456699848175, 0.207474946975708, 0.07015170902013779, -0.017589878290891647, -0.03714776784181595, 0.4866909682750702, 0.08997978270053864, -0.10524994134902954, 0.008007017895579338, 0.1503772735595703, -0.04439074546098709, -0.09839682281017303, 0.1615528166294098, 0.08220662921667099, -0.18965691328048706, -0.08304452151060104, -0.008072827011346817, 0.8180045485496521, 0.1788496971130371, 0.09290297329425812, -0.357669472694397, -0.18790580332279205, 0.19568772614002228, 0.4073038697242737, 0.32570043206214905, -0.13626167178153992, -0.19590651988983154, 0.17530107498168945, 0.27114513516426086, -0.25431931018829346, -0.029175592586398125, -0.23202838003635406, 0.004550643265247345, 0.139081671833992, 0.18169447779655457, 0.09671249985694885, 0.21471431851387024, 0.19721686840057373, 0.10784702003002167, -0.07870258390903473, -0.344035267829895, 0.1372864693403244, 0.1251988708972931, 0.23846842348575592, -0.20260107517242432, 0.2129828780889511, 0.08034095168113708, 0.1257745325565338, 0.33656826615333557, -0.048625294119119644, 0.6863785982131958, 0.6283940076828003, -0.08663609623908997, -0.22524189949035645, -0.3801768124103546, -0.14199356734752655, 0.018379680812358856, -0.06320691108703613, 0.32911616563796997, 0.1765141636133194, 0.30848610401153564, 0.0330994613468647, -0.26413774490356445, -0.10599580407142639, -0.01491027045994997, -0.024467887356877327, -0.2483123242855072, 0.1676682084798813, -0.06695231050252914, -0.09324952960014343, -0.014697402715682983, -0.07340946048498154, 0.07590033859014511, 0.2980893850326538, 0.035730041563510895, 0.19346342980861664, -0.18958517909049988, 0.19513031840324402, 0.1624787151813507, 0.42965415120124817, -0.09614637494087219, 0.06695710867643356, 0.048948027193546295, -0.12640327215194702, -0.0815260261297226, 0.25376811623573303, 0.13813874125480652, 0.18490855395793915, -0.3381654918193817, 0.2903224229812622, -0.15617495775222778, -0.041448984295129776, -0.0913022831082344, 0.2081020623445511, 0.05087694153189659, -0.24012446403503418, 0.466181218624115, 0.16103538870811462, -0.15013428032398224, 0.2103927731513977, 0.0385657474398613, -0.06675267964601517, -0.2848021686077118, 0.17749452590942383, 0.28602129220962524, -0.0502266101539135, -0.0061331200413405895, 0.07076513767242432, -0.18933814764022827, -0.11791278421878815, 0.2022937536239624, -0.4929475784301758, 0.05121997743844986, -0.04320245981216431, 0.13832026720046997, -0.011398596689105034, 0.6296336650848389, 0.1443440020084381, 0.1815759539604187, -0.21268528699874878, -0.18619611859321594, -0.23560944199562073, -0.10401347279548645, -0.07534976303577423, 0.09755860269069672, -0.0030005164444446564, 0.280361533164978, 0.008244212716817856, 0.15518951416015625, -0.1131482720375061, -0.1407158374786377, 0.016618479043245316, 0.5538445115089417, -0.29681897163391113, 0.02311338111758232, -0.08858571946620941, 0.39075884222984314, 0.09039562195539474, -0.30996543169021606, -0.044879037886857986, 0.11058495938777924, 0.10696221888065338, 0.1259041279554367, -0.14285781979560852, 0.5072290897369385, -0.1412571519613266, 0.42994773387908936, -0.19610929489135742, -0.01602485030889511, -0.04572554677724838, 0.004987448453903198, -0.32783979177474976, -0.05827084183692932, -0.2504352331161499, 0.011654523201286793, 0.23414555191993713, 0.22010718286037445, -0.1628580391407013, -0.09411361813545227, -0.3273780643939972, 0.02284921333193779, 0.25212526321411133, -0.13282983005046844, -0.14971482753753662, -0.02691112831234932, -0.17760592699050903, 0.31662896275520325, -0.014066558331251144, 0.4125863015651703, 0.005436752922832966, 0.12926429510116577, -0.31583088636398315, -0.24552980065345764, 0.3278776705265045, -0.40223199129104614, -0.15063416957855225, -0.15935498476028442, 0.0812101811170578, 0.30978384613990784, 0.15563105046749115, -0.3379751443862915, 0.024235904216766357, 0.3060203790664673, -0.09050411731004715, 0.012232556939125061, 0.47903645038604736, 0.12668102979660034, 0.06868711113929749, -0.24711361527442932, 0.270305335521698, 0.17057788372039795, -0.03343261033296585, -0.24228349328041077, -0.39627712965011597 ]
https://github.com/huggingface/datasets/issues/5878
Hey @mariosasko! Thanks for the tip here - introducing prefetch with `torchdata` didn't really give me any performance difference vs not prefetching, but the concept is definitely one that could be really beneficial. Are there any benchmarks that show the speed-up you can get with `torchdata`'s prefetch just for comparison?
Prefetching for IterableDataset
### Feature request Add support for prefetching the next n batches through iterabledataset to reduce batch loading bottleneck in training loop. ### Motivation The primary motivation behind this is to use hardware accelerators alongside a streaming dataset. This is required when you are in a low ram or low disk space setting as well as quick iteration where you're iterating though different accelerator environments (e.x changing ec2 instances quickly to figure out batch/sec for a particular architecture). Currently, using the IterableDataset results in accelerators becoming basically useless due to the massive bottleneck induced by the dataset lazy loading/transform/mapping. I've considered two alternatives: PyTorch dataloader that handles this. However, I'm using jax, and I believe this is a piece of functionality that should live in the stream class. Replicating the "num_workers" part of the PyTorch DataLoader to eagerly load batches and apply the transform so Arrow caching will automatically cache results and make them accessible. ### Your contribution I may or may not have time to do this. Currently, I've written the basic multiprocessor approach to handle the eager DataLoader for my own use case with code that's not integrated to datasets. I'd definitely see this as being the default over the regular Dataset for most people given that they wouldn't have to wait on the datasets while also not worrying about performance.
50
Prefetching for IterableDataset ### Feature request Add support for prefetching the next n batches through iterabledataset to reduce batch loading bottleneck in training loop. ### Motivation The primary motivation behind this is to use hardware accelerators alongside a streaming dataset. This is required when you are in a low ram or low disk space setting as well as quick iteration where you're iterating though different accelerator environments (e.x changing ec2 instances quickly to figure out batch/sec for a particular architecture). Currently, using the IterableDataset results in accelerators becoming basically useless due to the massive bottleneck induced by the dataset lazy loading/transform/mapping. I've considered two alternatives: PyTorch dataloader that handles this. However, I'm using jax, and I believe this is a piece of functionality that should live in the stream class. Replicating the "num_workers" part of the PyTorch DataLoader to eagerly load batches and apply the transform so Arrow caching will automatically cache results and make them accessible. ### Your contribution I may or may not have time to do this. Currently, I've written the basic multiprocessor approach to handle the eager DataLoader for my own use case with code that's not integrated to datasets. I'd definitely see this as being the default over the regular Dataset for most people given that they wouldn't have to wait on the datasets while also not worrying about performance. Hey @mariosasko! Thanks for the tip here - introducing prefetch with `torchdata` didn't really give me any performance difference vs not prefetching, but the concept is definitely one that could be really beneficial. Are there any benchmarks that show the speed-up you can get with `torchdata`'s prefetch just for comparison?
[ -0.5272353887557983, -0.14079159498214722, -0.12215772271156311, -0.365050733089447, -0.00011768192052841187, -0.034385234117507935, 0.3421747088432312, 0.260110467672348, 0.19832269847393036, 0.027485936880111694, 0.011267807334661484, 0.0798882395029068, -0.3678653836250305, 0.30892494320869446, 0.1501435935497284, 0.013629501685500145, 0.1592312753200531, 0.10157880187034607, -0.20956405997276306, 0.33219242095947266, -0.07145033776760101, -0.14202192425727844, -0.12888623774051666, -0.21765336394309998, -0.28213903307914734, 0.1769150197505951, 0.09000828117132187, 0.04516337811946869, 0.24900732934474945, -0.5590123534202576, 0.39798957109451294, 0.3396364748477936, 0.3008226752281189, 0.19464217126369476, -0.00010733178351074457, 0.01585918664932251, 0.1085362508893013, -0.011909782886505127, -0.5468985438346863, 0.11898031085729599, 0.09995388984680176, -0.1248859316110611, -0.009857513010501862, -0.16331830620765686, -0.4310755133628845, -0.28913697600364685, 0.2735394835472107, -0.7773629426956177, 0.3005286455154419, 0.056337058544158936, 0.1458302140235901, 0.072634257376194, -0.4692983031272888, -0.029911907389760017, -0.16846616566181183, 0.030062589794397354, -0.2526398301124573, -0.23232068121433258, 0.6962496638298035, 0.06657881289720535, -0.4469541013240814, 0.2901129126548767, 0.055783167481422424, 0.1104336529970169, 0.2724930942058563, -0.06975777447223663, -0.30364617705345154, -0.2141648530960083, -0.128469780087471, 0.09244789928197861, 0.2574358284473419, -0.23145081102848053, -0.4058651924133301, -0.5132214426994324, -0.20322257280349731, -0.3803059458732605, -0.06840437650680542, -0.15461699664592743, -0.1683947741985321, -0.040932465344667435, -0.13963662087917328, 0.09979352355003357, -0.09249426424503326, -0.1775907576084137, 0.24312490224838257, 0.3127845525741577, -0.013846350833773613, 0.0015330947935581207, 0.12085208296775818, -0.07406547665596008, 0.8024502992630005, -0.30072253942489624, 0.1569615751504898, 0.21633845567703247, -0.2511564791202545, -0.13046547770500183, -0.0444185771048069, -0.09112105518579483, -0.08197496086359024, 0.38162174820899963, 0.15304435789585114, 0.3425846993923187, 0.11382505297660828, -0.21164293587207794, 0.04983890801668167, -0.000008437782526016235, 0.0038793329149484634, 0.039339471608400345, 0.10703568160533905, 0.13467243313789368, 0.10610872507095337, 0.07305929809808731, 0.07446832954883575, -0.11964210867881775, 0.27396339178085327, 0.1402406543493271, -0.18299159407615662, 0.11418472975492477, -0.18713515996932983, -0.2916046977043152, -0.07061132043600082, -0.32487010955810547, 0.006149772554636002, 0.08900107443332672, -0.12108329683542252, 0.18513841927051544, -0.2029864490032196, 0.00994081050157547, -0.016967803239822388, -0.4031524658203125, -0.08812664449214935, -0.23315052688121796, -0.1864587515592575, 0.36188560724258423, 0.4141228199005127, -0.34408798813819885, 0.12841160595417023, -0.18968883156776428, 0.15610873699188232, 0.472207248210907, 0.34797340631484985, -0.136933371424675, 0.24564924836158752, 0.0965709388256073, -0.10050882399082184, 0.03535453975200653, 0.004677325487136841, 0.3087324798107147, -0.13105615973472595, 0.3317298889160156, 0.05991930142045021, -0.45834699273109436, 0.37309375405311584, 0.14408855140209198, -0.022180471569299698, -0.16766506433486938, -0.261075884103775, 0.38010644912719727, -0.09000392258167267, -0.06245564669370651, 0.07410706579685211, -0.09256699681282043, -0.2809649109840393, -0.1970047652721405, 0.21111637353897095, 0.10154798626899719, -0.08110266178846359, -0.05246051028370857, 0.05243978276848793, 0.04043648764491081, 0.2517779469490051, 0.01543925516307354, -0.31067392230033875, 0.2422647327184677, -0.09265221655368805, 0.06043162941932678, 0.05838388949632645, -0.23795711994171143, -0.23317646980285645, 0.21101394295692444, 0.08882991224527359, 0.6257123947143555, 0.020760947838425636, 0.3816327452659607, 0.3088819682598114, -0.3152003288269043, 0.19002169370651245, 0.509275496006012, -0.18637821078300476, 0.008863165974617004, -0.16799689829349518, -0.22454380989074707, 0.09293708205223083, 0.49047067761421204, 0.02028992399573326, 0.028262406587600708, -0.12558135390281677, -0.03518962860107422, 0.2069101780653, -0.19786018133163452, 0.19733551144599915, -0.06873941421508789, -0.2662407457828522, -0.14505650103092194, 0.039026860147714615, -0.22414934635162354, -0.6044522523880005, 0.34947270154953003, -0.006816372275352478, -0.205738365650177, 0.157627135515213, -0.025005687028169632, 0.09326224029064178, 0.18617114424705505, -0.06854911148548126, -0.25919774174690247, 0.04600021243095398, 0.1690664440393448, 0.028601817786693573, -0.27964043617248535, -0.3299281597137451, 0.6727178692817688, -0.14860700070858002, -0.03517322614789009, -0.1882643848657608, -0.05264690890908241, 0.17677070200443268, -0.061699654906988144, -0.053484510630369186, 0.18837013840675354, -0.23838621377944946, -0.17035987973213196, 0.01781293749809265, 0.31591176986694336, 0.2165672332048416, 0.16424015164375305, 0.06833596527576447, 0.5346837043762207, 0.18231068551540375, 0.03154706954956055, -0.02734418772161007, 0.2513629198074341, -0.004700228571891785, -0.21814632415771484, -0.23698563873767853, 0.571312665939331, -0.13861311972141266, 0.17743873596191406, -0.09441177546977997, -0.2663609981536865, 0.11233649402856827, 0.2201034128665924, -0.42921385169029236, 0.20591406524181366, 0.06373721361160278, -0.1776173859834671, 0.20932967960834503, -0.07783522456884384, -0.20395055413246155, 0.14554916322231293, 0.03327634558081627, 0.03414759784936905, -0.19901743531227112, 0.0014236422721296549, -0.15943065285682678, -0.1945471465587616, 0.12275977432727814, -0.1411030888557434, 0.31996938586235046, 0.19861136376857758, 0.1842626929283142, -0.15835322439670563, 0.07308940589427948, -0.10879289358854294, 0.27776801586151123, -0.045466259121894836, 0.26911795139312744, 0.04901011288166046, 0.013722997158765793, -0.01307108998298645, -0.0907016322016716, -0.34160786867141724, -0.17186757922172546, -0.09019333869218826, -0.06763242930173874, 0.0005645230412483215, 0.0995747372508049, -0.18489527702331543, 0.15463341772556305, -0.33608490228652954, 0.3927766978740692, -0.14583246409893036, 0.08382181078195572, 0.4668276011943817, -0.09129393845796585, 0.12937645614147186, -0.25988906621932983, 0.6665303707122803, -0.03598223626613617, -0.22824326157569885, -0.3725378215312958, 0.08141575753688812, -0.09419578313827515, 0.1344524323940277, 0.07284169644117355, -0.33340269327163696, 0.3361411392688751, 0.34166938066482544, 0.23490235209465027, -0.21688048541545868, 0.03365245461463928, -0.02756885439157486, 0.09950995445251465, 0.1862557977437973, -0.02202966809272766, -0.03132334351539612, 0.12844915688037872, -0.21313981711864471, -0.0669340193271637, -0.19075867533683777, 0.0009925886988639832, -0.2835964858531952, 0.02389632537961006, 0.08439800888299942, 0.16902776062488556, -0.1173165887594223, -0.13321219384670258, -0.29018789529800415, -0.16138982772827148, 0.12537236511707306, 0.0058844080194830894, 0.002018112689256668, -0.1072402372956276, 0.05941149592399597, 0.3830171525478363, -0.3472697138786316, 0.018268194049596786, -0.46461090445518494, 0.33393627405166626, -0.2404322773218155, -0.1760043501853943, -0.23016107082366943, -0.1806166172027588, -0.028372053056955338, 0.4614104926586151, -0.2879594564437866, 0.39136695861816406, -0.001232542097568512, 0.37121593952178955, -0.0736081525683403, -0.366458922624588, 0.32324379682540894, 0.13469713926315308, -0.10578270256519318, -0.08921047300100327, 0.034318581223487854, -0.07715420424938202, -0.2852453589439392, 0.08959570527076721, 0.2560335397720337, -0.0722595751285553, 0.12470701336860657, 1.0418121814727783, 0.13113898038864136, -0.25322943925857544, 0.23719963431358337, 0.15934379398822784, -0.011261634528636932, -0.2532312870025635, -0.19757910072803497, -0.030895890668034554, -0.2529330253601074, 0.1309034377336502, 0.17501293122768402, -0.22126984596252441, -0.3551537096500397, -0.15740907192230225, 0.2787981629371643, 0.016259290277957916, -0.00034233182668685913, 0.36209967732429504, -0.5844634175300598, 0.2484539896249771, -0.019094236195087433, 0.045312121510505676, -0.1907408982515335, -0.16814440488815308, -0.051400285214185715, -0.3809479773044586, 0.3468550443649292, -0.24324995279312134, -0.19962722063064575, 0.3837636709213257, -0.617859423160553, 0.2001684308052063, 0.20708155632019043, 0.13281603157520294, 0.11745192855596542, -0.3466073274612427, -0.09394657611846924, -0.16469578444957733, 0.45604419708251953, -0.37513262033462524, -0.21983541548252106, -0.06257890909910202, -0.1868542730808258, -0.22565360367298126, -0.1084207221865654, -0.1705918312072754, 0.4700307846069336, 0.06187751889228821, 0.415611207485199, -0.019294120371341705, -0.2935430109500885, 0.0403062142431736, -0.32566124200820923, -0.011046528816223145, -0.03784956783056259, -0.026306383311748505, 0.039400361478328705, 0.09590043872594833, 0.2613039016723633, 0.053858622908592224, 0.2553689777851105, -0.06001020967960358, -0.18256068229675293, -0.3269646167755127, 0.24645373225212097, -0.024338122457265854, -0.04170719161629677, 0.03458857908844948, 0.15963487327098846, 0.4707651436328888, 0.23934531211853027, 0.3980923593044281, 0.27871644496917725, 0.004030496813356876, -0.08065564930438995, -0.08529257029294968, 0.12330923229455948, 0.15703067183494568, 0.17467263340950012, 0.37970197200775146, 0.009031929075717926, -0.03200168162584305, 0.21367357671260834, 0.06534802913665771, -0.34644562005996704, 0.05148114264011383, 0.20086106657981873, 0.09671130031347275, -0.5811781883239746, -0.6704961061477661, 0.31858116388320923, 0.22160038352012634, -0.08907805383205414, 0.7363691329956055, -0.2782958149909973, -0.1597108691930771, 0.19272935390472412, 0.48737210035324097, 0.6968209147453308, -0.0935787782073021, 0.39117667078971863, 0.0744151771068573, -0.09726496040821075, 0.05699634924530983, -0.4667912721633911, 0.27714136242866516, -0.06874397397041321, -0.564007043838501, 0.040329962968826294, -0.15346474945545197, 0.17888721823692322, 0.2582448720932007, -0.07364203780889511, 0.06818290054798126, 0.18243393301963806, -0.05684010684490204, -0.07653942704200745, 0.013971351087093353, -0.07311617583036423, -0.46247804164886475, 0.2157030999660492, 0.1711059808731079, 0.0022064242511987686, 0.07197316735982895, -0.15722084045410156, 0.004585091024637222, 0.17907941341400146, 0.19454637169837952, -0.19577325880527496, 0.08378139138221741, -0.36974358558654785, 0.027913756668567657, -0.052473749965429306, -0.1364191472530365, 0.01825334131717682, 0.2377834916114807, 0.25143879652023315, -0.30404993891716003, -0.19555509090423584, 0.12161855399608612, 0.03165237605571747, 0.3072965443134308, -0.034547388553619385, -0.37346041202545166, 0.5035139918327332, -0.23355428874492645, 0.004905194044113159, 0.1686955988407135, -0.08727823197841644, -0.6260755062103271, 0.036839693784713745, 0.000024996697902679443, 0.30359122157096863, -0.31901898980140686, -0.1713581383228302, 0.4413164556026459, 0.010339342057704926, -0.25697430968284607, 0.12028205394744873, -0.054854489862918854, -0.02921159751713276, 0.3197632431983948, -0.21170756220817566, -0.1683710217475891, -0.13635897636413574, 0.30747857689857483, 0.19861671328544617, -0.3215811550617218, 0.38499847054481506, 0.024417981505393982, -0.218406081199646, -0.18370413780212402, -0.03809367120265961, 0.5400073528289795, -0.16121460497379303, 0.13375164568424225, -0.2098863124847412, -0.09251217544078827, 0.13499073684215546, 0.37547001242637634, 0.14145462214946747, -0.07713420689105988, -0.13013508915901184, 0.10502661019563675, -0.3559107780456543, 0.06394775956869125, 0.0025893249548971653, 0.35417312383651733, -0.07054003328084946, -0.12303861230611801, 0.1020536869764328, 0.16209524869918823, -0.36149320006370544, -0.2931249141693115, 0.15779578685760498, 0.008831420913338661, 0.0393531396985054, 0.051777102053165436, 0.36641135811805725, 0.171708881855011, 0.025939233601093292, 0.0984458401799202, -0.2832403779029846, -0.2563256621360779, -0.017160046845674515, 0.0983758345246315, -0.14855286478996277, -0.35512539744377136, -0.13965371251106262, -0.10984499752521515, -0.18728075921535492, -0.24429142475128174, 0.1420973390340805, 0.10517428815364838, -0.027917195111513138, -0.1750478744506836, 0.483757346868515, 0.17131158709526062, -0.12416968494653702, 0.046552736312150955, 0.19881173968315125, -0.02254575490951538, -0.07795971632003784, 0.16399650275707245, 0.06706961989402771, -0.2222757339477539, 0.014186296612024307, 0.07074858993291855, 0.7709524035453796, 0.25931331515312195, 0.10763990879058838, -0.32860425114631653, -0.13417555391788483, 0.15777051448822021, 0.3582668900489807, 0.26323041319847107, -0.09037792682647705, -0.2632611393928528, 0.13063053786754608, 0.2089996635913849, -0.18018943071365356, -0.12721261382102966, -0.19739072024822235, -0.020269429311156273, 0.09826409816741943, 0.1638966202735901, 0.23586517572402954, 0.3025984764099121, 0.3025381565093994, 0.046060699969530106, -0.019777609035372734, -0.4112304151058197, 0.09992432594299316, 0.0599190928041935, 0.22546997666358948, -0.13434922695159912, 0.2723821699619293, 0.13498756289482117, 0.12461239099502563, 0.3979833126068115, 0.028274737298488617, 0.7419864535331726, 0.6411508321762085, 0.11536423861980438, -0.26117008924484253, -0.32975488901138306, -0.043676335364580154, 0.11903844773769379, -0.12960606813430786, 0.26536238193511963, 0.1715264767408371, 0.19240519404411316, 0.01340898871421814, -0.3464047312736511, -0.05779915302991867, -0.10430771112442017, -0.0021192762069404125, -0.2742520570755005, 0.17175941169261932, -0.06701181828975677, -0.044503457844257355, 0.09762642532587051, -0.1442278027534485, 0.133540540933609, 0.3405352234840393, 0.03184804692864418, 0.1213458925485611, -0.09190738946199417, 0.27592357993125916, 0.05153694003820419, 0.4411962628364563, -0.00036156922578811646, 0.13444167375564575, 0.039054613560438156, -0.09839250147342682, -0.02138221077620983, 0.36324751377105713, 0.1464340090751648, 0.14838315546512604, -0.2745448052883148, 0.29605633020401, -0.18518877029418945, -0.02436612918972969, -0.07587958872318268, 0.33071276545524597, 0.18602578341960907, -0.23412087559700012, 0.3950056731700897, 0.12917488813400269, -0.09596080332994461, 0.2736101746559143, 0.12058871984481812, -0.06883227080106735, -0.32432180643081665, 0.173837810754776, 0.262198805809021, -0.09535005688667297, 0.07713181525468826, 0.08587919175624847, -0.09216682612895966, -0.040254876017570496, 0.101103775203228, -0.5578145980834961, -0.009557802230119705, 0.000512830913066864, 0.11783438175916672, 0.11529543250799179, 0.6349968910217285, 0.11454245448112488, 0.21082556247711182, -0.25252214074134827, -0.2521343231201172, -0.2445593625307083, -0.13616374135017395, -0.028888877481222153, 0.2943974733352661, -0.03467460721731186, 0.25267133116722107, 0.05660137161612511, 0.1986754834651947, -0.0632622092962265, -0.14802266657352448, -0.05071571096777916, 0.38734450936317444, -0.27432751655578613, 0.13333851099014282, 0.004440540447831154, 0.33791691064834595, -0.03813764452934265, -0.2739896774291992, 0.03795216232538223, 0.18236589431762695, 0.044733598828315735, 0.1445399522781372, -0.22899144887924194, 0.5112356543540955, -0.03228316083550453, 0.4053066670894623, -0.22233356535434723, -0.10237763822078705, 0.0051835328340530396, -0.03377099707722664, -0.27790817618370056, -0.03732829540967941, -0.14092262089252472, 0.0819353312253952, 0.29060250520706177, 0.11616560816764832, -0.2345714569091797, -0.17950575053691864, -0.15658961236476898, 0.037571851164102554, 0.21289145946502686, -0.05500143766403198, -0.25214606523513794, -0.12819409370422363, -0.18042966723442078, 0.2451866716146469, -0.027756299823522568, 0.43513691425323486, 0.02358519658446312, 0.0339897945523262, -0.37211763858795166, -0.08240662515163422, 0.20741446316242218, -0.3018268644809723, -0.07940874993801117, -0.21625448763370514, 0.01731712371110916, 0.3357386887073517, 0.16914309561252594, -0.24622714519500732, -0.09658405929803848, 0.2630443871021271, -0.1319478154182434, 0.002337999641895294, 0.48657551407814026, 0.02659827098250389, 0.011083364486694336, -0.27953314781188965, 0.27775993943214417, 0.10753042995929718, -0.013212662190198898, -0.2643650472164154, -0.315041720867157 ]
https://github.com/huggingface/datasets/issues/5877
The "exact match" deduplication will be possible when we resolve https://github.com/huggingface/datasets/issues/2514 (first, https://github.com/apache/arrow/issues/30950 needs to be addressed on the Arrow side). In the meantime, you can use Polars or DuckDB (e.g., via [datasets-sql](https://github.com/mariosasko/datasets_sql)). Fuzzy deduplication is out-of-scope for now ([splink](https://github.com/moj-analytical-services/splink) is probably the best tool for it).
Request for text deduplication feature
### Feature request It would be great if there would be support for high performance, highly scalable text deduplication algorithms as part of the datasets library. ### Motivation Motivated by this blog post https://huggingface.co/blog/dedup and this library https://github.com/google-research/deduplicate-text-datasets, but slightly frustrated by how its not very easy to work with these tools I am proposing this feature. ### Your contribution I would be happy to contribute to the development effort of this feature. would love to collaborate with others in the development effort.
47
Request for text deduplication feature ### Feature request It would be great if there would be support for high performance, highly scalable text deduplication algorithms as part of the datasets library. ### Motivation Motivated by this blog post https://huggingface.co/blog/dedup and this library https://github.com/google-research/deduplicate-text-datasets, but slightly frustrated by how its not very easy to work with these tools I am proposing this feature. ### Your contribution I would be happy to contribute to the development effort of this feature. would love to collaborate with others in the development effort. The "exact match" deduplication will be possible when we resolve https://github.com/huggingface/datasets/issues/2514 (first, https://github.com/apache/arrow/issues/30950 needs to be addressed on the Arrow side). In the meantime, you can use Polars or DuckDB (e.g., via [datasets-sql](https://github.com/mariosasko/datasets_sql)). Fuzzy deduplication is out-of-scope for now ([splink](https://github.com/moj-analytical-services/splink) is probably the best tool for it).
[ -0.19005602598190308, -0.09308367222547531, -0.15754449367523193, 0.12080073356628418, -0.07593370229005814, 0.04617947340011597, 0.04579456150531769, 0.1417374312877655, -0.07663444429636002, -0.026557214558124542, -0.22363151609897614, 0.5272765159606934, 0.1366443932056427, 0.07570071518421173, -0.06783454865217209, -0.1553116738796234, -0.05637717247009277, 0.12661589682102203, -0.0535280704498291, 0.1950875073671341, 0.26816481351852417, 0.22787483036518097, -0.14297901093959808, -0.29220038652420044, -0.04111428186297417, 0.07904361188411713, -0.2443358302116394, -0.15840469300746918, -0.2919914424419403, 0.018640384078025818, 0.08797726780176163, 0.55780029296875, -0.0009241998195648193, 0.16082727909088135, -0.00010598621156532317, -0.37666890025138855, 0.0852416381239891, 0.1319027841091156, -0.2386239618062973, -0.07659958302974701, -0.15323011577129364, 0.004811465740203857, 0.14785051345825195, 0.002996206283569336, 0.19203948974609375, 0.13734273612499237, -0.023452408611774445, -0.48451855778694153, 0.35882997512817383, 0.03593975678086281, 0.2213522046804428, 0.02878892421722412, -0.11461953073740005, 0.17628732323646545, 0.12599313259124756, 0.4302276074886322, -0.23058569431304932, 0.02402534708380699, 0.5150932669639587, -0.06390784680843353, -0.1283355951309204, 0.3795594871044159, -0.14851006865501404, 0.07762855291366577, -0.03805897384881973, 0.09476900100708008, -0.03131783381104469, -0.0003360360860824585, 0.08396413922309875, 0.392212450504303, 0.6063870787620544, -0.4532325267791748, -0.5669261813163757, -0.24921764433383942, 0.12813213467597961, -0.05104658752679825, -0.1299075186252594, -0.22622253000736237, 0.052187707275152206, 0.15489423274993896, -0.11027452349662781, -0.4242987036705017, -0.011682093143463135, -0.08978849649429321, 0.12041091918945312, -0.27959561347961426, 0.055713407695293427, -0.3220667839050293, 0.1368154138326645, -0.18411925435066223, 0.22737672924995422, -0.41065874695777893, 0.17636704444885254, 0.23551702499389648, -0.2564682066440582, -0.2646925151348114, -0.3304763734340668, -0.32641249895095825, 0.3391991853713989, 0.45533227920532227, 0.12440226972103119, 0.09285718202590942, -0.11027514189481735, 0.25817549228668213, 0.15389180183410645, 0.12031243741512299, 0.005024280399084091, -0.09185649454593658, 0.18685182929039001, -0.19253398478031158, -0.15195399522781372, -0.0721718817949295, -0.09918147325515747, -0.0010112188756465912, -0.005996301770210266, -0.11693771183490753, 0.03524630516767502, -0.4047577381134033, -0.30788111686706543, -0.09416906535625458, -0.2592182159423828, 0.030408110469579697, 0.03734085336327553, -0.16030368208885193, 0.09460696578025818, 0.17101892828941345, 0.06410808861255646, -0.08260339498519897, -0.3443593978881836, -0.22109049558639526, -0.10684780776500702, 0.02785349264740944, 0.057423464953899384, 0.03891991823911667, 0.2197820544242859, -0.24937617778778076, -0.03110434114933014, 0.01459077000617981, 0.334393173456192, -0.08098549395799637, 0.0014783293008804321, -0.16077694296836853, -0.11756588518619537, -0.3223157227039337, -0.4133719205856323, -0.17000490427017212, -0.03215789794921875, -0.015168890357017517, -0.15605734288692474, 0.0563737116754055, 0.07841676473617554, -0.03224851191043854, -0.24871228635311127, 0.25488072633743286, -0.026312794536352158, -0.3460756838321686, -0.15891946852207184, 0.8417321443557739, -0.09213518351316452, 0.11846497654914856, 0.05738779529929161, 0.07131871581077576, -0.07174277305603027, -0.04407399892807007, 0.2952062487602234, 0.5262735486030579, -0.4670359492301941, -0.1353214979171753, -0.40768441557884216, -0.05652763694524765, 0.22870738804340363, 0.21527057886123657, 0.00784483551979065, -0.05029696971178055, 0.047075651586055756, 0.35314756631851196, 0.3539024293422699, -0.10723483562469482, -0.09714128077030182, 0.4937290549278259, -0.08137880265712738, 0.0022985264658927917, 0.029672667384147644, 0.13702775537967682, 0.09388599544763565, -0.031313441693782806, 0.16970562934875488, 0.2560054659843445, -0.0791395828127861, -0.31703636050224304, -0.20506733655929565, -0.5177456140518188, 0.12090185284614563, 0.2745082676410675, 0.04553864896297455, -0.06956946849822998, 0.128653883934021, -0.1577371507883072, 0.14248180389404297, 0.0040687136352062225, 0.09413576126098633, 0.30168360471725464, 0.5611059665679932, 0.21032603085041046, 0.2274593859910965, -0.538931131362915, 0.0392732098698616, 0.021629735827445984, 0.027190208435058594, 0.06178533658385277, -0.0006656236946582794, -0.38465604186058044, 0.08052103221416473, -0.0804332047700882, -0.04119572043418884, 0.14134933054447174, 0.18571533262729645, -0.42888620495796204, 0.18970392644405365, 0.03453388810157776, -0.12341676652431488, 0.12034851312637329, -0.2812444567680359, 0.09215173125267029, -0.10726858675479889, 0.28620967268943787, 0.010615872219204903, 0.05554700642824173, 0.2631022036075592, 0.42390763759613037, -0.15479828417301178, 0.24358710646629333, -0.011900516226887703, 0.10752056539058685, -0.03329905867576599, 0.23336784541606903, 0.3799957036972046, 0.08457528054714203, 0.08020499348640442, -0.1364876627922058, 0.19765697419643402, 0.045173484832048416, 0.1517307162284851, 0.1751897931098938, -0.08187226951122284, 0.016531825065612793, -0.2524595856666565, 0.005507722496986389, 0.05946533381938934, 0.019842371344566345, 0.2262108325958252, -0.08725370466709137, 0.13668641448020935, -0.3040009140968323, 0.30812788009643555, 0.025088705122470856, 0.022204235196113586, 0.11506351083517075, -0.29132720828056335, 0.22598214447498322, 0.0031817713752388954, -0.10701985657215118, 0.12922123074531555, 0.03499768301844597, -0.1547756791114807, -0.08383932709693909, 0.18187473714351654, 0.2262936383485794, 0.2775834798812866, 0.3280896544456482, 0.14495009183883667, 0.023643581196665764, 0.04448627680540085, 0.07823242992162704, 0.3254549503326416, -0.0025559552013874054, -0.19772611558437347, 0.026066500693559647, -0.04699791967868805, 0.15935346484184265, -0.5040336847305298, -0.315722793340683, -0.0092691108584404, -0.13954982161521912, -0.0006834119558334351, -0.0968170166015625, -0.467335969209671, -0.5130622982978821, -0.3045322597026825, 0.5118284821510315, -0.2747690677642822, -0.28948378562927246, 0.38105177879333496, 0.09842349588871002, 0.05142207443714142, 0.03319426625967026, -0.05690618231892586, 0.5161030292510986, -0.06590110063552856, -0.5959272980690002, -0.20929160714149475, -0.1756979376077652, -0.2396814525127411, 0.2002255618572235, 0.14206014573574066, 0.057623740285634995, 0.3963374197483063, 0.055414557456970215, 0.19955696165561676, -0.5451172590255737, -0.6308404207229614, 0.02217966690659523, -0.10146813094615936, 0.08391004055738449, 0.13989508152008057, -0.18602769076824188, -0.06544072180986404, 0.10105063021183014, -0.21445655822753906, -0.039702437818050385, -0.3353500962257385, -0.2664210796356201, 0.17598013579845428, -0.06626922637224197, -0.3208995759487152, -0.3705023527145386, -0.005741415545344353, -0.23729480803012848, 0.46277979016304016, -0.13694679737091064, -0.037226833403110504, -0.04725134000182152, -0.03464634343981743, 0.14506320655345917, -0.03701184689998627, 0.22064834833145142, -0.3453715443611145, 0.06464707106351852, 0.30902591347694397, 0.15045304596424103, -0.06442637741565704, -0.33530330657958984, 0.0626961886882782, -0.0022657485678792, 0.1395333707332611, -0.3439056873321533, -0.1156405657529831, -0.0544426292181015, 0.049609556794166565, -0.0038162656128406525, 0.2612740695476532, 0.23225338757038116, 0.2935214042663574, -0.0639670342206955, -0.06553647667169571, -0.23213529586791992, 0.09519293904304504, 0.3460136651992798, 0.12530553340911865, 0.051161620765924454, -0.012920180335640907, 0.24706251919269562, 0.49452123045921326, 0.36598852276802063, -0.040014080703258514, 0.12652915716171265, 0.13286741077899933, 0.10369238257408142, 0.041047848761081696, -0.06556878238916397, -0.08683761954307556, -0.1649874895811081, 0.039188846945762634, 0.3288215398788452, 0.23714391887187958, -0.15456344187259674, -0.16991128027439117, -0.3192139267921448, -0.07136508077383041, -0.2911156117916107, -0.22481770813465118, -0.6342177987098694, 0.003352055326104164, -0.13304582238197327, -0.07418610155582428, -0.06810930371284485, -0.051165591925382614, 0.06164734810590744, 0.13494238257408142, 0.1322408765554428, -0.18853367865085602, -0.05779614299535751, 0.1311919391155243, -0.40508726239204407, 0.2854419946670532, 0.23434464633464813, 0.03201562166213989, 0.01054149866104126, 0.1005047932267189, -0.11564438045024872, -0.0978502407670021, 0.17259104549884796, -0.3372257947921753, -0.24321486055850983, -0.1599237322807312, -0.12887197732925415, -0.0724228098988533, 0.08585014194250107, -0.12235089391469955, 0.2077915072441101, -0.07450125366449356, -0.03510419279336929, -0.43137216567993164, -0.05813072621822357, 0.33568277955055237, 0.15481281280517578, 0.05869659036397934, -0.2358866184949875, 0.22306177020072937, -0.05486169084906578, -0.19248484075069427, -0.021226990967988968, 0.3483346104621887, 0.1009284108877182, 0.033611051738262177, 0.035544805228710175, -0.031109901145100594, 0.07786797732114792, 0.7526353597640991, -0.13397367298603058, 0.03166528791189194, -0.262990266084671, 0.3786360025405884, 0.010536663234233856, -0.02882569655776024, 0.13429298996925354, 0.33918845653533936, -0.35466253757476807, -0.42180848121643066, -0.3239749073982239, -0.12817054986953735, 0.6086967587471008, 0.11800199747085571, 0.03971040993928909, 0.47248750925064087, -0.09948689490556717, -0.17047348618507385, -0.1983153223991394, -0.15722212195396423, 0.09870024025440216, 0.27568477392196655, -0.20575779676437378, -0.34274032711982727, 0.21552294492721558, 0.20358037948608398, 0.03081633150577545, 0.7754610776901245, 0.28270086646080017, -0.19597594439983368, 0.20724347233772278, -0.13626720011234283, 0.8671392202377319, -0.07260468602180481, 0.07534821331501007, -0.6248958110809326, -0.20061463117599487, 0.46008121967315674, -0.17809244990348816, 0.20399099588394165, -0.2021673321723938, -0.04134368896484375, -0.07574322819709778, 0.04673674702644348, 0.22827722132205963, 0.18479938805103302, -0.18645848333835602, 0.280790239572525, 0.08731941878795624, 0.22757062315940857, 0.3380230963230133, 0.48728784918785095, -0.41046324372291565, -0.1405293047428131, 0.017435234040021896, 0.13231295347213745, 0.07864538580179214, -0.10549069941043854, 0.021567467600107193, -0.13308367133140564, 0.21360182762145996, 0.012760117650032043, -0.3798081874847412, -0.14006707072257996, -0.16638249158859253, 0.331000953912735, -0.009803877212107182, -0.12076182663440704, 0.6735801100730896, -0.03501303121447563, 0.15728259086608887, 0.3435419499874115, -0.21567879617214203, 0.01003294251859188, 0.0969889909029007, 0.09411796927452087, -0.001161135733127594, -0.18387019634246826, 0.13567696511745453, 0.005745992064476013, -0.1721166968345642, -0.4030310809612274, 0.26384440064430237, -0.29352593421936035, -0.11017622798681259, -0.12032483518123627, -0.10911107063293457, -0.09790283441543579, 0.21013861894607544, 0.23126137256622314, -0.22075782716274261, -0.23169885575771332, 0.1538642942905426, 0.3763471841812134, -0.25437653064727783, 0.31586599349975586, 0.09860748052597046, 0.13018551468849182, -0.14977267384529114, 0.3272715210914612, 0.057994402945041656, -0.09305848926305771, 0.05558937042951584, 0.012341469526290894, -0.3916642665863037, -0.24700723588466644, -0.2428288459777832, -0.23689168691635132, -0.23307126760482788, 0.32054877281188965, -0.48539701104164124, -0.25488486886024475, 0.1903146505355835, -0.0980362743139267, -0.081112340092659, 0.04261230677366257, -0.16643844544887543, -0.0629609003663063, -0.036374419927597046, -0.0028681904077529907, -0.1703825145959854, 0.3054540455341339, 0.2642921805381775, -0.02071770280599594, -0.3380805253982544, 0.04622747004032135, -0.362078458070755, 0.4114159345626831, 0.25634583830833435, 0.011468349024653435, -0.035619981586933136, -0.11794463545084, 0.3135625123977661, -0.011526186019182205, 0.10754898935556412, 0.4349803030490875, 0.23975634574890137, -0.24966642260551453, -0.12227537482976913, 0.09276465326547623, -0.2753932476043701, -0.0837407261133194, 0.04333580285310745, -0.036652155220508575, -0.3222387433052063, -0.18949346244335175, 0.09823627769947052, 0.09465266019105911, -0.026410993188619614, 0.1517810821533203, -0.21260881423950195, -0.3003736734390259, -0.22320982813835144, 0.003947884775698185, -0.05941848084330559, 0.24932290613651276, 0.24710139632225037, 0.06657500565052032, 0.1080494076013565, -0.030591540038585663, -0.16249655187129974, 0.2327669858932495, 0.267498642206192, -0.15367569029331207, 0.3102215528488159, 0.05602925270795822, -0.31598347425460815, 0.05123414099216461, 0.3742996156215668, 0.43674546480178833, -0.04338953644037247, -0.08387008309364319, 0.08170991390943527, 0.24641256034374237, -0.23111900687217712, -0.1915932297706604, 0.3939407765865326, -0.27154740691185, 0.17214886844158173, 0.16526827216148376, 0.3006625175476074, 0.1938788741827011, -0.1284768283367157, -0.17754751443862915, 0.2766869068145752, -0.010329317301511765, 0.074294313788414, 0.30569612979888916, 0.47542011737823486, -0.19834385812282562, -0.021175790578126907, 0.23386332392692566, 0.17032727599143982, 0.2607964873313904, -0.1614747941493988, 0.21139760315418243, -0.1276746243238449, 0.1676923930644989, 0.35882216691970825, 0.017755471169948578, 0.25894695520401, 0.31260058283805847, 0.01532411202788353, 0.28499460220336914, 0.042397454380989075, 0.3492540121078491, 0.049310628324747086, 0.0766703337430954, -0.22560346126556396, 0.09590166807174683, -0.1105932667851448, -0.19152845442295074, 0.1351078897714615, -0.22600577771663666, -0.12565724551677704, -0.15068936347961426, 0.1857714056968689, -0.25862616300582886, 0.22115032374858856, -0.13872767984867096, 0.334173321723938, -0.39255574345588684, 0.4617307782173157, 0.14593464136123657, 0.6322032809257507, -0.21176591515541077, -0.13025067746639252, 0.1780717372894287, -0.11082270741462708, 0.22354185581207275, 0.35042259097099304, 0.22290891408920288, -0.34648996591567993, -0.1936604231595993, -0.13091765344142914, -0.17371930181980133, -0.021775823086500168, 0.12941616773605347, 0.3417160212993622, -0.14835816621780396, 0.15768910944461823, 0.37412190437316895, 0.04830067977309227, 0.04366550222039223, -0.2901521921157837, 0.169786736369133, -0.19887293875217438, -0.6568528413772583, 0.3866633176803589, 0.26570507884025574, -0.002232588827610016, -0.060237396508455276, 0.14461173117160797, -0.02824028581380844, -0.4852282404899597, 0.7061254382133484, -0.08495308458805084, -0.17143744230270386, 0.008295010775327682, 0.15699483454227448, -0.05360337719321251, 0.12782445549964905, 0.5355615019798279, 0.11397860199213028, 0.02811196818947792, 0.04718482494354248, -0.3657822608947754, -0.13299474120140076, 0.13524296879768372, -0.027757801115512848, 0.09522194415330887, 0.262768030166626, 0.11429448425769806, 0.007014445960521698, -0.03471367806196213, -0.0724957287311554, 0.2308066189289093, -0.031709298491477966, -0.3482630252838135, -0.204562246799469, -0.15288394689559937, -0.2557660937309265, 0.23233523964881897, -0.1826651245355606, -0.1002713292837143, 0.008249510079622269, 0.04198407381772995, -0.16913220286369324, 0.1913922131061554, 0.2625170648097992, -0.06655199825763702, 0.028913063928484917, 0.02851869724690914, 0.19444479048252106, 0.1172456294298172, -0.29199448227882385, 0.33327436447143555, 0.255129337310791, -0.3271039128303528, 0.2595888674259186, 0.049063995480537415, -0.009301457554101944, -0.28225764632225037, -0.034147005528211594, 0.09420101344585419, 0.29830414056777954, 0.1795249581336975, -0.12685616314411163, -0.5552193522453308, -0.035109855234622955, -0.05661909654736519, 0.20548668503761292, -0.055967673659324646, 0.48551979660987854, -0.15111543238162994, 0.1729113757610321, -0.1210324689745903, -0.37420862913131714, 0.043070971965789795, -0.33974984288215637, -0.10699838399887085, -0.10515017807483673, 0.033132947981357574, 0.5829566121101379, 0.03301793336868286, -0.9297581911087036, -0.06874725222587585, 0.3224589228630066, -0.0461222305893898, 0.20346421003341675, 0.39837658405303955, 0.0027045458555221558, 0.16491998732089996, -0.17447607219219208, -0.05996764078736305, 0.02587362751364708, 0.14092624187469482, 0.25419875979423523, -0.28047746419906616 ]
https://github.com/huggingface/datasets/issues/5877
I have been using polars to remove duplicates but it would be nice to do it directly in pyarrow. For example, 1. Read dataset with pyarrow 2. Use scan_pyarrow_dataset() with Polars to create a LazyFrame 3. Use sort and unique to remove duplicates based on a subset of columns 4. Convert to table and save data with ds.write_dataset() There are times where that workflow makes perfect sense because I do additional transformations with Polars. Most of the time I am simply just reading dataset A and writing dataset B without duplicates though, and I wish I could use a pyarrow scanner or table directly.
Request for text deduplication feature
### Feature request It would be great if there would be support for high performance, highly scalable text deduplication algorithms as part of the datasets library. ### Motivation Motivated by this blog post https://huggingface.co/blog/dedup and this library https://github.com/google-research/deduplicate-text-datasets, but slightly frustrated by how its not very easy to work with these tools I am proposing this feature. ### Your contribution I would be happy to contribute to the development effort of this feature. would love to collaborate with others in the development effort.
104
Request for text deduplication feature ### Feature request It would be great if there would be support for high performance, highly scalable text deduplication algorithms as part of the datasets library. ### Motivation Motivated by this blog post https://huggingface.co/blog/dedup and this library https://github.com/google-research/deduplicate-text-datasets, but slightly frustrated by how its not very easy to work with these tools I am proposing this feature. ### Your contribution I would be happy to contribute to the development effort of this feature. would love to collaborate with others in the development effort. I have been using polars to remove duplicates but it would be nice to do it directly in pyarrow. For example, 1. Read dataset with pyarrow 2. Use scan_pyarrow_dataset() with Polars to create a LazyFrame 3. Use sort and unique to remove duplicates based on a subset of columns 4. Convert to table and save data with ds.write_dataset() There are times where that workflow makes perfect sense because I do additional transformations with Polars. Most of the time I am simply just reading dataset A and writing dataset B without duplicates though, and I wish I could use a pyarrow scanner or table directly.
[ -0.018998324871063232, -0.04216289520263672, -0.05457958206534386, 0.07354654371738434, -0.01498129591345787, 0.04807283729314804, 0.24181589484214783, 0.1446562111377716, -0.44306322932243347, 0.04932622238993645, -0.22304725646972656, 0.6511831879615784, 0.16353574395179749, 0.025632262229919434, 0.0913005918264389, -0.09376494586467743, 0.12286704778671265, 0.2541680932044983, 0.06557373702526093, 0.22197115421295166, 0.17430202662944794, 0.019298771396279335, -0.31179070472717285, -0.18310672044754028, -0.2107888013124466, 0.11953182518482208, -0.3795352578163147, -0.11211046576499939, -0.3648093640804291, -0.046372026205062866, 0.11775144934654236, 0.6214541792869568, 0.08085541427135468, 0.07431890070438385, -0.0001247312466148287, -0.15430375933647156, 0.0017098169773817062, 0.1513454020023346, -0.13798463344573975, 0.0007839947938919067, 0.07593582570552826, 0.1091485470533371, 0.3963751196861267, -0.06186385452747345, 0.29908889532089233, -0.3159911632537842, 0.1462526172399521, 0.03262220323085785, 0.3335658609867096, -0.0719769299030304, 0.05168171599507332, 0.25200432538986206, -0.02645513415336609, 0.26222357153892517, 0.4225260615348816, 0.4743305444717407, -0.21674597263336182, 0.3686094582080841, 0.6418055295944214, -0.2971063554286957, -0.08732230961322784, 0.1522902101278305, -0.23137500882148743, 0.01829500123858452, -0.004891581833362579, 0.2502221465110779, -0.04054063931107521, -0.07558877766132355, -0.01844387874007225, 0.2782708406448364, 0.5655679702758789, -0.7963202595710754, -0.604497492313385, -0.23273181915283203, 0.12386233359575272, -0.09666980803012848, -0.12332534044981003, -0.14320030808448792, -0.03629814088344574, 0.21475103497505188, -0.15194964408874512, -0.30674946308135986, -0.07587899267673492, 0.02315184846520424, 0.2065024971961975, -0.20934921503067017, 0.3107037842273712, -0.07646629214286804, 0.2073192149400711, 0.09436263144016266, 0.6527814269065857, -0.2803105413913727, 0.32415771484375, 0.34164685010910034, -0.21377484500408173, -0.17169293761253357, -0.2325552999973297, -0.34635865688323975, 0.29045170545578003, 0.46687057614326477, 0.13225015997886658, 0.05851427838206291, 0.05091080814599991, 0.2687717080116272, 0.10726431012153625, 0.11809851974248886, -0.25114214420318604, -0.08112137019634247, 0.22160539031028748, -0.2554229199886322, 0.006230287253856659, -0.04186582192778587, -0.20796003937721252, -0.00946437194943428, 0.19630059599876404, -0.11250770092010498, 0.07321490347385406, -0.2342214286327362, -0.25017884373664856, -0.3302028775215149, -0.4780922830104828, -0.17301568388938904, -0.10189536213874817, -0.09293761849403381, 0.1402210295200348, 0.04594872519373894, -0.07893965393304825, 0.015938032418489456, -0.5212607979774475, -0.17360398173332214, 0.023436229676008224, 0.18397413194179535, -0.03942963853478432, 0.018033616244792938, 0.2434447705745697, -0.1532604992389679, -0.11478400975465775, 0.19060781598091125, 0.3222298324108124, -0.09543070197105408, 0.03998371958732605, -0.293449729681015, -0.14942972362041473, -0.21419547498226166, -0.18590623140335083, -0.2215622365474701, -0.13995131850242615, -0.21145668625831604, -0.0884171798825264, 0.3682985305786133, 0.15163756906986237, -0.2328273057937622, -0.3040245771408081, 0.0279962420463562, 0.0059254467487335205, -0.2952497601509094, -0.1952943354845047, 0.5991080403327942, -0.04847231134772301, 0.043950214982032776, 0.06520549207925797, 0.08135449886322021, 0.01856679469347, -0.25199094414711, 0.1798442304134369, 0.3059197664260864, -0.624036431312561, -0.10230182111263275, -0.12147906422615051, -0.2295403778553009, 0.23879775404930115, 0.33725646138191223, -0.1904165893793106, 0.3782780170440674, 0.18111863732337952, 0.3509600758552551, 0.2869676947593689, -0.13719403743743896, -0.29129713773727417, 0.28361809253692627, -0.057017821818590164, -0.012476801872253418, 0.035982389003038406, 0.3705441951751709, 0.206767737865448, -0.0774027407169342, 0.04378092288970947, 0.24206000566482544, -0.11098356544971466, -0.3357149362564087, -0.21048671007156372, -0.6398200988769531, 0.323718786239624, 0.39185982942581177, 0.1395452916622162, -0.054129503667354584, 0.178279846906662, -0.3558783531188965, 0.2899741232395172, -0.18248918652534485, 0.00195988267660141, 0.0898127555847168, 0.6287342309951782, 0.16408252716064453, 0.24408960342407227, -0.3192015290260315, -0.06215319037437439, 0.1464727222919464, -0.25632280111312866, 0.14093732833862305, -0.10426841676235199, -0.5374565720558167, 0.20147705078125, -0.023759670555591583, -0.15149573981761932, 0.16988685727119446, -0.02950613759458065, -0.4564064145088196, 0.2395927906036377, 0.06006169319152832, -0.1844925880432129, -0.0543670579791069, -0.31097376346588135, 0.27152830362319946, 0.014916449785232544, 0.5607302188873291, 0.035389773547649384, -0.20255190134048462, 0.1503608673810959, 0.39230412244796753, -0.11973065137863159, 0.22554323077201843, 0.07851281762123108, 0.11515980958938599, -0.06933167576789856, 0.1721719205379486, 0.1000196635723114, 0.05006030201911926, 0.14386937022209167, -0.2834623157978058, 0.06304463744163513, 0.0397043377161026, 0.13821780681610107, 0.09241431951522827, -0.11443442106246948, -0.03624388575553894, -0.30220550298690796, -0.09518510103225708, 0.040730372071266174, -0.09157482534646988, -0.0053694844245910645, -0.14901608228683472, 0.28050920367240906, 0.010788843035697937, 0.20572324097156525, 0.183675616979599, 0.008922643959522247, 0.05749128758907318, -0.31018581986427307, 0.16667631268501282, 0.12541012465953827, -0.26007360219955444, 0.17348165810108185, 0.0016557342605665326, -0.08348096162080765, -0.010043799877166748, 0.169015035033226, 0.003050491213798523, 0.28210657835006714, 0.22184590995311737, 0.08205901086330414, 0.17372210323810577, 0.001156594604253769, 0.1419786810874939, 0.15649911761283875, 0.020513705909252167, -0.1213068813085556, -0.0012973463162779808, 0.0020208805799484253, 0.19039586186408997, -0.5132114291191101, -0.17513294517993927, 0.12718968093395233, 0.017002688720822334, -0.08074893802404404, -0.0418035164475441, -0.4567303955554962, -0.39919447898864746, -0.2375640869140625, 0.27005305886268616, -0.13786034286022186, -0.08813052624464035, 0.47070127725601196, 0.1490156650543213, 0.1784137487411499, 0.06967826187610626, 0.3029268980026245, 0.3042449355125427, -0.21211162209510803, -0.6804261803627014, -0.12361249327659607, -0.1482415348291397, -0.23240524530410767, 0.04796292632818222, 0.2702138423919678, 0.05855560675263405, 0.3475404679775238, 0.10367139428853989, 0.11542897671461105, -0.5370200872421265, -0.541172981262207, 0.1352025270462036, -0.18211522698402405, 0.1515076458454132, 0.08955356478691101, -0.19393287599086761, -0.08544409275054932, 0.058623574674129486, -0.1787935495376587, -0.08709195256233215, -0.32278141379356384, -0.2333284467458725, 0.08261216431856155, 0.000004537403583526611, -0.23882417380809784, -0.3258964419364929, -0.027014201506972313, -0.05922331288456917, 0.44504648447036743, -0.21121710538864136, 0.08004634827375412, -0.23663252592086792, 0.12814687192440033, 0.08779734373092651, -0.06319641321897507, 0.03641711175441742, -0.11898834258317947, 0.12575490772724152, 0.23454096913337708, 0.20309016108512878, -0.11799542605876923, -0.30654966831207275, -0.057231176644563675, 0.01201709732413292, 0.3079622685909271, -0.3228718638420105, -0.22045987844467163, 0.004984818398952484, 0.29899144172668457, 0.07136040925979614, 0.27927166223526, 0.4896642565727234, 0.37551039457321167, 0.1002034842967987, 0.05990079045295715, -0.20365096628665924, -0.1293923258781433, 0.259346604347229, 0.043245621025562286, 0.018704060465097427, -0.06392554938793182, 0.2552260160446167, 0.6535723209381104, 0.2263185679912567, 0.028805075213313103, 0.15702508389949799, -0.01929362677037716, 0.024112863466143608, 0.09225516021251678, -0.10078182816505432, -0.2612968385219574, -0.33391404151916504, 0.07561074942350388, 0.38311707973480225, 0.09091783314943314, -0.37387144565582275, -0.07920324802398682, -0.4017791152000427, -0.31333646178245544, -0.18304407596588135, -0.1308797001838684, -0.19156281650066376, 0.11241066455841064, -0.11472047865390778, -0.04088988155126572, -0.0781923308968544, -0.14783047139644623, 0.045904889702796936, 0.14004331827163696, 0.1419161558151245, -0.11703629791736603, 0.008985064923763275, -0.20408307015895844, -0.3992248475551605, 0.21437165141105652, 0.3027467727661133, -0.16335920989513397, 0.18990880250930786, 0.08935551345348358, 0.2002563178539276, -0.266328364610672, 0.3390437662601471, -0.08447792381048203, -0.33978453278541565, -0.16862261295318604, -0.13216836750507355, -0.16568434238433838, 0.018372908234596252, -0.10267085582017899, 0.16844943165779114, -0.23272716999053955, -0.09786269068717957, -0.45687687397003174, -0.09673139452934265, 0.4474189281463623, 0.24101373553276062, 0.03600521385669708, -0.3555920720100403, 0.0183270126581192, -0.3904092311859131, -0.3225914239883423, -0.020869676023721695, 0.16650304198265076, 0.12738831341266632, -0.10406830906867981, 0.0994238555431366, -0.07941591739654541, 0.10063263773918152, 0.6213347315788269, -0.04833531379699707, -0.0010084882378578186, -0.31541621685028076, 0.3023046553134918, -0.022062033414840698, -0.28178897500038147, 0.20038187503814697, 0.38863319158554077, -0.10916107892990112, -0.41205069422721863, -0.41766753792762756, -0.1930004209280014, 0.7014371156692505, 0.19088107347488403, 0.014401528984308243, 0.6043677926063538, -0.09797483682632446, -0.20238587260246277, -0.16754743456840515, -0.31492578983306885, 0.137337788939476, -0.016617819666862488, -0.32352882623672485, -0.17056474089622498, 0.2954925298690796, 0.33549320697784424, 0.043851807713508606, 0.5382421612739563, 0.1952904462814331, -0.1484369933605194, 0.1756381094455719, -0.06967762112617493, 1.0750651359558105, -0.35957005620002747, 0.25848671793937683, -0.2924807369709015, -0.20396095514297485, 0.19412338733673096, -0.3068554997444153, 0.2487569898366928, -0.30843687057495117, -0.21054741740226746, -0.21704143285751343, 0.023910626769065857, 0.24336746335029602, 0.20657239854335785, -0.11607684195041656, 0.26134979724884033, 0.24658632278442383, 0.49873292446136475, 0.41673704981803894, 0.35131320357322693, -0.2942277789115906, -0.1273898482322693, 0.04931402578949928, -0.11516313254833221, 0.14205077290534973, -0.258247047662735, 0.02326909825205803, -0.09222017228603363, 0.19790372252464294, -0.023279130458831787, -0.08696037530899048, -0.11750902235507965, -0.1522243320941925, 0.29453808069229126, 0.05671655759215355, -0.23558169603347778, 0.49193596839904785, 0.052411578595638275, 0.055663228034973145, 0.16683973371982574, -0.16316719353199005, -0.164681538939476, 0.2939327657222748, 0.13175414502620697, -0.130558043718338, -0.2570990324020386, 0.07695954293012619, 0.041118137538433075, -0.3143177032470703, -0.19161993265151978, 0.2726358473300934, -0.3126315176486969, -0.33418434858322144, 0.03126830235123634, 0.04476786032319069, -0.0601426400244236, 0.4660579562187195, 0.23466643691062927, -0.2593815326690674, -0.3610633611679077, -0.00006732949987053871, 0.27210676670074463, -0.11191423237323761, 0.566543698310852, -0.2412935495376587, 0.16555851697921753, -0.2364746779203415, 0.2760695219039917, 0.3032378554344177, 0.08469461649656296, 0.07178984582424164, 0.07326225191354752, -0.2555549740791321, -0.10872822999954224, -0.18314597010612488, -0.16982965171337128, -0.43686795234680176, 0.2046453058719635, -0.5035465955734253, 0.04999212920665741, 0.1062379851937294, -0.034864842891693115, -0.05453924462199211, 0.02389775775372982, -0.2889731824398041, 0.016111060976982117, -0.12403345108032227, 0.1790097951889038, 0.2501257359981537, 0.2607995867729187, 0.3532220423221588, 0.3713652193546295, -0.17981290817260742, -0.04296526312828064, -0.1634412556886673, 0.4851301312446594, 0.23305600881576538, 0.12711718678474426, -0.14444732666015625, -0.06811611354351044, 0.17181049287319183, -0.026397356763482094, -0.01368090882897377, 0.387248158454895, 0.4076860249042511, -0.08675962686538696, -0.09293068945407867, 0.21229445934295654, -0.15353910624980927, -0.010135456919670105, 0.13058927655220032, 0.01672270894050598, -0.12340523302555084, -0.1382654756307602, 0.29487818479537964, 0.11678610742092133, -0.05561649799346924, 0.024524133652448654, 0.09039446711540222, -0.24100497364997864, -0.372093141078949, -0.027041297405958176, -0.21060185134410858, 0.3300494849681854, 0.34930285811424255, 0.048044320195913315, 0.12292204797267914, 0.040619492530822754, -0.1545833945274353, 0.16066789627075195, 0.43340930342674255, -0.3255760073661804, 0.189424529671669, -0.035911109298467636, -0.304794043302536, -0.30349981784820557, 0.423015832901001, 0.31304049491882324, -0.023771952837705612, -0.10278207808732986, 0.27264589071273804, 0.0023105540312826633, -0.21254900097846985, -0.3207864761352539, 0.29452016949653625, -0.35573887825012207, 0.07734589278697968, 0.3341412842273712, 0.2695040702819824, 0.3044063150882721, -0.23194238543510437, -0.19647274911403656, 0.22207459807395935, 0.0645507276058197, -0.148018479347229, 0.37070754170417786, 0.30970287322998047, -0.18564164638519287, 0.005993472412228584, 0.13348352909088135, -0.023627933114767075, 0.14469605684280396, -0.28160372376441956, 0.3281305432319641, -0.39158371090888977, 0.1510758399963379, 0.3828563690185547, -0.04343750700354576, 0.062323905527591705, 0.2105056196451187, 0.21356737613677979, 0.025704506784677505, -0.02759307622909546, 0.5143497586250305, 0.3810462951660156, 0.1940571367740631, -0.1502789855003357, 0.3661104142665863, 0.0010230597108602524, -0.15826475620269775, 0.09126721322536469, -0.10903386026620865, -0.09949643909931183, -0.007583975791931152, 0.10613305121660233, -0.40882304310798645, 0.25325271487236023, -0.0013102665543556213, 0.3330175280570984, -0.3565102219581604, 0.6195820569992065, 0.14312270283699036, 0.5438554286956787, -0.19905173778533936, -0.18604625761508942, 0.23237387835979462, -0.11657887697219849, 0.07015213370323181, 0.2752615511417389, 0.20622378587722778, -0.29064780473709106, -0.33718377351760864, -0.16154175996780396, -0.38589513301849365, 0.04536142945289612, 0.15017487108707428, 0.20304521918296814, -0.08295966684818268, 0.4344986379146576, 0.2254456877708435, -0.10219747573137283, 0.09057608246803284, -0.2734878361225128, 0.21785487234592438, -0.18076930940151215, -0.6756933331489563, 0.37090417742729187, 0.37259531021118164, -0.2328854203224182, 0.11055154353380203, 0.1671522855758667, -0.13020285964012146, -0.21656419336795807, 0.7412141561508179, 0.042996861040592194, -0.21805675327777863, 0.05717237666249275, 0.011120293289422989, -0.007395489141345024, 0.1508028507232666, 0.6613874435424805, 0.3698849380016327, -0.14586234092712402, 0.06265617907047272, -0.28600019216537476, -0.09783390164375305, -0.19706100225448608, -0.07243554294109344, 0.2500748634338379, 0.24511325359344482, -0.000015273690223693848, 0.19345742464065552, 0.018892411142587662, -0.05445098131895065, 0.10071035474538803, 0.16211652755737305, -0.2744646668434143, -0.10607263445854187, -0.2152387946844101, -0.301625519990921, 0.0290498286485672, -0.31054121255874634, 0.020682012662291527, -0.10080916434526443, -0.12596167623996735, -0.24974730610847473, 0.1557348072528839, 0.36488744616508484, 0.08970406651496887, 0.19770590960979462, -0.11387409269809723, 0.20621055364608765, 0.27789002656936646, -0.18864396214485168, 0.3398096561431885, 0.3505573868751526, -0.31058382987976074, 0.3171922266483307, 0.08822736144065857, -0.06157759577035904, -0.24811521172523499, -0.027261892333626747, 0.0456651896238327, 0.24447636306285858, 0.12063400447368622, -0.025531958788633347, -0.36195552349090576, -0.041033633053302765, -0.0476265512406826, 0.21255695819854736, -0.15358373522758484, 0.403397798538208, -0.13598917424678802, 0.22276760637760162, -0.30401885509490967, -0.3636336028575897, 0.13017675280570984, -0.5854960083961487, -0.061789870262145996, -0.08311734348535538, -0.05113261193037033, 0.26176801323890686, -0.0017587486654520035, -0.7239048480987549, -0.027177460491657257, 0.35748112201690674, 0.05919180437922478, 0.14016193151474, 0.437797874212265, 0.06205015257000923, 0.1562054455280304, -0.127833291888237, -0.20809413492679596, -0.05488128960132599, 0.12645594775676727, 0.10796964168548584, -0.4235040247440338 ]
https://github.com/huggingface/datasets/issues/5877
Hi see this new release from hf [datatrove](https://github.com/huggingface/datatrove) DataTrove is a library to process, filter and deduplicate text data at a very large scale. It provides a set of prebuilt commonly used processing blocks with a framework to easily add custom functionality
Request for text deduplication feature
### Feature request It would be great if there would be support for high performance, highly scalable text deduplication algorithms as part of the datasets library. ### Motivation Motivated by this blog post https://huggingface.co/blog/dedup and this library https://github.com/google-research/deduplicate-text-datasets, but slightly frustrated by how its not very easy to work with these tools I am proposing this feature. ### Your contribution I would be happy to contribute to the development effort of this feature. would love to collaborate with others in the development effort.
42
Request for text deduplication feature ### Feature request It would be great if there would be support for high performance, highly scalable text deduplication algorithms as part of the datasets library. ### Motivation Motivated by this blog post https://huggingface.co/blog/dedup and this library https://github.com/google-research/deduplicate-text-datasets, but slightly frustrated by how its not very easy to work with these tools I am proposing this feature. ### Your contribution I would be happy to contribute to the development effort of this feature. would love to collaborate with others in the development effort. Hi see this new release from hf [datatrove](https://github.com/huggingface/datatrove) DataTrove is a library to process, filter and deduplicate text data at a very large scale. It provides a set of prebuilt commonly used processing blocks with a framework to easily add custom functionality
[ 0.017037756741046906, -0.034986838698387146, -0.19809168577194214, 0.0182168111205101, -0.09988635778427124, -0.04359694570302963, 0.08050928264856339, 0.1296909600496292, -0.1064215674996376, -0.016252078115940094, -0.06651753187179565, 0.40503963828086853, 0.023526210337877274, 0.24817156791687012, 0.04843921959400177, -0.14630688726902008, -0.006739895790815353, 0.09627518057823181, -0.005777925252914429, 0.1424415558576584, 0.2791028618812561, 0.12899288535118103, -0.2776529788970947, -0.18266186118125916, 0.00848429650068283, 0.15690837800502777, -0.1443077027797699, -0.21542103588581085, -0.31847840547561646, -0.019722983241081238, 0.02682597190141678, 0.6272163987159729, -0.022152505815029144, 0.14072026312351227, -0.00011198387801414356, -0.2655324935913086, 0.03856664150953293, 0.09720899164676666, -0.2607746720314026, 0.04994284361600876, -0.09828606992959976, -0.07158294320106506, 0.029243603348731995, 0.03976987302303314, 0.19736933708190918, 0.004085037857294083, -0.04408086836338043, -0.36446383595466614, 0.3156786561012268, -0.01254069060087204, 0.1901477873325348, 0.009193114936351776, -0.11515140533447266, 0.1896580010652542, 0.1262519359588623, 0.7260593771934509, -0.3217843472957611, -0.0704735815525055, 0.6995437145233154, -0.14453977346420288, -0.15299731492996216, 0.2790081799030304, -0.07027135044336319, -0.08795832097530365, 0.07841847091913223, -0.06506595760583878, -0.1270805150270462, -0.13318806886672974, 0.030681457370519638, 0.36064642667770386, 0.6955794095993042, -0.4332738518714905, -0.45559757947921753, -0.17350128293037415, 0.09750593453645706, 0.12847796082496643, -0.1350489854812622, -0.3436734974384308, 0.022171713411808014, 0.23883984982967377, 0.03369296342134476, -0.570301353931427, -0.01787348836660385, -0.08088944852352142, 0.31830108165740967, -0.16485384106636047, 0.03667552396655083, -0.2665439546108246, 0.15441446006298065, -0.07396405935287476, 0.21136026084423065, -0.4035167992115021, 0.31822970509529114, 0.29907822608947754, -0.023663800209760666, -0.24113965034484863, -0.11402866989374161, -0.4077622890472412, 0.325964093208313, 0.39538827538490295, 0.05828266218304634, 0.048136573284864426, -0.15188804268836975, 0.17342346906661987, 0.05726955831050873, 0.0145314522087574, -0.07635785639286041, -0.18707825243473053, 0.35943809151649475, -0.08922116458415985, -0.11149834096431732, -0.047801997512578964, -0.060509275645017624, 0.06175974756479263, -0.15604594349861145, -0.035126201808452606, 0.019729606807231903, -0.39051732420921326, -0.2977505326271057, -0.06837332248687744, -0.22413276135921478, -0.11651337891817093, 0.1383051872253418, -0.23261943459510803, 0.22544914484024048, 0.22249546647071838, 0.05576141178607941, -0.16076305508613586, -0.37944304943084717, -0.3797283172607422, -0.1375104784965515, -0.04612908512353897, -0.05634087324142456, 0.08935565501451492, 0.20979104936122894, -0.154048353433609, -0.2041039615869522, 0.07733000069856644, 0.2504214644432068, -0.19769355654716492, -0.004631694406270981, -0.18389573693275452, -0.12383606284856796, -0.3429724872112274, -0.4098294675350189, -0.2111876904964447, 0.037553008645772934, -0.10128935426473618, -0.09620069712400436, 0.17405077815055847, -0.02374275028705597, -0.13217176496982574, -0.2943495512008667, 0.18972408771514893, 0.034442298114299774, -0.25731635093688965, -0.28223302960395813, 0.847571074962616, -0.14231248199939728, -0.04549545422196388, 0.06786181777715683, 0.15616139769554138, 0.08897347748279572, -0.06211027875542641, 0.20138493180274963, 0.36669304966926575, -0.5404142737388611, -0.21350052952766418, -0.3962758481502533, -0.22874397039413452, 0.26907286047935486, 0.13394519686698914, -0.0734105184674263, 0.21955391764640808, 0.09940020740032196, 0.3628472685813904, 0.49332350492477417, -0.0947866290807724, -0.10689427703619003, 0.5460630059242249, -0.060107067227363586, -0.0518202967941761, 0.024590203538537025, 0.10167586803436279, 0.13813576102256775, -0.07516109943389893, -0.06803590059280396, 0.36371633410453796, 0.011385461315512657, -0.39087340235710144, -0.2028389275074005, -0.5125027894973755, 0.2545293867588043, 0.2821803689002991, 0.13436563313007355, 0.03574170917272568, 0.21525397896766663, -0.17320889234542847, 0.30575159192085266, -0.0998411476612091, 0.17943981289863586, 0.28812459111213684, 0.6818403005599976, 0.28701189160346985, 0.2536410391330719, -0.4232170283794403, 0.3051610291004181, -0.07793055474758148, 0.09436793625354767, -0.080079585313797, 0.17579317092895508, -0.40572428703308105, 0.07701539993286133, -0.0653437152504921, -0.09375755488872528, 0.06070220470428467, 0.14378316700458527, -0.30355769395828247, 0.11105868965387344, 0.09701918065547943, -0.08633705973625183, -0.00011236034333705902, -0.24737653136253357, 0.03620654344558716, -0.0929235965013504, 0.43582409620285034, 0.10094194859266281, 0.036916445940732956, 0.05286194384098053, 0.4776422381401062, -0.19653628766536713, 0.2252933233976364, -0.051866546273231506, -0.05811785161495209, 0.06645917892456055, 0.05662529915571213, 0.29334574937820435, 0.1284802109003067, 0.09111253917217255, -0.20074766874313354, 0.24802371859550476, 0.10165645182132721, 0.15583209693431854, 0.016331747174263, 0.06977486610412598, -0.06087416410446167, -0.31777116656303406, -0.005070678889751434, 0.0891318991780281, -0.02008269727230072, 0.16318921744823456, -0.08748456090688705, 0.15381024777889252, -0.23361197113990784, 0.1529022455215454, -0.0011900495737791061, 0.07413376867771149, 0.04158198833465576, -0.13575468957424164, 0.1426256000995636, 0.16173630952835083, -0.08929361402988434, 0.052191369235515594, 0.18610185384750366, -0.06463772058486938, -0.09552188217639923, 0.16123048961162567, 0.03994147479534149, 0.30476653575897217, 0.21506370604038239, 0.04895688593387604, 0.01420442946255207, 0.1525575816631317, 0.062454838305711746, 0.2027425318956375, -0.15376965701580048, -0.136106476187706, 0.10963340103626251, -0.08214534819126129, 0.16142404079437256, -0.4356266260147095, -0.4670659303665161, 0.0690922811627388, -0.12404362112283707, 0.037302978336811066, -0.15735146403312683, -0.49351584911346436, -0.49100461602211, -0.1911117434501648, 0.46047472953796387, -0.177158385515213, -0.18991339206695557, 0.31704428791999817, 0.05037342384457588, 0.07073335349559784, -0.012876180931925774, -0.05419083684682846, 0.5243561267852783, -0.20893892645835876, -0.4344993233680725, -0.07093483209609985, 0.08841270208358765, -0.18726861476898193, 0.14788863062858582, 0.18534323573112488, 0.19780878722667694, 0.33319026231765747, 0.22629867494106293, 0.1372850090265274, -0.47170326113700867, -0.6272386312484741, 0.0688289999961853, -0.16306087374687195, 0.04397643357515335, 0.11157438158988953, -0.25043272972106934, 0.0021974295377731323, 0.10331684350967407, -0.20883898437023163, -0.06491975486278534, -0.36087560653686523, -0.33306366205215454, 0.23155978322029114, -0.05389532819390297, -0.3219238817691803, -0.19380506873130798, -0.11682785302400589, -0.22148731350898743, 0.47953125834465027, -0.2663590610027313, -0.018031764775514603, 0.001396622508764267, -0.0396878644824028, 0.17818322777748108, 0.3010639548301697, 0.19591470062732697, -0.3225380480289459, 0.13339701294898987, 0.1034916341304779, -0.004606533795595169, -0.05113860219717026, -0.3671906590461731, 0.007773950695991516, -0.03680955618619919, 0.07204900681972504, -0.5377392172813416, -0.0491144061088562, -0.06516886502504349, 0.11197394877672195, -0.18372729420661926, 0.2974148988723755, 0.28515663743019104, 0.20694676041603088, 0.026774104684591293, -0.08955726027488708, -0.3368847668170929, 0.05133943259716034, 0.3221939206123352, 0.11463958024978638, 0.03093608096241951, 0.07815641909837723, 0.22645655274391174, 0.4880031645298004, 0.39476656913757324, 0.13824662566184998, 0.35903745889663696, 0.2991654574871063, 0.06592190265655518, 0.09519282728433609, -0.15734508633613586, 0.01980060338973999, -0.18460704386234283, -0.020301036536693573, 0.2936503291130066, 0.11480540782213211, -0.2383212447166443, -0.11821592599153519, -0.4440087676048279, 0.04737342149019241, -0.2175857275724411, -0.16022101044654846, -0.49081695079803467, 0.17467539012432098, -0.1326572299003601, -0.018596485257148743, -0.19473716616630554, -0.03302052617073059, 0.00614573061466217, 0.14119142293930054, 0.23434790968894958, -0.16546040773391724, 0.02458425611257553, -0.02542269416153431, -0.36955955624580383, 0.2192162573337555, 0.25548112392425537, 0.0035676397383213043, -0.043655432760715485, 0.11382965743541718, 0.009645134210586548, -0.10416583716869354, 0.10702940821647644, -0.38583606481552124, -0.30338814854621887, 0.020084701478481293, -0.10097403079271317, 0.1845342069864273, 0.04543094336986542, -0.04913501814007759, 0.2716936469078064, -0.01454886607825756, -0.03432106599211693, -0.41100871562957764, -0.2093738317489624, 0.3481370806694031, 0.13117878139019012, 0.08891602605581284, -0.33682164549827576, 0.23579183220863342, -0.20469045639038086, -0.2597218155860901, -0.061283376067876816, 0.23449990153312683, 0.14549961686134338, -0.10113142430782318, -0.08338416367769241, -0.03268841654062271, 0.02804272621870041, 0.6734150648117065, -0.11415600776672363, -0.09195233881473541, -0.18836955726146698, 0.31210505962371826, -0.20709244906902313, -0.08542220294475555, 0.14760154485702515, 0.282894104719162, -0.23738214373588562, -0.275939017534256, -0.17473545670509338, -0.17690621316432953, 0.7044100165367126, 0.16441868245601654, 0.0299181267619133, 0.7126716375350952, 0.006260961294174194, -0.028630610555410385, -0.3619809150695801, -0.18465058505535126, 0.14084592461585999, 0.11088153719902039, -0.3672935366630554, -0.2807289958000183, 0.10094957798719406, 0.1762486696243286, 0.03902396559715271, 0.7447733879089355, 0.26945921778678894, -0.20960693061351776, 0.09891964495182037, -0.1350061297416687, 0.9926199316978455, -0.028838712722063065, 0.12008513510227203, -0.553152859210968, -0.05317247286438942, 0.07227879017591476, -0.19048354029655457, 0.19453413784503937, -0.20784255862236023, -0.40115904808044434, -0.14320415258407593, 0.06614970415830612, 0.2717312276363373, 0.17928507924079895, -0.24290040135383606, 0.2131688892841339, 0.18805058300495148, 0.30143672227859497, 0.32943499088287354, 0.5317455530166626, -0.31595879793167114, -0.20884689688682556, 0.08001501858234406, 0.10085081309080124, 0.016492700204253197, -0.17049215734004974, -0.024032948538661003, -0.22248750925064087, 0.3298395276069641, 0.08718684315681458, -0.47544676065444946, -0.12927734851837158, -0.14064115285873413, 0.4320574998855591, 0.04582503065466881, -0.1089327484369278, 0.8168732523918152, -0.20257440209388733, 0.1271829903125763, 0.5380013585090637, -0.16155943274497986, -0.10747189819812775, 0.09134480357170105, 0.1282730996608734, -0.14684468507766724, -0.09229660779237747, 0.257597953081131, -0.041314247995615005, -0.2610679268836975, -0.3055599629878998, 0.28414636850357056, -0.45855268836021423, -0.1723860204219818, -0.11093120276927948, -0.2012512981891632, -0.23893003165721893, 0.2147175669670105, 0.4348128139972687, -0.22302553057670593, -0.27695050835609436, 0.11809349805116653, 0.41033950448036194, -0.25776562094688416, 0.42574208974838257, 0.05271037667989731, 0.14183162152767181, -0.20263227820396423, 0.24343934655189514, 0.17467504739761353, -0.17158561944961548, 0.08328478038311005, 0.0075613632798194885, -0.35907334089279175, -0.25556179881095886, -0.098245769739151, -0.22498881816864014, -0.12301909178495407, 0.2933286130428314, -0.5035054087638855, -0.24577218294143677, 0.18806540966033936, -0.15768802165985107, -0.14563551545143127, 0.1381109654903412, -0.3025929033756256, -0.08412252366542816, -0.11688337475061417, 0.06082911789417267, -0.24375802278518677, 0.11649171262979507, 0.0829508900642395, 0.2610466778278351, -0.37620237469673157, 0.032192133367061615, -0.3083745837211609, 0.40599745512008667, 0.2712533175945282, -0.004336010664701462, -0.03952668234705925, -0.1888502538204193, 0.07165325433015823, -0.00836322084069252, 0.06025450676679611, 0.48869967460632324, 0.31994298100471497, -0.1817626953125, -0.09447300434112549, 0.14098036289215088, -0.15020114183425903, -0.06483194231987, 0.001957543194293976, -0.04876416176557541, -0.3703553378582001, -0.15892206132411957, 0.11320993304252625, -0.06456063687801361, 0.01926523447036743, 0.10427452623844147, -0.2790592610836029, -0.15679126977920532, -0.12147141993045807, 0.007512865588068962, 0.007140077650547028, 0.31545373797416687, 0.2137645184993744, 0.04643458500504494, 0.3094480037689209, 0.008862107992172241, -0.5389964580535889, 0.29924148321151733, 0.4408046305179596, -0.08672378957271576, 0.32565200328826904, 0.03155739605426788, -0.2923152446746826, 0.04115600883960724, 0.29235124588012695, 0.41886988282203674, 0.04968201741576195, 0.08141274750232697, 0.2347446084022522, 0.17775677144527435, -0.11670026928186417, -0.13697144389152527, 0.42067551612854004, -0.3313854932785034, 0.06732316315174103, 0.2059081494808197, 0.2913195788860321, 0.39341598749160767, 0.04450927674770355, -0.15075372159481049, 0.00209663063287735, 0.09461592137813568, 0.05532613769173622, 0.38937410712242126, 0.4272722005844116, -0.14304879307746887, -0.08541098982095718, 0.20926286280155182, 0.1072513610124588, 0.1968519538640976, -0.13739287853240967, 0.22976426780223846, -0.0327192023396492, 0.2323611080646515, 0.29504793882369995, -0.1340215653181076, 0.07170255482196808, 0.20222002267837524, 0.03919744864106178, 0.3346083462238312, -0.129498690366745, 0.11886873841285706, 0.01026155799627304, 0.016817402094602585, -0.24348193407058716, 0.25814691185951233, -0.13269759714603424, -0.0862216055393219, 0.2576420307159424, -0.0205218642950058, -0.3377416729927063, -0.11667798459529877, 0.18181423842906952, -0.10005082935094833, 0.1163986399769783, -0.28470578789711, 0.30559831857681274, -0.43627604842185974, 0.6200500130653381, 0.08171169459819794, 0.7487855553627014, -0.15154746174812317, -0.08493541181087494, 0.004270497709512711, 0.01672111265361309, 0.11926816403865814, 0.27209675312042236, 0.07796400785446167, -0.2293993979692459, -0.28779104351997375, -0.25036248564720154, -0.22607038915157318, -0.03283924236893654, 0.10888346284627914, 0.43607455492019653, -0.03441346809267998, 0.4057767391204834, 0.29695969820022583, -0.024984486401081085, 0.08788688480854034, -0.3290422856807709, 0.19120413064956665, -0.16111376881599426, -0.7100380063056946, 0.5013904571533203, 0.3906491994857788, 0.001188434660434723, -0.05737045407295227, 0.09124624729156494, -0.10922998189926147, -0.2960782051086426, 0.7701777219772339, -0.12535065412521362, -0.09176361560821533, -0.08336582779884338, 0.09435706585645676, -0.1555442363023758, 0.0430104099214077, 0.5078733563423157, 0.13792085647583008, 0.033626019954681396, -0.00451388955116272, -0.2726018726825714, -0.12612134218215942, 0.11420810222625732, -0.22869229316711426, 0.07541665434837341, 0.19540071487426758, 0.1918925642967224, -0.08677138388156891, 0.0031448528170585632, -0.18246769905090332, 0.31288161873817444, -0.005334008485078812, -0.2725452780723572, -0.05662507191300392, -0.2022414207458496, -0.13492168486118317, 0.14067040383815765, -0.1613873988389969, -0.026181507855653763, 0.24061286449432373, -0.04093796759843826, -0.24118128418922424, 0.11400078982114792, 0.2316145896911621, 0.13082313537597656, 0.12162921577692032, 0.024647103622555733, 0.10402722656726837, 0.01753133535385132, -0.30603957176208496, 0.20470330119132996, 0.22262504696846008, -0.23035405576229095, 0.33589696884155273, 0.10394904017448425, 0.01467527449131012, -0.2113398164510727, 0.10537843406200409, 0.03734077140688896, 0.3582035005092621, 0.18353521823883057, 0.10279392451047897, -0.44725683331489563, -0.05788574367761612, -0.09691110998392105, 0.08673833310604095, 0.11033622920513153, 0.5061014890670776, -0.15131598711013794, 0.20136769115924835, -0.13719874620437622, -0.31297287344932556, 0.016331076622009277, -0.22677630186080933, -0.21806904673576355, -0.11610707640647888, 0.06659819185733795, 0.4692865014076233, -0.01769479177892208, -0.9069606065750122, -0.11443200707435608, 0.31581392884254456, -0.013123907148838043, 0.22139105200767517, 0.49303868412971497, 0.0013920515775680542, 0.10683759301900864, -0.11782088875770569, -0.16334496438503265, -0.09885326027870178, 0.09766798466444016, 0.3141951560974121, -0.205270916223526 ]
https://github.com/huggingface/datasets/issues/5876
Indeed, `clobber=True` (with a warning if the existing protocol will be overwritten) should fix the issue, but maybe a better solution is to register our compression filesystem before the script is executed and unregister them afterward. WDYT @lhoestq @albertvillanova?
Incompatibility with DataLab
### Describe the bug Hello, I am currently working on a project where both [DataLab](https://github.com/ExpressAI/DataLab) and [datasets](https://github.com/huggingface/datasets) are subdependencies. I noticed that I cannot import both libraries, as they both register FileSystems in `fsspec`, expecting the FileSystems not being registered before. When running the code below, I get the following error: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\Bened\anaconda3\envs\ner-eval-dashboard2\lib\site-packages\datalabs\__init__.py", line 28, in <module> from datalabs.arrow_dataset import concatenate_datasets, Dataset File "C:\Users\Bened\anaconda3\envs\ner-eval-dashboard2\lib\site-packages\datalabs\arrow_dataset.py", line 60, in <module> from datalabs.arrow_writer import ArrowWriter, OptimizedTypedSequence File "C:\Users\Bened\anaconda3\envs\ner-eval-dashboard2\lib\site-packages\datalabs\arrow_writer.py", line 28, in <module> from datalabs.features import ( File "C:\Users\Bened\anaconda3\envs\ner-eval-dashboard2\lib\site-packages\datalabs\features\__init__.py", line 2, in <module> from datalabs.features.audio import Audio File "C:\Users\Bened\anaconda3\envs\ner-eval-dashboard2\lib\site-packages\datalabs\features\audio.py", line 21, in <module> from datalabs.utils.streaming_download_manager import xopen File "C:\Users\Bened\anaconda3\envs\ner-eval-dashboard2\lib\site-packages\datalabs\utils\streaming_download_manager.py", line 16, in <module> from datalabs.filesystems import COMPRESSION_FILESYSTEMS File "C:\Users\Bened\anaconda3\envs\ner-eval-dashboard2\lib\site-packages\datalabs\filesystems\__init__.py", line 37, in <module> fsspec.register_implementation(fs_class.protocol, fs_class) File "C:\Users\Bened\anaconda3\envs\ner-eval-dashboard2\lib\site-packages\fsspec\registry.py", line 51, in register_implementation raise ValueError( ValueError: Name (bz2) already in the registry and clobber is False ``` I think as simple solution would be to just set `clobber=True` in https://github.com/huggingface/datasets/blob/main/src/datasets/filesystems/__init__.py#L28. This allows the register to discard previous registrations. This should work, as the datalabs FileSystems are copies of the datasets FileSystems. However, I don't know if it is guaranteed to be compatible with other libraries that might use the same protocols. I am linking the symmetric issue on [DataLab](https://github.com/ExpressAI/DataLab/issues/425) as ideally the issue is solved in both libraries the same way. Otherwise, it could lead to different behaviors depending on which library gets imported first. ### Steps to reproduce the bug 1. Run `pip install datalabs==0.4.15 datasets==2.12.0` 2. Run the following python code: ``` import datalabs import datasets ``` ### Expected behavior It should be possible to import both libraries without getting a Value Error ### Environment info datalabs==0.4.15 datasets==2.12.0
39
Incompatibility with DataLab ### Describe the bug Hello, I am currently working on a project where both [DataLab](https://github.com/ExpressAI/DataLab) and [datasets](https://github.com/huggingface/datasets) are subdependencies. I noticed that I cannot import both libraries, as they both register FileSystems in `fsspec`, expecting the FileSystems not being registered before. When running the code below, I get the following error: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\Bened\anaconda3\envs\ner-eval-dashboard2\lib\site-packages\datalabs\__init__.py", line 28, in <module> from datalabs.arrow_dataset import concatenate_datasets, Dataset File "C:\Users\Bened\anaconda3\envs\ner-eval-dashboard2\lib\site-packages\datalabs\arrow_dataset.py", line 60, in <module> from datalabs.arrow_writer import ArrowWriter, OptimizedTypedSequence File "C:\Users\Bened\anaconda3\envs\ner-eval-dashboard2\lib\site-packages\datalabs\arrow_writer.py", line 28, in <module> from datalabs.features import ( File "C:\Users\Bened\anaconda3\envs\ner-eval-dashboard2\lib\site-packages\datalabs\features\__init__.py", line 2, in <module> from datalabs.features.audio import Audio File "C:\Users\Bened\anaconda3\envs\ner-eval-dashboard2\lib\site-packages\datalabs\features\audio.py", line 21, in <module> from datalabs.utils.streaming_download_manager import xopen File "C:\Users\Bened\anaconda3\envs\ner-eval-dashboard2\lib\site-packages\datalabs\utils\streaming_download_manager.py", line 16, in <module> from datalabs.filesystems import COMPRESSION_FILESYSTEMS File "C:\Users\Bened\anaconda3\envs\ner-eval-dashboard2\lib\site-packages\datalabs\filesystems\__init__.py", line 37, in <module> fsspec.register_implementation(fs_class.protocol, fs_class) File "C:\Users\Bened\anaconda3\envs\ner-eval-dashboard2\lib\site-packages\fsspec\registry.py", line 51, in register_implementation raise ValueError( ValueError: Name (bz2) already in the registry and clobber is False ``` I think as simple solution would be to just set `clobber=True` in https://github.com/huggingface/datasets/blob/main/src/datasets/filesystems/__init__.py#L28. This allows the register to discard previous registrations. This should work, as the datalabs FileSystems are copies of the datasets FileSystems. However, I don't know if it is guaranteed to be compatible with other libraries that might use the same protocols. I am linking the symmetric issue on [DataLab](https://github.com/ExpressAI/DataLab/issues/425) as ideally the issue is solved in both libraries the same way. Otherwise, it could lead to different behaviors depending on which library gets imported first. ### Steps to reproduce the bug 1. Run `pip install datalabs==0.4.15 datasets==2.12.0` 2. Run the following python code: ``` import datalabs import datasets ``` ### Expected behavior It should be possible to import both libraries without getting a Value Error ### Environment info datalabs==0.4.15 datasets==2.12.0 Indeed, `clobber=True` (with a warning if the existing protocol will be overwritten) should fix the issue, but maybe a better solution is to register our compression filesystem before the script is executed and unregister them afterward. WDYT @lhoestq @albertvillanova?
[ -0.32871371507644653, 0.2323617786169052, -0.10847318172454834, 0.27989068627357483, 0.27650871872901917, 0.12257921695709229, 0.1858045905828476, 0.03771381080150604, 0.12055659294128418, 0.1787029206752777, -0.2229849100112915, 0.1549004316329956, 0.057372260838747025, 0.08281157165765762, -0.24419866502285004, 0.2410188615322113, 0.19221681356430054, 0.2473473697900772, -0.554028332233429, -0.06259463727474213, -0.08865183591842651, 0.2679033875465393, -0.388602614402771, -0.05451994016766548, -0.20932254195213318, 0.007095841690897942, 0.02308424562215805, 0.17299756407737732, -0.39302095770835876, -0.4484950304031372, 0.5750887989997864, -0.004701255355030298, 0.08315065503120422, 0.4362312853336334, -0.0001147194197983481, 0.0553102046251297, 0.2985917329788208, 0.035329364240169525, -0.19141680002212524, -0.04139582812786102, -0.08645441383123398, -0.10862595587968826, 0.00020748749375343323, -0.14398439228534698, 0.2752375602722168, -0.4891378879547119, 0.015279842540621758, -0.8466313481330872, 0.16759882867336273, 0.0820840448141098, 0.19228406250476837, 0.2112368941307068, 0.24105487763881683, -0.12535910308361053, 0.37311533093452454, -0.059526827186346054, 0.14788079261779785, 0.12809641659259796, 0.12193253636360168, -0.2187352031469345, 0.29684633016586304, 0.03398731350898743, -0.05095062404870987, -0.15428809821605682, 0.24532859027385712, 0.005274560302495956, 0.08098486065864563, -0.44742071628570557, -0.20484596490859985, 0.08300022780895233, 0.45459097623825073, -0.4130987226963043, -0.3270503282546997, -0.1320553421974182, -0.029767721891403198, -0.13795991241931915, 0.33131253719329834, -0.25168126821517944, 0.10153062641620636, 0.08950150012969971, 0.270982027053833, -0.005024828016757965, -0.05752461403608322, 0.1959300935268402, 0.11217865347862244, -0.0025021694600582123, -0.00965859368443489, 0.08054982125759125, 0.1135932058095932, -0.3562529683113098, 0.06357237696647644, -0.3242465555667877, -0.09654588997364044, -0.004361651837825775, -0.4777100682258606, 0.12295282632112503, -0.049328286200761795, -0.26532846689224243, 0.1203087717294693, 0.3046642541885376, -0.0884695053100586, -0.18313729763031006, -0.21644657850265503, 0.3299570679664612, 0.1630094349384308, 0.31704872846603394, 0.1720525473356247, -0.027824021875858307, 0.190360888838768, -0.20649239420890808, -0.035971563309431076, -0.0806393176317215, 0.013718299567699432, -0.4280225932598114, -0.20947951078414917, 0.030383534729480743, 0.1701527088880539, -0.25199052691459656, -0.3550487756729126, -0.06461118161678314, -0.18011683225631714, 0.10741240531206131, 0.08454003930091858, 0.12198270857334137, 0.026685021817684174, 0.48776376247406006, 0.33861714601516724, 0.24421222507953644, -0.17263361811637878, 0.12550416588783264, -0.06639191508293152, 0.0651240274310112, -0.2655505836009979, -0.07231785356998444, -0.015374056994915009, -0.24910089373588562, 0.1235540434718132, 0.10034837573766708, 0.37428098917007446, 0.2429763376712799, 0.02954857051372528, -0.3143494725227356, -0.04355459287762642, 0.21345549821853638, -0.041186004877090454, 0.21411091089248657, -0.10733884572982788, -0.10107268393039703, -0.0709785595536232, 0.0016966722905635834, 0.05538259446620941, 0.07275544106960297, -0.24340954422950745, 0.19700101017951965, -0.1420968472957611, 0.03307357057929039, -0.3328993022441864, -0.08269695192575455, -0.1517181098461151, -0.4607974588871002, -0.12469255924224854, -0.12043072283267975, 0.19629642367362976, -0.21811822056770325, 0.15629109740257263, 0.2676190733909607, -0.24170203506946564, 0.009997062385082245, -0.2554710805416107, -0.1594708263874054, 0.07061167806386948, 0.32343897223472595, -0.05543195456266403, 0.02039993181824684, -0.3014429211616516, 0.23901107907295227, 0.4054979979991913, -0.7948019504547119, -0.37161707878112793, 0.03686937317252159, 0.10472843796014786, -0.11779823899269104, 0.1983332633972168, 0.10983797162771225, 0.08226008713245392, -0.03748137503862381, -0.07227412611246109, 0.25916939973831177, 0.047958411276340485, -0.24403372406959534, -0.04215584695339203, -0.4611077308654785, 0.004861907102167606, 0.09050597250461578, 0.08333585411310196, -0.011080831289291382, 0.1839318573474884, -0.11937065422534943, 0.21104784309864044, -0.06088096275925636, 0.14274510741233826, 0.47262924909591675, 0.3525313436985016, 0.28413793444633484, -0.17681416869163513, -0.38380932807922363, -0.11925403773784637, 0.1884932965040207, -0.07175800949335098, 0.11844193935394287, 0.06680914759635925, -0.16651827096939087, 0.1244628056883812, -0.033685266971588135, -0.08513469994068146, 0.05868028849363327, 0.07810035347938538, 0.3029307723045349, -0.16741886734962463, 0.06645157933235168, -0.21513119339942932, 0.20757001638412476, 0.13192477822303772, 0.052622824907302856, -0.553432047367096, 0.34884530305862427, -0.3229832649230957, -0.12153740227222443, 0.06204290688037872, 0.34467124938964844, 0.1768803596496582, 0.03901291638612747, 0.03673018887639046, 0.3404579758644104, 0.044756900519132614, -0.007484618574380875, 0.09546242654323578, 0.06568843871355057, 0.09513284265995026, -0.2750212848186493, -0.08586999773979187, 0.019465621560811996, 0.27098533511161804, 0.07616911828517914, 0.2938504219055176, 0.014912363141775131, -0.1820140928030014, 0.2659018635749817, 0.11526502668857574, 0.13688194751739502, 0.23422755300998688, 0.0998382419347763, -0.09789915382862091, -0.16155552864074707, 0.2903488874435425, 0.11260196566581726, 0.26678168773651123, 0.22242222726345062, 0.028622880578041077, -0.07884932309389114, 0.27240532636642456, 0.08554743975400925, -0.13489222526550293, -0.2345086634159088, -0.4150892198085785, 0.12540382146835327, 0.38386592268943787, 0.1279836893081665, 0.5964433550834656, 0.39473265409469604, -0.045654937624931335, -0.11055011302232742, 0.011653546243906021, 0.02573426440358162, 0.1970776617527008, 0.0785704106092453, 0.12110748887062073, -0.015670038759708405, 0.25661566853523254, 0.21450960636138916, -0.11268432438373566, -0.25725942850112915, -0.15426209568977356, -0.10079585760831833, -0.2717668414115906, 0.22362679243087769, -0.5498263835906982, -0.4255421757698059, -0.369881808757782, -0.24143332242965698, -0.1700139045715332, -0.16500899195671082, -0.20149360597133636, 0.29788267612457275, -0.04710156470537186, 0.3174901008605957, 0.16170407831668854, 0.19776707887649536, -0.307728111743927, -0.1927967369556427, -0.046611636877059937, 0.09531371295452118, -0.30680546164512634, 0.098795086145401, 0.2719973027706146, 0.3366955518722534, 0.28096890449523926, 0.17776459455490112, 0.03484843671321869, -0.2747360169887543, -0.349366694688797, 0.06883639097213745, 0.1119072213768959, 0.33725523948669434, 0.1000068187713623, -0.32967185974121094, 0.3565821349620819, -0.2915501594543457, 0.06276879459619522, 0.05171101540327072, -0.29102322459220886, -0.010751567780971527, -0.024261008948087692, -0.3072197735309601, -0.20312286913394928, -0.18746675550937653, -0.16776695847511292, -0.3718169927597046, 0.05826760083436966, -0.32452404499053955, -0.19564293324947357, 0.18196141719818115, 0.06089264526963234, 0.036568716168403625, -0.20622245967388153, 0.031989388167858124, 0.050815436989068985, -0.05007769912481308, 0.17198392748832703, -0.14960366487503052, -0.2970111072063446, 0.06354764103889465, 0.09377820789813995, 0.1998574584722519, 0.013724420219659805, -0.22077760100364685, 0.08582732081413269, -0.38070961833000183, 0.11089955270290375, -0.07628866285085678, 0.2021174281835556, 0.35585612058639526, 0.2775464951992035, -0.07376942038536072, -0.3395756483078003, -0.41171711683273315, 0.17448104918003082, -0.19691531360149384, 0.12892502546310425, 0.012559082359075546, 0.10012364387512207, -0.23880429565906525, 0.3637526035308838, 0.5543854236602783, -0.18943120539188385, 0.3686519265174866, 0.10725166648626328, 0.5903097987174988, -0.08663909137248993, -0.5241780877113342, 0.040721237659454346, 0.06625468283891678, 0.05298617482185364, 0.0524018295109272, -0.16377884149551392, 0.16950981318950653, -0.2869061231613159, 0.4577004313468933, -0.3783854842185974, -0.025243833661079407, -0.20422066748142242, -0.2841314673423767, 0.038203638046979904, 0.08539466559886932, -0.21423301100730896, -0.10411223024129868, 0.05177002400159836, -0.047613803297281265, 0.31506383419036865, -0.044201113283634186, 0.1297217756509781, -0.36687514185905457, -0.06364455074071884, -0.21512740850448608, 0.4276001751422882, 0.10231606662273407, 0.21527957916259766, -0.1424521505832672, 0.01895558089017868, -0.2541475296020508, -0.0774909108877182, 0.10008161514997482, -0.23662903904914856, -0.2439979761838913, 0.28796663880348206, 0.2599846124649048, -0.34971311688423157, -0.05167435482144356, 0.017256960272789, -0.07471500337123871, 0.2538759708404541, -0.06406435370445251, -0.26404231786727905, -0.1390831619501114, -0.013341197744011879, 0.206233412027359, 0.0914895310997963, -0.057927560061216354, -0.295857697725296, -0.120331771671772, -0.21399837732315063, -0.5242465138435364, 0.021250955760478973, 0.18372777104377747, -0.0860619843006134, -0.08769059926271439, -0.317452073097229, -0.20379677414894104, 0.4154433012008667, -0.054471276700496674, 0.3567083775997162, -0.2736407518386841, 0.3837567865848541, -0.0789213478565216, 0.2668921649456024, 0.8587253093719482, 0.6269371509552002, -0.02657552808523178, -0.4167851507663727, 0.14826110005378723, 0.08451218903064728, 0.2801036834716797, 0.14008447527885437, -0.21694345772266388, 0.3158110976219177, -0.33070361614227295, -0.1960538923740387, -0.1424667090177536, 0.06257263571023941, 0.48423656821250916, 0.2629382312297821, -0.08956857770681381, -0.18200507760047913, 0.20252275466918945, 0.17034803330898285, -0.16648860275745392, 0.3758563995361328, 0.2901938557624817, -0.12570449709892273, 0.2620086967945099, -0.17978034913539886, 1.0165674686431885, 0.13271164894104004, 0.061525166034698486, 0.08546417951583862, -0.35699623823165894, 0.7724400162696838, 0.023104913532733917, 0.1791984587907791, -0.2218238115310669, -0.0704110860824585, -0.026433315128087997, -0.326557993888855, 0.275387167930603, -0.05360694229602814, -0.036172546446323395, 0.2635277211666107, 0.04317881166934967, 0.013484539464116096, -0.11158007383346558, 0.3114081025123596, 0.08782914280891418, -0.1538718193769455, -0.2690868079662323, 0.17158499360084534, 0.17190857231616974, 0.1742970049381256, -0.17698177695274353, -0.1334579586982727, -0.3285255432128906, -0.00479106605052948, -0.292625367641449, 0.16813385486602783, -0.32332727313041687, 0.3725205063819885, -0.18622304499149323, 0.19654765725135803, 0.33854126930236816, 0.4778251647949219, 0.2811049222946167, 0.08550246059894562, -0.14804837107658386, 0.016913440078496933, -0.004896171391010284, -0.08551865816116333, 0.06977345049381256, -0.2026311159133911, 0.23223192989826202, -0.20275883376598358, -0.15095241367816925, -0.0014043934643268585, 0.06640329211950302, -0.23131468892097473, -0.08480075001716614, 0.13661393523216248, 0.094442218542099, 0.025782015174627304, 0.01266869530081749, 0.270393967628479, 0.21622838079929352, -0.10102185606956482, 0.08594302088022232, 0.1317228078842163, 0.0810404121875763, 0.25096645951271057, -0.09232135862112045, -0.0660058930516243, 0.00902712345123291, 0.3017030358314514, 0.03260822594165802, -0.01954466849565506, 0.3591702878475189, -0.15825538337230682, -0.13465802371501923, -0.08854006975889206, 0.13016635179519653, 0.14260095357894897, -0.5613254308700562, -0.10685524344444275, -0.19630300998687744, -0.22738778591156006, -0.012451030313968658, 0.38532134890556335, 0.3295653760433197, -0.1872878074645996, 0.09561027586460114, -0.21055838465690613, -0.24438026547431946, 0.3879929780960083, -0.4095241129398346, 0.2746475040912628, -0.06985285133123398, 0.24918347597122192, -0.3421793282032013, 0.013460120186209679, -0.28922146558761597, 0.2546212673187256, -0.21354007720947266, 0.04378589987754822, 0.22691240906715393, -0.06627513468265533, 0.19923990964889526, -0.2521440088748932, 0.06015296280384064, -0.02831890806555748, -0.18224118649959564, -0.0847792774438858, -0.06179416924715042, 0.1213613897562027, 0.12470190227031708, -0.1711171418428421, -0.04456031322479248, -0.25658953189849854, -0.01664368249475956, -0.21626132726669312, -0.14711543917655945, 0.11460913717746735, -0.052968282252550125, -0.19521018862724304, -0.07062986493110657, 0.12726904451847076, -0.24109509587287903, 0.3225572109222412, 0.14688964188098907, -0.15372216701507568, -0.02316591888666153, 0.12921980023384094, -0.04836154729127884, -0.05997990071773529, -0.07194554805755615, 0.0664399117231369, 0.19513413310050964, 0.05862884223461151, -0.07582196593284607, -0.237990602850914, 0.021902017295360565, 0.3098599314689636, 0.413557231426239, 0.44239625334739685, -0.11925108730792999, 0.12693950533866882, 0.17658911645412445, 0.15327320992946625, -0.2084416151046753, -0.09208067506551743, -0.056077662855386734, -0.062451500445604324, -0.037541016936302185, 0.10036289691925049, 0.20770835876464844, 0.23200874030590057, 0.21483412384986877, 0.12599118053913116, 0.01028546690940857, 0.3802686631679535, 0.2922857403755188, -0.03686494380235672, 0.05772102624177933, 0.16120313107967377, 0.18146976828575134, 0.35483604669570923, 0.262185662984848, 0.6150409579277039, -0.12465490400791168, 0.3829406201839447, -0.012983410619199276, -0.3985852003097534, 0.005353182554244995, -0.35124075412750244, 0.06863300502300262, 0.01523752510547638, 0.25401341915130615, -0.004398122429847717, 0.09528848528862, 0.457385390996933, -0.522698163986206, -0.2564726769924164, 0.12935282289981842, -0.00888319406658411, -0.18645215034484863, 0.03428738936781883, 0.24558748304843903, -0.1512666940689087, -0.09503526240587234, -0.34143856167793274, 0.01662811078131199, -0.13506516814231873, 0.33667781949043274, -0.0216611810028553, -0.30994683504104614, -0.4495374858379364, -0.28379106521606445, 0.44623154401779175, -0.0036940090358257294, -0.03065728396177292, 0.18762512505054474, 0.01583988219499588, -0.02558208256959915, 0.11150570213794708, 0.71548992395401, 0.6108312010765076, 0.37788933515548706, -0.08889405429363251, -0.21025308966636658, 0.018864315003156662, 0.0482117235660553, 0.07021068036556244, 0.14608092606067657, 0.07152390480041504, 0.29916349053382874, 0.45530858635902405, 0.15395063161849976, -0.12843361496925354, -0.33428481221199036, -0.055101558566093445, 0.07146331667900085, -0.5126733779907227, 0.2901025414466858, -0.45170894265174866, 0.2211151421070099, -0.24718345701694489, 0.1781420260667801, -0.4943181872367859, -0.0735333040356636, 0.3589594066143036, -0.011756595224142075, 0.023094836622476578, -0.10316905379295349, 0.06320362538099289, 0.0676555335521698, 0.3014680743217468, 0.40355873107910156, 0.2591969072818756, -0.15776120126247406, -0.28204062581062317, -0.6866969466209412, 0.24222372472286224, -0.06631066650152206, 0.13410669565200806, -0.2756597399711609, 0.054765649139881134, 0.3645050525665283, 0.03870248422026634, 0.43658408522605896, 0.24631604552268982, 0.17974655330181122, -0.011521272361278534, -0.5115661025047302, -0.06305236369371414, 0.2002507746219635, -0.4950433671474457, 0.12064297497272491, -0.47221168875694275, 0.022870827466249466, 0.06751075387001038, 0.10856445133686066, 0.014137811958789825, 0.1986696869134903, 0.041341230273246765, -0.3675307035446167, 0.5704542398452759, 0.2770867347717285, 0.7558493614196777, -0.08490784466266632, -0.42468592524528503, -0.10303144156932831, -0.366512268781662, -0.1879444569349289, 0.053147122263908386, 0.03484896197915077, 0.4081447720527649, -0.553726851940155, 0.1081712543964386, -0.21509721875190735, 0.0633932575583458, 0.04886874556541443, 0.177689790725708, -0.4341084957122803, 0.2309899926185608, -0.2190963327884674, 0.18307626247406006, 0.14613930881023407, 0.16786780953407288, 0.03716643154621124, 0.3534940183162689, -0.4216095805168152, -0.21759246289730072, 0.4111872911453247, -0.23288094997406006, -0.12559349834918976, -0.11936716735363007, 0.13629326224327087, 0.4712640941143036, -0.07346338778734207, -0.6935973763465881, -0.05581558495759964, 0.15630771219730377, 0.028661061078310013, -0.17324060201644897, 0.20072084665298462, -0.3006788492202759, -0.12022857367992401, -0.029434382915496826, 0.21255508065223694, 0.028229229152202606, -0.10424487292766571, 0.3749854564666748, -0.2541312575340271 ]
https://github.com/huggingface/datasets/issues/5876
I think we should use clobber and show a warning if it overwrote a registered filesystem indeed ! This way the user can re-register the filesystems if needed. Though they should probably be compatible (and maybe do the exact same thing) so I wouldn't de-register the `datasets` filesystems
Incompatibility with DataLab
### Describe the bug Hello, I am currently working on a project where both [DataLab](https://github.com/ExpressAI/DataLab) and [datasets](https://github.com/huggingface/datasets) are subdependencies. I noticed that I cannot import both libraries, as they both register FileSystems in `fsspec`, expecting the FileSystems not being registered before. When running the code below, I get the following error: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\Bened\anaconda3\envs\ner-eval-dashboard2\lib\site-packages\datalabs\__init__.py", line 28, in <module> from datalabs.arrow_dataset import concatenate_datasets, Dataset File "C:\Users\Bened\anaconda3\envs\ner-eval-dashboard2\lib\site-packages\datalabs\arrow_dataset.py", line 60, in <module> from datalabs.arrow_writer import ArrowWriter, OptimizedTypedSequence File "C:\Users\Bened\anaconda3\envs\ner-eval-dashboard2\lib\site-packages\datalabs\arrow_writer.py", line 28, in <module> from datalabs.features import ( File "C:\Users\Bened\anaconda3\envs\ner-eval-dashboard2\lib\site-packages\datalabs\features\__init__.py", line 2, in <module> from datalabs.features.audio import Audio File "C:\Users\Bened\anaconda3\envs\ner-eval-dashboard2\lib\site-packages\datalabs\features\audio.py", line 21, in <module> from datalabs.utils.streaming_download_manager import xopen File "C:\Users\Bened\anaconda3\envs\ner-eval-dashboard2\lib\site-packages\datalabs\utils\streaming_download_manager.py", line 16, in <module> from datalabs.filesystems import COMPRESSION_FILESYSTEMS File "C:\Users\Bened\anaconda3\envs\ner-eval-dashboard2\lib\site-packages\datalabs\filesystems\__init__.py", line 37, in <module> fsspec.register_implementation(fs_class.protocol, fs_class) File "C:\Users\Bened\anaconda3\envs\ner-eval-dashboard2\lib\site-packages\fsspec\registry.py", line 51, in register_implementation raise ValueError( ValueError: Name (bz2) already in the registry and clobber is False ``` I think as simple solution would be to just set `clobber=True` in https://github.com/huggingface/datasets/blob/main/src/datasets/filesystems/__init__.py#L28. This allows the register to discard previous registrations. This should work, as the datalabs FileSystems are copies of the datasets FileSystems. However, I don't know if it is guaranteed to be compatible with other libraries that might use the same protocols. I am linking the symmetric issue on [DataLab](https://github.com/ExpressAI/DataLab/issues/425) as ideally the issue is solved in both libraries the same way. Otherwise, it could lead to different behaviors depending on which library gets imported first. ### Steps to reproduce the bug 1. Run `pip install datalabs==0.4.15 datasets==2.12.0` 2. Run the following python code: ``` import datalabs import datasets ``` ### Expected behavior It should be possible to import both libraries without getting a Value Error ### Environment info datalabs==0.4.15 datasets==2.12.0
48
Incompatibility with DataLab ### Describe the bug Hello, I am currently working on a project where both [DataLab](https://github.com/ExpressAI/DataLab) and [datasets](https://github.com/huggingface/datasets) are subdependencies. I noticed that I cannot import both libraries, as they both register FileSystems in `fsspec`, expecting the FileSystems not being registered before. When running the code below, I get the following error: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\Bened\anaconda3\envs\ner-eval-dashboard2\lib\site-packages\datalabs\__init__.py", line 28, in <module> from datalabs.arrow_dataset import concatenate_datasets, Dataset File "C:\Users\Bened\anaconda3\envs\ner-eval-dashboard2\lib\site-packages\datalabs\arrow_dataset.py", line 60, in <module> from datalabs.arrow_writer import ArrowWriter, OptimizedTypedSequence File "C:\Users\Bened\anaconda3\envs\ner-eval-dashboard2\lib\site-packages\datalabs\arrow_writer.py", line 28, in <module> from datalabs.features import ( File "C:\Users\Bened\anaconda3\envs\ner-eval-dashboard2\lib\site-packages\datalabs\features\__init__.py", line 2, in <module> from datalabs.features.audio import Audio File "C:\Users\Bened\anaconda3\envs\ner-eval-dashboard2\lib\site-packages\datalabs\features\audio.py", line 21, in <module> from datalabs.utils.streaming_download_manager import xopen File "C:\Users\Bened\anaconda3\envs\ner-eval-dashboard2\lib\site-packages\datalabs\utils\streaming_download_manager.py", line 16, in <module> from datalabs.filesystems import COMPRESSION_FILESYSTEMS File "C:\Users\Bened\anaconda3\envs\ner-eval-dashboard2\lib\site-packages\datalabs\filesystems\__init__.py", line 37, in <module> fsspec.register_implementation(fs_class.protocol, fs_class) File "C:\Users\Bened\anaconda3\envs\ner-eval-dashboard2\lib\site-packages\fsspec\registry.py", line 51, in register_implementation raise ValueError( ValueError: Name (bz2) already in the registry and clobber is False ``` I think as simple solution would be to just set `clobber=True` in https://github.com/huggingface/datasets/blob/main/src/datasets/filesystems/__init__.py#L28. This allows the register to discard previous registrations. This should work, as the datalabs FileSystems are copies of the datasets FileSystems. However, I don't know if it is guaranteed to be compatible with other libraries that might use the same protocols. I am linking the symmetric issue on [DataLab](https://github.com/ExpressAI/DataLab/issues/425) as ideally the issue is solved in both libraries the same way. Otherwise, it could lead to different behaviors depending on which library gets imported first. ### Steps to reproduce the bug 1. Run `pip install datalabs==0.4.15 datasets==2.12.0` 2. Run the following python code: ``` import datalabs import datasets ``` ### Expected behavior It should be possible to import both libraries without getting a Value Error ### Environment info datalabs==0.4.15 datasets==2.12.0 I think we should use clobber and show a warning if it overwrote a registered filesystem indeed ! This way the user can re-register the filesystems if needed. Though they should probably be compatible (and maybe do the exact same thing) so I wouldn't de-register the `datasets` filesystems
[ -0.32871371507644653, 0.2323617786169052, -0.10847318172454834, 0.27989068627357483, 0.27650871872901917, 0.12257921695709229, 0.1858045905828476, 0.03771381080150604, 0.12055659294128418, 0.1787029206752777, -0.2229849100112915, 0.1549004316329956, 0.057372260838747025, 0.08281157165765762, -0.24419866502285004, 0.2410188615322113, 0.19221681356430054, 0.2473473697900772, -0.554028332233429, -0.06259463727474213, -0.08865183591842651, 0.2679033875465393, -0.388602614402771, -0.05451994016766548, -0.20932254195213318, 0.007095841690897942, 0.02308424562215805, 0.17299756407737732, -0.39302095770835876, -0.4484950304031372, 0.5750887989997864, -0.004701255355030298, 0.08315065503120422, 0.4362312853336334, -0.0001147194197983481, 0.0553102046251297, 0.2985917329788208, 0.035329364240169525, -0.19141680002212524, -0.04139582812786102, -0.08645441383123398, -0.10862595587968826, 0.00020748749375343323, -0.14398439228534698, 0.2752375602722168, -0.4891378879547119, 0.015279842540621758, -0.8466313481330872, 0.16759882867336273, 0.0820840448141098, 0.19228406250476837, 0.2112368941307068, 0.24105487763881683, -0.12535910308361053, 0.37311533093452454, -0.059526827186346054, 0.14788079261779785, 0.12809641659259796, 0.12193253636360168, -0.2187352031469345, 0.29684633016586304, 0.03398731350898743, -0.05095062404870987, -0.15428809821605682, 0.24532859027385712, 0.005274560302495956, 0.08098486065864563, -0.44742071628570557, -0.20484596490859985, 0.08300022780895233, 0.45459097623825073, -0.4130987226963043, -0.3270503282546997, -0.1320553421974182, -0.029767721891403198, -0.13795991241931915, 0.33131253719329834, -0.25168126821517944, 0.10153062641620636, 0.08950150012969971, 0.270982027053833, -0.005024828016757965, -0.05752461403608322, 0.1959300935268402, 0.11217865347862244, -0.0025021694600582123, -0.00965859368443489, 0.08054982125759125, 0.1135932058095932, -0.3562529683113098, 0.06357237696647644, -0.3242465555667877, -0.09654588997364044, -0.004361651837825775, -0.4777100682258606, 0.12295282632112503, -0.049328286200761795, -0.26532846689224243, 0.1203087717294693, 0.3046642541885376, -0.0884695053100586, -0.18313729763031006, -0.21644657850265503, 0.3299570679664612, 0.1630094349384308, 0.31704872846603394, 0.1720525473356247, -0.027824021875858307, 0.190360888838768, -0.20649239420890808, -0.035971563309431076, -0.0806393176317215, 0.013718299567699432, -0.4280225932598114, -0.20947951078414917, 0.030383534729480743, 0.1701527088880539, -0.25199052691459656, -0.3550487756729126, -0.06461118161678314, -0.18011683225631714, 0.10741240531206131, 0.08454003930091858, 0.12198270857334137, 0.026685021817684174, 0.48776376247406006, 0.33861714601516724, 0.24421222507953644, -0.17263361811637878, 0.12550416588783264, -0.06639191508293152, 0.0651240274310112, -0.2655505836009979, -0.07231785356998444, -0.015374056994915009, -0.24910089373588562, 0.1235540434718132, 0.10034837573766708, 0.37428098917007446, 0.2429763376712799, 0.02954857051372528, -0.3143494725227356, -0.04355459287762642, 0.21345549821853638, -0.041186004877090454, 0.21411091089248657, -0.10733884572982788, -0.10107268393039703, -0.0709785595536232, 0.0016966722905635834, 0.05538259446620941, 0.07275544106960297, -0.24340954422950745, 0.19700101017951965, -0.1420968472957611, 0.03307357057929039, -0.3328993022441864, -0.08269695192575455, -0.1517181098461151, -0.4607974588871002, -0.12469255924224854, -0.12043072283267975, 0.19629642367362976, -0.21811822056770325, 0.15629109740257263, 0.2676190733909607, -0.24170203506946564, 0.009997062385082245, -0.2554710805416107, -0.1594708263874054, 0.07061167806386948, 0.32343897223472595, -0.05543195456266403, 0.02039993181824684, -0.3014429211616516, 0.23901107907295227, 0.4054979979991913, -0.7948019504547119, -0.37161707878112793, 0.03686937317252159, 0.10472843796014786, -0.11779823899269104, 0.1983332633972168, 0.10983797162771225, 0.08226008713245392, -0.03748137503862381, -0.07227412611246109, 0.25916939973831177, 0.047958411276340485, -0.24403372406959534, -0.04215584695339203, -0.4611077308654785, 0.004861907102167606, 0.09050597250461578, 0.08333585411310196, -0.011080831289291382, 0.1839318573474884, -0.11937065422534943, 0.21104784309864044, -0.06088096275925636, 0.14274510741233826, 0.47262924909591675, 0.3525313436985016, 0.28413793444633484, -0.17681416869163513, -0.38380932807922363, -0.11925403773784637, 0.1884932965040207, -0.07175800949335098, 0.11844193935394287, 0.06680914759635925, -0.16651827096939087, 0.1244628056883812, -0.033685266971588135, -0.08513469994068146, 0.05868028849363327, 0.07810035347938538, 0.3029307723045349, -0.16741886734962463, 0.06645157933235168, -0.21513119339942932, 0.20757001638412476, 0.13192477822303772, 0.052622824907302856, -0.553432047367096, 0.34884530305862427, -0.3229832649230957, -0.12153740227222443, 0.06204290688037872, 0.34467124938964844, 0.1768803596496582, 0.03901291638612747, 0.03673018887639046, 0.3404579758644104, 0.044756900519132614, -0.007484618574380875, 0.09546242654323578, 0.06568843871355057, 0.09513284265995026, -0.2750212848186493, -0.08586999773979187, 0.019465621560811996, 0.27098533511161804, 0.07616911828517914, 0.2938504219055176, 0.014912363141775131, -0.1820140928030014, 0.2659018635749817, 0.11526502668857574, 0.13688194751739502, 0.23422755300998688, 0.0998382419347763, -0.09789915382862091, -0.16155552864074707, 0.2903488874435425, 0.11260196566581726, 0.26678168773651123, 0.22242222726345062, 0.028622880578041077, -0.07884932309389114, 0.27240532636642456, 0.08554743975400925, -0.13489222526550293, -0.2345086634159088, -0.4150892198085785, 0.12540382146835327, 0.38386592268943787, 0.1279836893081665, 0.5964433550834656, 0.39473265409469604, -0.045654937624931335, -0.11055011302232742, 0.011653546243906021, 0.02573426440358162, 0.1970776617527008, 0.0785704106092453, 0.12110748887062073, -0.015670038759708405, 0.25661566853523254, 0.21450960636138916, -0.11268432438373566, -0.25725942850112915, -0.15426209568977356, -0.10079585760831833, -0.2717668414115906, 0.22362679243087769, -0.5498263835906982, -0.4255421757698059, -0.369881808757782, -0.24143332242965698, -0.1700139045715332, -0.16500899195671082, -0.20149360597133636, 0.29788267612457275, -0.04710156470537186, 0.3174901008605957, 0.16170407831668854, 0.19776707887649536, -0.307728111743927, -0.1927967369556427, -0.046611636877059937, 0.09531371295452118, -0.30680546164512634, 0.098795086145401, 0.2719973027706146, 0.3366955518722534, 0.28096890449523926, 0.17776459455490112, 0.03484843671321869, -0.2747360169887543, -0.349366694688797, 0.06883639097213745, 0.1119072213768959, 0.33725523948669434, 0.1000068187713623, -0.32967185974121094, 0.3565821349620819, -0.2915501594543457, 0.06276879459619522, 0.05171101540327072, -0.29102322459220886, -0.010751567780971527, -0.024261008948087692, -0.3072197735309601, -0.20312286913394928, -0.18746675550937653, -0.16776695847511292, -0.3718169927597046, 0.05826760083436966, -0.32452404499053955, -0.19564293324947357, 0.18196141719818115, 0.06089264526963234, 0.036568716168403625, -0.20622245967388153, 0.031989388167858124, 0.050815436989068985, -0.05007769912481308, 0.17198392748832703, -0.14960366487503052, -0.2970111072063446, 0.06354764103889465, 0.09377820789813995, 0.1998574584722519, 0.013724420219659805, -0.22077760100364685, 0.08582732081413269, -0.38070961833000183, 0.11089955270290375, -0.07628866285085678, 0.2021174281835556, 0.35585612058639526, 0.2775464951992035, -0.07376942038536072, -0.3395756483078003, -0.41171711683273315, 0.17448104918003082, -0.19691531360149384, 0.12892502546310425, 0.012559082359075546, 0.10012364387512207, -0.23880429565906525, 0.3637526035308838, 0.5543854236602783, -0.18943120539188385, 0.3686519265174866, 0.10725166648626328, 0.5903097987174988, -0.08663909137248993, -0.5241780877113342, 0.040721237659454346, 0.06625468283891678, 0.05298617482185364, 0.0524018295109272, -0.16377884149551392, 0.16950981318950653, -0.2869061231613159, 0.4577004313468933, -0.3783854842185974, -0.025243833661079407, -0.20422066748142242, -0.2841314673423767, 0.038203638046979904, 0.08539466559886932, -0.21423301100730896, -0.10411223024129868, 0.05177002400159836, -0.047613803297281265, 0.31506383419036865, -0.044201113283634186, 0.1297217756509781, -0.36687514185905457, -0.06364455074071884, -0.21512740850448608, 0.4276001751422882, 0.10231606662273407, 0.21527957916259766, -0.1424521505832672, 0.01895558089017868, -0.2541475296020508, -0.0774909108877182, 0.10008161514997482, -0.23662903904914856, -0.2439979761838913, 0.28796663880348206, 0.2599846124649048, -0.34971311688423157, -0.05167435482144356, 0.017256960272789, -0.07471500337123871, 0.2538759708404541, -0.06406435370445251, -0.26404231786727905, -0.1390831619501114, -0.013341197744011879, 0.206233412027359, 0.0914895310997963, -0.057927560061216354, -0.295857697725296, -0.120331771671772, -0.21399837732315063, -0.5242465138435364, 0.021250955760478973, 0.18372777104377747, -0.0860619843006134, -0.08769059926271439, -0.317452073097229, -0.20379677414894104, 0.4154433012008667, -0.054471276700496674, 0.3567083775997162, -0.2736407518386841, 0.3837567865848541, -0.0789213478565216, 0.2668921649456024, 0.8587253093719482, 0.6269371509552002, -0.02657552808523178, -0.4167851507663727, 0.14826110005378723, 0.08451218903064728, 0.2801036834716797, 0.14008447527885437, -0.21694345772266388, 0.3158110976219177, -0.33070361614227295, -0.1960538923740387, -0.1424667090177536, 0.06257263571023941, 0.48423656821250916, 0.2629382312297821, -0.08956857770681381, -0.18200507760047913, 0.20252275466918945, 0.17034803330898285, -0.16648860275745392, 0.3758563995361328, 0.2901938557624817, -0.12570449709892273, 0.2620086967945099, -0.17978034913539886, 1.0165674686431885, 0.13271164894104004, 0.061525166034698486, 0.08546417951583862, -0.35699623823165894, 0.7724400162696838, 0.023104913532733917, 0.1791984587907791, -0.2218238115310669, -0.0704110860824585, -0.026433315128087997, -0.326557993888855, 0.275387167930603, -0.05360694229602814, -0.036172546446323395, 0.2635277211666107, 0.04317881166934967, 0.013484539464116096, -0.11158007383346558, 0.3114081025123596, 0.08782914280891418, -0.1538718193769455, -0.2690868079662323, 0.17158499360084534, 0.17190857231616974, 0.1742970049381256, -0.17698177695274353, -0.1334579586982727, -0.3285255432128906, -0.00479106605052948, -0.292625367641449, 0.16813385486602783, -0.32332727313041687, 0.3725205063819885, -0.18622304499149323, 0.19654765725135803, 0.33854126930236816, 0.4778251647949219, 0.2811049222946167, 0.08550246059894562, -0.14804837107658386, 0.016913440078496933, -0.004896171391010284, -0.08551865816116333, 0.06977345049381256, -0.2026311159133911, 0.23223192989826202, -0.20275883376598358, -0.15095241367816925, -0.0014043934643268585, 0.06640329211950302, -0.23131468892097473, -0.08480075001716614, 0.13661393523216248, 0.094442218542099, 0.025782015174627304, 0.01266869530081749, 0.270393967628479, 0.21622838079929352, -0.10102185606956482, 0.08594302088022232, 0.1317228078842163, 0.0810404121875763, 0.25096645951271057, -0.09232135862112045, -0.0660058930516243, 0.00902712345123291, 0.3017030358314514, 0.03260822594165802, -0.01954466849565506, 0.3591702878475189, -0.15825538337230682, -0.13465802371501923, -0.08854006975889206, 0.13016635179519653, 0.14260095357894897, -0.5613254308700562, -0.10685524344444275, -0.19630300998687744, -0.22738778591156006, -0.012451030313968658, 0.38532134890556335, 0.3295653760433197, -0.1872878074645996, 0.09561027586460114, -0.21055838465690613, -0.24438026547431946, 0.3879929780960083, -0.4095241129398346, 0.2746475040912628, -0.06985285133123398, 0.24918347597122192, -0.3421793282032013, 0.013460120186209679, -0.28922146558761597, 0.2546212673187256, -0.21354007720947266, 0.04378589987754822, 0.22691240906715393, -0.06627513468265533, 0.19923990964889526, -0.2521440088748932, 0.06015296280384064, -0.02831890806555748, -0.18224118649959564, -0.0847792774438858, -0.06179416924715042, 0.1213613897562027, 0.12470190227031708, -0.1711171418428421, -0.04456031322479248, -0.25658953189849854, -0.01664368249475956, -0.21626132726669312, -0.14711543917655945, 0.11460913717746735, -0.052968282252550125, -0.19521018862724304, -0.07062986493110657, 0.12726904451847076, -0.24109509587287903, 0.3225572109222412, 0.14688964188098907, -0.15372216701507568, -0.02316591888666153, 0.12921980023384094, -0.04836154729127884, -0.05997990071773529, -0.07194554805755615, 0.0664399117231369, 0.19513413310050964, 0.05862884223461151, -0.07582196593284607, -0.237990602850914, 0.021902017295360565, 0.3098599314689636, 0.413557231426239, 0.44239625334739685, -0.11925108730792999, 0.12693950533866882, 0.17658911645412445, 0.15327320992946625, -0.2084416151046753, -0.09208067506551743, -0.056077662855386734, -0.062451500445604324, -0.037541016936302185, 0.10036289691925049, 0.20770835876464844, 0.23200874030590057, 0.21483412384986877, 0.12599118053913116, 0.01028546690940857, 0.3802686631679535, 0.2922857403755188, -0.03686494380235672, 0.05772102624177933, 0.16120313107967377, 0.18146976828575134, 0.35483604669570923, 0.262185662984848, 0.6150409579277039, -0.12465490400791168, 0.3829406201839447, -0.012983410619199276, -0.3985852003097534, 0.005353182554244995, -0.35124075412750244, 0.06863300502300262, 0.01523752510547638, 0.25401341915130615, -0.004398122429847717, 0.09528848528862, 0.457385390996933, -0.522698163986206, -0.2564726769924164, 0.12935282289981842, -0.00888319406658411, -0.18645215034484863, 0.03428738936781883, 0.24558748304843903, -0.1512666940689087, -0.09503526240587234, -0.34143856167793274, 0.01662811078131199, -0.13506516814231873, 0.33667781949043274, -0.0216611810028553, -0.30994683504104614, -0.4495374858379364, -0.28379106521606445, 0.44623154401779175, -0.0036940090358257294, -0.03065728396177292, 0.18762512505054474, 0.01583988219499588, -0.02558208256959915, 0.11150570213794708, 0.71548992395401, 0.6108312010765076, 0.37788933515548706, -0.08889405429363251, -0.21025308966636658, 0.018864315003156662, 0.0482117235660553, 0.07021068036556244, 0.14608092606067657, 0.07152390480041504, 0.29916349053382874, 0.45530858635902405, 0.15395063161849976, -0.12843361496925354, -0.33428481221199036, -0.055101558566093445, 0.07146331667900085, -0.5126733779907227, 0.2901025414466858, -0.45170894265174866, 0.2211151421070099, -0.24718345701694489, 0.1781420260667801, -0.4943181872367859, -0.0735333040356636, 0.3589594066143036, -0.011756595224142075, 0.023094836622476578, -0.10316905379295349, 0.06320362538099289, 0.0676555335521698, 0.3014680743217468, 0.40355873107910156, 0.2591969072818756, -0.15776120126247406, -0.28204062581062317, -0.6866969466209412, 0.24222372472286224, -0.06631066650152206, 0.13410669565200806, -0.2756597399711609, 0.054765649139881134, 0.3645050525665283, 0.03870248422026634, 0.43658408522605896, 0.24631604552268982, 0.17974655330181122, -0.011521272361278534, -0.5115661025047302, -0.06305236369371414, 0.2002507746219635, -0.4950433671474457, 0.12064297497272491, -0.47221168875694275, 0.022870827466249466, 0.06751075387001038, 0.10856445133686066, 0.014137811958789825, 0.1986696869134903, 0.041341230273246765, -0.3675307035446167, 0.5704542398452759, 0.2770867347717285, 0.7558493614196777, -0.08490784466266632, -0.42468592524528503, -0.10303144156932831, -0.366512268781662, -0.1879444569349289, 0.053147122263908386, 0.03484896197915077, 0.4081447720527649, -0.553726851940155, 0.1081712543964386, -0.21509721875190735, 0.0633932575583458, 0.04886874556541443, 0.177689790725708, -0.4341084957122803, 0.2309899926185608, -0.2190963327884674, 0.18307626247406006, 0.14613930881023407, 0.16786780953407288, 0.03716643154621124, 0.3534940183162689, -0.4216095805168152, -0.21759246289730072, 0.4111872911453247, -0.23288094997406006, -0.12559349834918976, -0.11936716735363007, 0.13629326224327087, 0.4712640941143036, -0.07346338778734207, -0.6935973763465881, -0.05581558495759964, 0.15630771219730377, 0.028661061078310013, -0.17324060201644897, 0.20072084665298462, -0.3006788492202759, -0.12022857367992401, -0.029434382915496826, 0.21255508065223694, 0.028229229152202606, -0.10424487292766571, 0.3749854564666748, -0.2541312575340271 ]
https://github.com/huggingface/datasets/issues/5874
Hi! You can refer to [this doc](https://huggingface.co/docs/datasets/filesystems#load-and-save-your-datasets-using-your-cloud-storage-filesystem) to see the intended usage (basically, it skips the Arrow -> Parquet conversion step in `ds = load_dataset(...); ds.to_parquet("path/to/parquet")`) and allows writing Parquet to remote storage unlike `to_parquet`). > I guess I'd expect as_dataset to generate the dataset in arrow format if it has to, or to suggest an alternative way to load the dataset (I've also tried other methods with load_dataset to no avail, probably due to misunderstandings on my part). `as_dataset` does not work with `file_format="parquet"` files as Parquet files cannot be memory-mapped, so I think we should just raise an error in that case.
Using as_dataset on a "parquet" builder
### Describe the bug I used a custom builder to ``download_and_prepare`` a dataset. The first (very minor) issue is that the doc seems to suggest ``download_and_prepare`` will return the dataset, while it does not ([builder.py](https://github.com/huggingface/datasets/blob/main/src/datasets/builder.py#L718-L738)). ``` >>> from datasets import load_dataset_builder >>> builder = load_dataset_builder("rotten_tomatoes") >>> ds = builder.download_and_prepare("./output_dir", file_format="parquet") ``` The main issue I am facing is loading the dataset from those parquet files. I used the `as_dataset` method suggested by the doc, however it returns: ` FileNotFoundError: [Errno 2] Failed to open local file 'output_dir/__main__-train-00000-of-00245.arrow'. Detail: [errno 2] No such file or directory. ` ### Steps to reproduce the bug 1. Create a custom builder of some sort: `builder = CustomBuilder()`. 2. Run `download_and_prepare` with the parquet format: `builder.download_and_prepare("./output_dir", file_format="parquet")`. 3. Run `dataset = builder.as_dataset()`. ### Expected behavior I guess I'd expect `as_dataset` to generate the dataset in arrow format if it has to, or to suggest an alternative way to load the dataset (I've also tried other methods with `load_dataset` to no avail, probably due to misunderstandings on my part). ### Environment info ``` - `datasets` version: 2.12.0 - Platform: Linux-5.15.0-1027-gcp-x86_64-with-glibc2.31 - Python version: 3.10.0 - Huggingface_hub version: 0.14.1 - PyArrow version: 8.0.0 - Pandas version: 1.5.3 ```
104
Using as_dataset on a "parquet" builder ### Describe the bug I used a custom builder to ``download_and_prepare`` a dataset. The first (very minor) issue is that the doc seems to suggest ``download_and_prepare`` will return the dataset, while it does not ([builder.py](https://github.com/huggingface/datasets/blob/main/src/datasets/builder.py#L718-L738)). ``` >>> from datasets import load_dataset_builder >>> builder = load_dataset_builder("rotten_tomatoes") >>> ds = builder.download_and_prepare("./output_dir", file_format="parquet") ``` The main issue I am facing is loading the dataset from those parquet files. I used the `as_dataset` method suggested by the doc, however it returns: ` FileNotFoundError: [Errno 2] Failed to open local file 'output_dir/__main__-train-00000-of-00245.arrow'. Detail: [errno 2] No such file or directory. ` ### Steps to reproduce the bug 1. Create a custom builder of some sort: `builder = CustomBuilder()`. 2. Run `download_and_prepare` with the parquet format: `builder.download_and_prepare("./output_dir", file_format="parquet")`. 3. Run `dataset = builder.as_dataset()`. ### Expected behavior I guess I'd expect `as_dataset` to generate the dataset in arrow format if it has to, or to suggest an alternative way to load the dataset (I've also tried other methods with `load_dataset` to no avail, probably due to misunderstandings on my part). ### Environment info ``` - `datasets` version: 2.12.0 - Platform: Linux-5.15.0-1027-gcp-x86_64-with-glibc2.31 - Python version: 3.10.0 - Huggingface_hub version: 0.14.1 - PyArrow version: 8.0.0 - Pandas version: 1.5.3 ``` Hi! You can refer to [this doc](https://huggingface.co/docs/datasets/filesystems#load-and-save-your-datasets-using-your-cloud-storage-filesystem) to see the intended usage (basically, it skips the Arrow -> Parquet conversion step in `ds = load_dataset(...); ds.to_parquet("path/to/parquet")`) and allows writing Parquet to remote storage unlike `to_parquet`). > I guess I'd expect as_dataset to generate the dataset in arrow format if it has to, or to suggest an alternative way to load the dataset (I've also tried other methods with load_dataset to no avail, probably due to misunderstandings on my part). `as_dataset` does not work with `file_format="parquet"` files as Parquet files cannot be memory-mapped, so I think we should just raise an error in that case.
[ -0.43764203786849976, 0.06156957149505615, 0.04537085443735123, 0.6551530361175537, 0.18418003618717194, -0.07021303474903107, 0.09196878969669342, 0.1106797456741333, 0.07750609517097473, -0.10491342842578888, 0.11259061843156815, 0.5481758117675781, -0.39214813709259033, 0.03461502492427826, -0.07138300687074661, 0.0754125714302063, -0.027628205716609955, -0.06194879859685898, -0.030256137251853943, -0.16181156039237976, -0.2551359236240387, 0.40471136569976807, 0.12564323842525482, 0.29938724637031555, -0.1859288513660431, 0.05231890827417374, 0.07201790809631348, 0.3830104172229767, -0.3134738504886627, -0.41213417053222656, 0.450631320476532, -0.1556749939918518, 0.1796990931034088, 0.4635079503059387, -0.00012288287689443678, 0.15147222578525543, 0.26715028285980225, 0.009887248277664185, -0.539522647857666, -0.33415544033050537, -0.04628162458539009, -0.1657256782054901, 0.34546828269958496, 0.038515180349349976, -0.14680075645446777, -0.6176628470420837, -0.12479154020547867, -0.14930906891822815, 0.256161630153656, 0.3383597135543823, 0.09884043037891388, 0.05794703960418701, -0.08337343484163284, 0.018199726939201355, 0.2505171597003937, 0.35762903094291687, 0.009487546980381012, -0.0034979581832885742, 0.19039838016033173, 0.3250579237937927, 0.0070825740694999695, -0.08815909177064896, -0.024529680609703064, 0.012833729386329651, 0.330564945936203, 0.3319198787212372, 0.10286249220371246, -0.14730358123779297, 0.0030593229457736015, 0.02910829521715641, 0.5083591938018799, -0.3617386817932129, -0.37385687232017517, -0.5801776647567749, -0.005604241043329239, -0.16477970778942108, 0.13496311008930206, 0.4350236654281616, -0.29162976145744324, 0.20948728919029236, 0.11656729876995087, -0.2287420630455017, -0.0946599692106247, 0.11904402077198029, -0.006527155637741089, -0.013036701828241348, -0.31877049803733826, 0.21087996661663055, -0.24417632818222046, 0.08860108256340027, 0.1041179746389389, -0.33081135153770447, -0.11210790276527405, 0.2138896882534027, 0.00917317345738411, 0.11507031321525574, 0.279527485370636, -0.006508029997348785, 0.24388210475444794, 0.10589846223592758, 0.13566730916500092, -0.023732244968414307, -0.1618768274784088, 0.09542767703533173, 0.37107008695602417, -0.09014364331960678, -0.020243406295776367, 0.26616370677948, -0.05440448224544525, 0.4319981038570404, -0.04430893063545227, -0.24485772848129272, -0.3158896267414093, -0.12365218997001648, -0.1498223841190338, -0.20295734703540802, 0.5449786186218262, -0.3368074893951416, -0.2948504686355591, 0.2619975209236145, 0.26983970403671265, -0.01695287600159645, 0.17526045441627502, 0.25586771965026855, -0.031243985518813133, -0.07575402408838272, -0.11445817351341248, 0.34393277764320374, -0.06331860274076462, -0.2517533302307129, -0.15882164239883423, -0.10121665149927139, -0.284229576587677, -0.17403578758239746, 0.04353626072406769, -0.22755669057369232, 0.05092696100473404, 0.3383066952228546, 0.05991991236805916, -0.1880723387002945, -0.07891374826431274, 0.04639151319861412, 0.19783766567707062, 0.32060083746910095, -0.11620067059993744, 0.12799803912639618, 0.11301465332508087, -0.35421550273895264, -0.25294071435928345, 0.059040021151304245, -0.3074103891849518, -0.422951340675354, -0.25517505407333374, 0.0511622428894043, -0.21223928034305573, 0.1537102460861206, -0.3440588116645813, 0.2194308638572693, 0.010165821760892868, -0.23886236548423767, -0.012585673481225967, -0.12647224962711334, -0.29609423875808716, -0.23261907696723938, 0.19193875789642334, 0.4423728883266449, -0.36562585830688477, 0.07161206007003784, -0.05195047706365585, -0.12300437688827515, 0.3361501693725586, 0.15210175514221191, -0.38678449392318726, 0.2575978934764862, -0.47190430760383606, -0.15705806016921997, 0.7470446228981018, 0.1185687780380249, -0.2727595269680023, 0.307569295167923, -0.20961740612983704, 0.33127349615097046, 0.22039073705673218, -0.2736203670501709, 0.16606318950653076, -0.09180775284767151, 0.0720188319683075, 0.26521509885787964, 0.1440226435661316, -0.08911532163619995, -0.2942217290401459, -0.3178752660751343, 0.01731538213789463, 0.015670858323574066, -0.07825213670730591, 0.18308904767036438, 0.17364223301410675, -0.20470011234283447, 0.16158653795719147, -0.22729972004890442, 0.11489183455705643, -0.005591151304543018, -0.03865298628807068, 0.1735229343175888, 0.02697216346859932, 0.038859471678733826, -0.5488561987876892, 0.401967316865921, -0.21584324538707733, -0.29022902250289917, -0.37409383058547974, -0.11838032305240631, -0.22521957755088806, 0.1060713678598404, -0.2427709400653839, -0.3039745092391968, -0.0002305060625076294, 0.3189510703086853, 0.09680455178022385, -0.11032840609550476, -0.4992864727973938, 0.2960403859615326, -0.3339376151561737, 0.16663718223571777, -0.12111395597457886, 0.40852925181388855, 0.3913876414299011, -0.3132537603378296, -0.00923854112625122, 0.1319701224565506, 0.00819944404065609, -0.031188080087304115, 0.12369129061698914, 0.33356261253356934, 0.007238790392875671, 0.3322438895702362, -0.09519391506910324, -0.09696190059185028, 0.09901782125234604, -0.08244657516479492, 0.05781078338623047, -0.07829191535711288, 0.15798845887184143, 0.10901903361082077, -0.19120511412620544, 0.17815646529197693, 0.03740425407886505, 0.27232277393341064, 0.15870390832424164, -0.038580603897571564, -0.08558137714862823, 0.279537171125412, -0.10782073438167572, 0.034686245024204254, 0.014577898196876049, -0.24125134944915771, 0.14738185703754425, 0.09011377394199371, -0.5157756209373474, 0.10027142614126205, 0.46148425340652466, 0.07458499073982239, 0.014326052740216255, 0.2955330014228821, -0.07237738370895386, 0.0022257640957832336, 0.01050386019051075, 0.32726362347602844, 0.25495201349258423, 0.13750001788139343, 0.06909844279289246, 0.25584176182746887, -0.18339574337005615, -0.043088480830192566, 0.057882364839315414, 0.30429181456565857, 0.1417888104915619, 0.5225906372070312, 0.11420531570911407, 0.04101727157831192, -0.4217492341995239, -0.08693251758813858, 0.0918741300702095, 0.14499446749687195, -0.4137420952320099, 0.1603516936302185, -0.1944383978843689, 0.254595547914505, -0.3463168740272522, 0.07733054459095001, -0.07637281715869904, -0.08178728818893433, -0.23752272129058838, 0.16170790791511536, -0.16068723797798157, -0.10364455729722977, -0.2891439199447632, 0.187649205327034, -0.20305898785591125, -0.33951592445373535, -0.17952792346477509, -0.016851602122187614, -0.27888596057891846, -0.11914974451065063, 0.2790849804878235, 0.04184037446975708, 0.1436825692653656, -0.19555915892124176, 0.01956944167613983, -0.448594331741333, 0.0002273842692375183, 0.3302099108695984, 0.10674132406711578, 0.31846940517425537, 0.48818904161453247, 0.00719388946890831, 0.10582821071147919, -0.12057621777057648, 0.32587024569511414, -0.021800465881824493, -0.0432647168636322, 0.19276386499404907, 0.1458171159029007, 0.15331432223320007, -0.04049155116081238, -0.21449822187423706, 0.004544151946902275, -0.34471988677978516, 0.12561577558517456, 0.3300679624080658, 0.08009319007396698, -0.1671726405620575, 0.17844486236572266, 0.18533770740032196, -0.09389513731002808, 0.24197399616241455, -0.1940755844116211, -0.3359232544898987, 0.4331514835357666, -0.15560269355773926, -0.22484895586967468, -0.05203057453036308, -0.06152813881635666, 0.1463753879070282, 0.0791233479976654, -0.4551328420639038, 0.2183825522661209, -0.08073600381612778, -0.03790084272623062, -0.13482820987701416, 0.09775245189666748, 0.29654303193092346, 0.0524078905582428, 0.0707634910941124, -0.18225404620170593, -0.21527893841266632, 0.30217355489730835, 0.2877391278743744, 0.10812753438949585, 0.25344377756118774, 0.4248978793621063, 0.0840306282043457, 0.7530339956283569, 0.21110151708126068, -0.12940703332424164, 0.1748937964439392, -0.21922513842582703, 0.3457658886909485, -0.19250130653381348, -0.15269607305526733, -0.07858607172966003, -0.06217728555202484, -0.32700520753860474, 0.24058283865451813, 0.19128569960594177, 0.09026701748371124, -0.0896848663687706, 0.24370652437210083, -0.08233368396759033, -0.247135192155838, 0.06771528720855713, -0.0715782642364502, 0.09757031500339508, 0.021954961121082306, 0.24397362768650055, 0.11760717630386353, 0.05568084120750427, 0.22435122728347778, 0.2620188295841217, 0.3405703604221344, 0.054176412522792816, -0.00245482474565506, 0.24277086555957794, -0.5045086145401001, 0.22024671733379364, -0.021295009180903435, -0.044217728078365326, 0.05819827318191528, -0.2168835550546646, 0.28394922614097595, -0.07968425750732422, 0.5825461149215698, -0.07354875653982162, -0.05424180626869202, 0.2591171860694885, 0.013828717172145844, -0.4871244430541992, -0.14499668776988983, -0.01533152163028717, 0.26415959000587463, -0.3063986301422119, 0.3292022943496704, -0.35559213161468506, -0.40530580282211304, -0.031077664345502853, 0.17001357674598694, -0.024248674511909485, -0.11250974237918854, -0.27218982577323914, -0.15405268967151642, -0.284932941198349, 0.12625263631343842, 0.062246762216091156, 0.2964651584625244, -0.08245957642793655, 0.10837987810373306, -0.36151114106178284, 0.2175595909357071, -0.08590687811374664, -0.07699858397245407, 0.5844915509223938, -0.09990378469228745, 0.18508833646774292, 0.5043786764144897, 0.4064328372478485, 0.13865037262439728, 0.9544761776924133, -0.05792665481567383, -0.5345011949539185, 0.2595090866088867, -0.1646914780139923, 0.320000559091568, 0.4636366367340088, -0.2877403199672699, -0.1764606237411499, 0.0032103173434734344, -0.02862349897623062, -0.345123827457428, 0.11215658485889435, 0.2717151343822479, -0.27869319915771484, -0.07367147505283356, -0.49270522594451904, 0.6392000913619995, -0.10263863205909729, -0.1106894314289093, 0.39699554443359375, 0.26875039935112, -0.2013828456401825, 0.45556578040122986, 0.12274579703807831, 0.7693237066268921, 0.06742537021636963, 0.2792329490184784, 0.3143683671951294, -0.43693435192108154, 0.39227190613746643, -0.32883960008621216, 0.0029304958879947662, -0.40042534470558167, 0.06444407254457474, -0.0582750141620636, -0.2482895702123642, 0.0932961255311966, 0.29113197326660156, 0.10615580528974533, 0.17490433156490326, -0.2082771509885788, 0.19590464234352112, -0.03546487167477608, 0.31454023718833923, 0.011551788076758385, -0.2855588495731354, -0.33240389823913574, -0.00234091654419899, -0.08106943964958191, 0.24429330229759216, -0.09864453226327896, -0.0665646344423294, -0.0336012989282608, -0.2054799497127533, -0.10483799874782562, 0.12108798325061798, -0.10453127324581146, -0.20905360579490662, 0.30560019612312317, -0.7274927496910095, 0.33925920724868774, 0.2722168564796448, 0.044047761708498, -0.1375202089548111, -0.06326934695243835, 0.08987890183925629, 0.09747696667909622, 0.3335806131362915, 0.021301671862602234, -0.1456870436668396, 0.2569926679134369, 0.2014472782611847, 0.20420503616333008, 0.012411613948643208, -0.32339927554130554, -0.09405695647001266, 0.21959054470062256, 0.015578041784465313, 0.4707937240600586, -0.485227108001709, -0.31603434681892395, -0.07332814484834671, 0.16382476687431335, -0.05508745461702347, 0.005888079758733511, 0.16550567746162415, -0.2770562767982483, -0.3190210461616516, 0.12909889221191406, -0.4541510045528412, 0.0049754539504647255, 0.2959885597229004, -0.25836676359176636, 0.029613986611366272, 0.49067583680152893, 0.18043160438537598, -0.09406547993421555, -0.047807805240154266, -0.1844259798526764, 0.3902229070663452, -0.588638961315155, 0.026227939873933792, -0.219866082072258, 0.2657744884490967, -0.0020200833678245544, 0.19731605052947998, 0.19144994020462036, -0.2728237807750702, -0.1185760647058487, -0.4388952851295471, -0.14658239483833313, 0.09992274641990662, -0.11075171828269958, 0.12523476779460907, 0.08563417941331863, -0.3357597887516022, 0.05213025212287903, -0.48559635877609253, -0.20126061141490936, 0.134446918964386, 0.04206390678882599, 0.012893958017230034, 0.18532446026802063, 0.21381217241287231, 0.08756932616233826, 0.013917874544858932, -0.008554026484489441, -0.11258968710899353, -0.20417621731758118, -0.026216888800263405, -0.2202242761850357, 0.2147110402584076, 0.09923155605792999, 0.19188088178634644, -0.059643618762493134, -0.06536736339330673, -0.2832106649875641, -0.095200315117836, 0.2107710838317871, -0.07314381003379822, -0.1983567774295807, -0.12453985959291458, 0.18162772059440613, 0.12383919209241867, -0.549384355545044, 0.055581409484148026, -0.0007779709994792938, 0.26465702056884766, -0.04973156005144119, 0.21096187829971313, -0.2361857295036316, 0.045151785016059875, 0.37957876920700073, 0.13935260474681854, 0.10069391131401062, 0.23748144507408142, 0.42394983768463135, -0.34285876154899597, 0.21871894598007202, 0.04377564787864685, 0.5095805525779724, 0.609148383140564, -0.1385108083486557, -0.37424200773239136, 0.2362053245306015, 0.05376777797937393, -0.03923213854432106, -0.06787411868572235, 0.3194454610347748, 0.305891215801239, -0.14117185771465302, 0.19268524646759033, 0.22870436310768127, 0.04463852941989899, -0.33440911769866943, 0.28561437129974365, 0.3100884258747101, -0.29391688108444214, 0.21539491415023804, 0.5329769849777222, -0.1336236447095871, 0.37248387932777405, 0.3698212802410126, 0.2359912395477295, 0.1444953829050064, 0.7650536894798279, -0.10073566436767578, 0.07733695209026337, 0.17739424109458923, 0.04108542948961258, -0.046972014009952545, -0.557952880859375, 0.2853156328201294, 0.2952491343021393, 0.28704261779785156, -0.008666252717375755, -0.013842962682247162, 0.19652454555034637, 0.1530333310365677, 0.03461506590247154, -0.2164660096168518, 0.17757561802864075, -0.19426211714744568, -0.1581219732761383, -0.12756992876529694, -0.38279032707214355, -0.19422146677970886, 0.2238778918981552, -0.3256763517856598, 0.008037034422159195, -0.18919818103313446, -0.08734552562236786, 0.10080786049365997, -0.2879934012889862, -0.080598846077919, 0.02502758800983429, 0.030458461493253708, -0.31336015462875366, 0.45625999569892883, -0.03483743965625763, -0.07598581910133362, 0.254902184009552, 0.13575491309165955, 0.3763858377933502, 0.29224950075149536, -0.2576265037059784, -0.15384525060653687, -0.02434270828962326, 0.051529526710510254, -0.09865325689315796, 0.2140166461467743, -0.1463923454284668, -0.09171000123023987, 0.4742390513420105, 0.03384099900722504, -0.056075260043144226, -0.12689973413944244, 0.11391782760620117, 0.16377928853034973, -0.38165900111198425, 0.19702942669391632, -0.03320595622062683, -0.1739625483751297, 0.03379575535655022, 0.0236430112272501, -0.07568936794996262, -0.4515935480594635, 0.3108239769935608, 0.1366766393184662, 0.18083184957504272, 0.04289045184850693, 0.004355296492576599, 0.18247853219509125, 0.3918285369873047, 0.4197424054145813, 0.0008407309651374817, -0.2155422568321228, -0.23456066846847534, -0.7262915372848511, 0.05966032296419144, 0.14325830340385437, -0.2294381856918335, 0.21645879745483398, 0.2284252643585205, 0.007902804762125015, 0.34160396456718445, 0.12545739114284515, 0.27900877594947815, -0.10778212547302246, 0.3922135829925537, 0.15856026113033295, -0.18065881729125977, 0.03106146678328514, -0.05116529390215874, -0.18265336751937866, -0.3058848977088928, -0.0404338501393795, -0.2753198742866516, -0.07163280248641968, 0.11378516256809235, -0.1993134319782257, -0.15391415357589722, -0.393109530210495, 0.46218711137771606, 0.17673976719379425, 0.1463240534067154, -0.031345389783382416, -0.19270142912864685, -0.46040016412734985, -0.17304685711860657, -0.18254166841506958, 0.4008762538433075, -0.3885815143585205, 0.43014049530029297, -0.2987560033798218, -0.09045190364122391, -0.5791773200035095, -0.29904866218566895, 0.26759350299835205, 0.045068543404340744, -0.45456060767173767, 0.1681448221206665, -0.2838985323905945, -0.0009515099227428436, 0.20062613487243652, 0.25250473618507385, -0.023028261959552765, 0.07559257000684738, -0.09806391596794128, -0.15199565887451172, 0.5419924259185791, -0.4379763901233673, -0.38314196467399597, 0.10514660179615021, 0.1544623076915741, 0.33498233556747437, -0.28562697768211365, -0.19796252250671387, -0.04358749836683273, 0.2726384699344635, -0.2099670171737671, 0.04838065803050995, -0.26924216747283936, -0.03360384702682495, -0.02855231612920761, -0.12320933490991592, 0.19809451699256897, -0.0328344888985157, -0.1879097819328308, 0.05341911315917969, -0.33959904313087463 ]
https://github.com/huggingface/datasets/issues/5871
Indeed, it makes sense to normalize `data_dir`. Feel free to submit a PR (this can be "fixed" [here](https://github.com/huggingface/datasets/blob/89f775226321ba94e5bf4670a323c0fb44f5f65c/src/datasets/builder.py#L173))
data configuration hash suffix depends on uncanonicalized data_dir
### Describe the bug I am working with the `recipe_nlg` dataset, which requires manual download. Once it's downloaded, I've noticed that the hash in the custom data configuration is different if I add a trailing `/` to my `data_dir`. It took me a while to notice that the hashes were different, and to understand that that was the cause of my dataset being processed anew instead of the cached version being used. ### Steps to reproduce the bug 1. Follow the steps to manually download the `recipe_nlg` dataset to `/data/recipenlg`. 2. Load it using `load_dataset`, once without a trailing slash and once with one: ```python >>> ds = load_dataset("recipe_nlg", data_dir="/data/recipenlg") Using custom data configuration default-082278caeea85765 Downloading and preparing dataset recipe_nlg/default to /home/kyle/.cache/huggingface/datasets/recipe_nlg/default-082278caeea85765/1.0.0/aa4f120223637bedf7360cecb70a9bd108acfd64e38207ca90c9f385d21e5e74... Dataset recipe_nlg downloaded and prepared to /home/kyle/.cache/huggingface/datasets/recipe_nlg/default-082278caeea85765/1.0.0/aa4f120223637bedf7360cecb70a9bd108acfd64e38207ca90c9f385d21e5e74. Subsequent calls will reuse this data. 100%|███████████████████████████████████████████████████████████████████| 1/1 [00:01<00:00, 1.10s/it] DatasetDict({ train: Dataset({ features: ['id', 'title', 'ingredients', 'directions', 'link', 'source', 'ner'], num_rows: 2231142 }) }) >>> ds = load_dataset("recipe_nlg", data_dir="/data/recipenlg/") Using custom data configuration default-83e87680785d0493 Downloading and preparing dataset recipe_nlg/default to /home/user/.cache/huggingface/datasets/recipe_nlg/default-83e87680785d0493/1.0.0/aa4f120223637bedf7360cecb70a9bd108acfd64e38207ca90c9f385d21e5e74... Generating train split: 1%| | 12701/2231142 [00:04<13:15, 2790.25 examples/s ^C ``` 3. Observe that the hash suffix in the custom data configuration changes due to the altered string. ### Expected behavior I think I would expect the hash to remain constant if it actually points to the same location on disk. I would expect the use of `os.path.normpath` to canonicalize the paths. ### Environment info - `datasets` version: 2.8.0 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.31 - Python version: 3.10.8 - PyArrow version: 10.0.1 - Pandas version: 1.5.2
18
data configuration hash suffix depends on uncanonicalized data_dir ### Describe the bug I am working with the `recipe_nlg` dataset, which requires manual download. Once it's downloaded, I've noticed that the hash in the custom data configuration is different if I add a trailing `/` to my `data_dir`. It took me a while to notice that the hashes were different, and to understand that that was the cause of my dataset being processed anew instead of the cached version being used. ### Steps to reproduce the bug 1. Follow the steps to manually download the `recipe_nlg` dataset to `/data/recipenlg`. 2. Load it using `load_dataset`, once without a trailing slash and once with one: ```python >>> ds = load_dataset("recipe_nlg", data_dir="/data/recipenlg") Using custom data configuration default-082278caeea85765 Downloading and preparing dataset recipe_nlg/default to /home/kyle/.cache/huggingface/datasets/recipe_nlg/default-082278caeea85765/1.0.0/aa4f120223637bedf7360cecb70a9bd108acfd64e38207ca90c9f385d21e5e74... Dataset recipe_nlg downloaded and prepared to /home/kyle/.cache/huggingface/datasets/recipe_nlg/default-082278caeea85765/1.0.0/aa4f120223637bedf7360cecb70a9bd108acfd64e38207ca90c9f385d21e5e74. Subsequent calls will reuse this data. 100%|███████████████████████████████████████████████████████████████████| 1/1 [00:01<00:00, 1.10s/it] DatasetDict({ train: Dataset({ features: ['id', 'title', 'ingredients', 'directions', 'link', 'source', 'ner'], num_rows: 2231142 }) }) >>> ds = load_dataset("recipe_nlg", data_dir="/data/recipenlg/") Using custom data configuration default-83e87680785d0493 Downloading and preparing dataset recipe_nlg/default to /home/user/.cache/huggingface/datasets/recipe_nlg/default-83e87680785d0493/1.0.0/aa4f120223637bedf7360cecb70a9bd108acfd64e38207ca90c9f385d21e5e74... Generating train split: 1%| | 12701/2231142 [00:04<13:15, 2790.25 examples/s ^C ``` 3. Observe that the hash suffix in the custom data configuration changes due to the altered string. ### Expected behavior I think I would expect the hash to remain constant if it actually points to the same location on disk. I would expect the use of `os.path.normpath` to canonicalize the paths. ### Environment info - `datasets` version: 2.8.0 - Platform: Linux-5.4.0-147-generic-x86_64-with-glibc2.31 - Python version: 3.10.8 - PyArrow version: 10.0.1 - Pandas version: 1.5.2 Indeed, it makes sense to normalize `data_dir`. Feel free to submit a PR (this can be "fixed" [here](https://github.com/huggingface/datasets/blob/89f775226321ba94e5bf4670a323c0fb44f5f65c/src/datasets/builder.py#L173))
[ -0.10499189049005508, -0.11921073496341705, -0.05035083740949631, 0.3601611852645874, 0.21914991736412048, 0.17273661494255066, 0.13491305708885193, 0.18599238991737366, -0.2106330692768097, -0.0157313272356987, -0.13083800673484802, -0.027857616543769836, -0.2343911975622177, -0.30520135164260864, -0.12262667715549469, 0.37888550758361816, 0.1107247993350029, -0.08133822679519653, -0.17940036952495575, -0.15210279822349548, -0.09142612665891647, 0.28630900382995605, 0.0720495730638504, -0.3520544767379761, -0.5132903456687927, 0.2677387297153473, -0.006384670734405518, 0.4650820791721344, -0.09104332327842712, -0.4448230266571045, 0.38770896196365356, 0.12904497981071472, -0.004995010793209076, 0.5223218202590942, -0.00012381421402096748, 0.1712043285369873, 0.16245055198669434, -0.17995543777942657, -0.22948554158210754, 0.04261717572808266, -0.23422129452228546, -0.19091489911079407, -0.17612293362617493, -0.19237370789051056, -0.11528913676738739, 0.15901628136634827, -0.20792989432811737, -0.3335474133491516, 0.048125047236680984, -0.05808307230472565, 0.12111057341098785, -0.3479287624359131, -0.6114698648452759, -0.135220006108284, 0.12667545676231384, 0.2952173948287964, -0.14979517459869385, 0.36996135115623474, -0.062172919511795044, 0.190334290266037, -0.08556786179542542, 0.19215065240859985, 0.07970369607210159, 0.146930530667305, -0.08023114502429962, 0.3167341947555542, 0.39440569281578064, 0.121734619140625, 0.2900404930114746, 0.3530780076980591, 0.3402382731437683, -0.13707837462425232, -0.07869404554367065, -0.16879789531230927, -0.18917372822761536, -0.49064648151397705, 0.41206201910972595, 0.09193304926156998, 0.07492856681346893, 0.31684377789497375, -0.2496095448732376, 0.1415960192680359, 0.24164199829101562, -0.09578283131122589, -0.03521530330181122, 0.4405297338962555, -0.018212031573057175, -0.11037048697471619, -0.3166283369064331, 0.10773064941167831, 0.2142593264579773, -0.390365332365036, -0.10091830790042877, -0.2105279564857483, 0.22925139963626862, 0.21478140354156494, -0.09448379278182983, 0.03765839338302612, -0.03782534971833229, 0.32987359166145325, 0.11796817183494568, 0.1322038769721985, -0.009167399257421494, -0.395016074180603, -0.026490991935133934, -0.11898566782474518, 0.11025156080722809, 0.10905566811561584, 0.06827264279127121, 0.001203589141368866, -0.32333582639694214, 0.05322740226984024, 0.25364476442337036, -0.14668652415275574, 0.1868136078119278, -0.04767703264951706, 0.38222020864486694, -0.12705716490745544, 0.1124543771147728, -0.21875864267349243, -0.0672476515173912, 0.08675161004066467, 0.06174852326512337, 0.08497663587331772, -0.19453862309455872, -0.08265765756368637, -0.22793297469615936, 0.08062435686588287, 0.015740111470222473, 0.3873751163482666, -0.16643619537353516, -0.45201799273490906, -0.16449882090091705, 0.07603205740451813, 0.17351886630058289, 0.12781104445457458, 0.22179952263832092, 0.36473536491394043, 0.02284148521721363, -0.13831157982349396, -0.29105621576309204, 0.0717238187789917, 0.24797633290290833, -0.00825130008161068, -0.30736398696899414, 0.34489041566848755, 0.024870334193110466, -0.13563360273838043, -0.1752331703901291, 0.12196473777294159, -0.5929880142211914, -0.4947477877140045, 0.14034442603588104, 0.09673245996236801, -0.43556535243988037, 0.06890513747930527, 0.2505481243133545, -0.016535107046365738, 0.3313651978969574, 0.058273956179618835, 0.2870595455169678, 0.017195474356412888, -0.20351523160934448, -0.30429667234420776, -0.081059530377388, 0.31084245443344116, -0.3706821799278259, 0.03621411323547363, -0.10414308309555054, 0.056664418429136276, 0.10587996989488602, 0.26584792137145996, -0.23172180354595184, 0.21181020140647888, -0.4186530113220215, 0.15728196501731873, 0.5276159048080444, -0.3956785202026367, -0.549323320388794, 0.22584301233291626, -0.11816417425870895, 0.4392082095146179, 0.031473249197006226, 0.08427243679761887, -0.09928390383720398, -0.12708306312561035, -0.02739761769771576, 0.3809102773666382, 0.11133738607168198, -0.14595967531204224, -0.4060860276222229, -0.09723467379808426, 0.06731108576059341, -0.13966840505599976, -0.171525776386261, 0.05303515866398811, 0.006377093493938446, -0.18185842037200928, 0.3776169717311859, 0.029905058443546295, 0.21476402878761292, 0.4719536006450653, 0.31326860189437866, 0.14413389563560486, 0.14453983306884766, -0.04043085128068924, -0.4841838777065277, 0.29782938957214355, -0.2546219229698181, -0.03227575123310089, -0.4437381327152252, -0.14361605048179626, -0.2993810772895813, -0.33140990138053894, -0.3211049437522888, -0.08714276552200317, 0.03911617398262024, 0.2908427119255066, 0.04416218400001526, -0.09923765063285828, 0.05054040998220444, 0.16399241983890533, -0.05240349844098091, 0.13672129809856415, -0.09752078354358673, 0.09568742662668228, 0.25954678654670715, -0.02095183916389942, -0.3308250308036804, 0.22838759422302246, 0.22841408848762512, -0.30905643105506897, -0.09653089940547943, 0.4468041956424713, -0.03883492946624756, -0.07768581807613373, -0.014240788295865059, 0.3740960359573364, -0.08818570524454117, -0.028632640838623047, 0.21540789306163788, 0.1400349885225296, -0.07620753347873688, -0.3488513231277466, -0.2026367336511612, 0.4381793439388275, -0.16967955231666565, 0.21019704639911652, -0.2803632616996765, -0.24079447984695435, 0.430647075176239, -0.26489612460136414, -0.10620677471160889, -0.3941749632358551, -0.00880504585802555, -0.01510506309568882, 0.4260847568511963, 0.14798299968242645, 0.10674938559532166, 0.15229910612106323, 0.2173265814781189, -0.013700693845748901, -0.11826485395431519, -0.10879483819007874, -0.15875981748104095, -0.13713738322257996, -0.18967050313949585, 0.353407621383667, 0.7119335532188416, 0.028500139713287354, 0.4404916763305664, 0.31703364849090576, -0.008106261491775513, -0.38210225105285645, 0.24715286493301392, -0.23584863543510437, -0.17098626494407654, 0.32568076252937317, 0.149776890873909, -0.11992761492729187, -0.16620665788650513, -0.11790074408054352, 0.30706530809402466, -0.0505058690905571, -0.20787374675273895, 0.058368027210235596, -0.7621762156486511, -0.0466742143034935, -0.45930707454681396, -0.6238473653793335, -0.22995969653129578, -0.3616200387477875, 0.03935123234987259, -0.008709564805030823, 0.010286025702953339, 0.3742207884788513, -0.005581684410572052, 0.02194836735725403, -0.1019490659236908, -0.8002210855484009, -0.28221383690834045, 0.04521777480840683, -0.2413942515850067, -0.11027974635362625, 0.06001579388976097, -0.0065576620399951935, 0.021001474931836128, -0.20407535135746002, -0.07734266668558121, -0.37690025568008423, -0.43199941515922546, -0.003083213232457638, 0.2299644947052002, 0.27128729224205017, 0.3261481523513794, -0.19992473721504211, 0.3855518698692322, 0.01767263561487198, 0.38308706879615784, 0.3038451671600342, 0.22444388270378113, 0.04185366630554199, -0.022155510261654854, -0.08579211682081223, -0.1307242214679718, -0.27772074937820435, -0.11494418233633041, -0.03524945676326752, -0.26680925488471985, 0.07439383864402771, 0.042992666363716125, 0.4144696593284607, -0.18262258172035217, -0.2753635048866272, -0.09087446331977844, -0.1215599775314331, -0.33707937598228455, -0.5916277170181274, 0.39332425594329834, -0.31190797686576843, 0.1121237576007843, 0.11832710355520248, -0.0976639837026596, 0.23747876286506653, 0.5115427374839783, -0.33802539110183716, 0.11288437247276306, -0.22306396067142487, 0.6241975426673889, 0.03343379870057106, -0.19532136619091034, 0.25674161314964294, 0.10824155807495117, 0.08457225561141968, -0.17257529497146606, -0.2784358263015747, 0.124217689037323, 0.056002311408519745, 0.3685496747493744, 0.1461232453584671, 0.0980614423751831, 0.3019774556159973, 0.7825450301170349, -0.07137481123209, -0.05019086226820946, 0.1256197988986969, -0.2630489468574524, 0.47735416889190674, -0.04653637483716011, 0.08276593685150146, -0.33753469586372375, 0.2505037784576416, -0.041204046458005905, 0.16696012020111084, 0.3318609297275543, 0.24146217107772827, 0.21206220984458923, 0.18579937517642975, -0.1465534120798111, -0.26585012674331665, 0.3546818494796753, -0.5444013476371765, 0.16740070283412933, 0.3253496587276459, 0.08835352957248688, -0.23257854580879211, -0.23503293097019196, 0.11283774673938751, 0.2652696669101715, -0.18629124760627747, -0.002156909555196762, -0.19145894050598145, 0.37401995062828064, 0.0292716845870018, 0.3693905472755432, 0.12726810574531555, 0.18449366092681885, 0.10874868184328079, -0.04684285447001457, -0.007320858538150787, 0.043263040482997894, 0.4173651933670044, -0.4782771170139313, 0.37177592515945435, 0.043031685054302216, -0.20628276467323303, -0.17620280385017395, -0.2857920527458191, -0.03739023953676224, 0.32380419969558716, 0.2767283320426941, 0.6331509351730347, -0.1078946441411972, -0.11773404479026794, 0.03998299688100815, 0.040735796093940735, -0.1413542926311493, -0.3097396492958069, 0.017972007393836975, -0.3265154957771301, 0.2507622241973877, -0.024994902312755585, -0.14921459555625916, 0.06106498837471008, 0.08978783339262009, -0.015073999762535095, -0.2193528264760971, 0.02272608131170273, -0.005586985498666763, -0.15970030426979065, 0.09383848309516907, -0.1292923092842102, 0.22884637117385864, -0.13368920981884003, 0.1417234092950821, 0.07876706123352051, 0.39122116565704346, -0.2376936674118042, -0.13371063768863678, -0.3994758129119873, -0.10686704516410828, -0.2721680998802185, 0.6119682788848877, 0.01726749911904335, 0.21657396852970123, 0.19127219915390015, -0.14421087503433228, -0.1170499175786972, -0.08178764581680298, 0.2018870711326599, 0.045498937368392944, -0.4079299867153168, -0.367816299200058, 0.419785737991333, 0.2605564594268799, -0.24633967876434326, 0.15205085277557373, -0.17801359295845032, -0.4736385941505432, 0.1238117665052414, -0.08498780429363251, 0.9104794263839722, 0.2490459531545639, 0.11601711809635162, 0.20040656626224518, -0.3833633363246918, 0.05207638815045357, -0.0016998723149299622, 0.0644654706120491, -0.23012465238571167, -0.026797857135534286, -0.10326056182384491, -0.10245579481124878, 0.3961608111858368, 0.3640199601650238, 0.24532251060009003, 0.2469925433397293, -0.4399988055229187, 0.5404231548309326, -0.090266652405262, -0.04648515209555626, -0.0035205483436584473, 0.007819648832082748, -0.3028189539909363, 0.025205008685588837, 0.07716553658246994, 0.0015586595982313156, -0.18228235840797424, -0.12443257868289948, -0.18208938837051392, -0.05887780338525772, -0.023732401430606842, 0.14549727737903595, -0.15060068666934967, 0.02095092460513115, 0.013179901987314224, -0.498447448015213, -0.21641239523887634, 0.12205680459737778, 0.29279616475105286, 0.20302876830101013, -0.12321674078702927, 0.36572661995887756, -0.03513890132308006, 0.41799503564834595, 0.25784721970558167, -0.28889209032058716, 0.03495711833238602, 0.035808272659778595, -0.0029904544353485107, -0.519402265548706, -0.03596365451812744, -0.3697618842124939, -0.08280204236507416, -0.062204211950302124, -0.011607194319367409, -0.3911556005477905, -0.19682656228542328, -0.15011578798294067, -0.00983341783285141, -0.10066114366054535, 0.02471974678337574, -0.02330610528588295, -0.0024108365178108215, 0.3954589068889618, -0.2751844525337219, -0.39444196224212646, -0.11501254886388779, 0.52470862865448, 0.22864778339862823, -0.0561286024749279, 0.2903129458427429, -0.38427236676216125, -0.04478456452488899, -0.014432262629270554, 0.04517129063606262, -0.012862186878919601, -0.14852730929851532, 0.017466094344854355, 0.0018559470772743225, 0.17948545515537262, 0.05218354985117912, -0.15006643533706665, 0.2655563950538635, 0.12002584338188171, -0.23959583044052124, -0.15285331010818481, 0.036824822425842285, -0.05472591891884804, 0.08124618232250214, 0.17782460153102875, -0.2939108908176422, 0.1331176608800888, -0.11908593773841858, 0.06807467341423035, -0.21930816769599915, 0.5209504961967468, 0.36012375354766846, 0.1202019453048706, -0.16145241260528564, 0.11478449404239655, 0.3116198778152466, 0.07637593150138855, 0.10615018755197525, 0.11457207798957825, -0.37283170223236084, -0.07964064180850983, -0.31596773862838745, 0.1686028689146042, 0.0666060820221901, -0.048172615468502045, 0.08989385515451431, -0.07039596140384674, -0.017238842323422432, -0.14993135631084442, 0.051970623433589935, 0.47467440366744995, 0.08852770179510117, 0.052798181772232056, -0.050407931208610535, 0.14474308490753174, -0.3094939589500427, 0.14249104261398315, -0.3549293875694275, 0.1582392156124115, 0.005399089306592941, 0.19162389636039734, -0.3574269115924835, -0.08372367918491364, -0.19472280144691467, -0.10313070565462112, 0.3488323986530304, 0.14490388333797455, 0.3511869013309479, -0.20039677619934082, -0.09747346490621567, 0.4607841968536377, 0.2674570083618164, 0.3458084166049957, -0.11707481741905212, -0.5061884522438049, 0.22333261370658875, 0.080939881503582, -0.07704872637987137, -0.17147433757781982, 0.35030803084373474, 0.11331643164157867, -0.05057848244905472, 0.3562450408935547, 0.40458762645721436, -0.11437833309173584, -0.17206624150276184, -0.1056189239025116, 0.6745965480804443, -0.5695689916610718, 0.22206956148147583, 0.2890366017818451, -0.0038622915744781494, 0.2889019846916199, 0.5567587614059448, 0.06601101160049438, -0.0749949961900711, 0.8490612506866455, 0.1420501470565796, 0.21930265426635742, 0.2601306736469269, -0.3199103772640228, -0.06128622591495514, -0.20436713099479675, -0.01100869383662939, 0.3526880741119385, -0.08078497648239136, 0.2620033621788025, 0.07134165614843369, 0.2723110318183899, -0.22122500836849213, 0.00020786747336387634, -0.08674341440200806, 0.007370904088020325, -0.13643978536128998, -0.2508302330970764, 0.050017111003398895, -0.09136122465133667, -0.09805747121572495, 0.037356555461883545, -0.29521459341049194, 0.09921915829181671, 0.5578927397727966, -0.0802651047706604, -0.0078556127846241, -0.2055337131023407, -0.11378099024295807, -0.009892506524920464, 0.16571936011314392, -0.3740540146827698, 0.16892386972904205, 0.15519140660762787, -0.15034595131874084, 0.45036780834198, -0.02646440826356411, 0.2976466417312622, 0.33801573514938354, 0.2954729199409485, -0.1559773087501526, 0.146405428647995, -0.033849287778139114, -0.09826477617025375, 0.3903779089450836, 0.1162712499499321, 0.1134600043296814, 0.09730564802885056, 0.14927536249160767, -0.12937499582767487, 0.2204710841178894, 0.17694494128227234, 0.3200743794441223, -0.3771853446960449, 0.27685821056365967, 0.046840716153383255, 0.028556421399116516, 0.014021284878253937, 0.02765480801463127, 0.021356210112571716, -0.5861692428588867, 0.4569437801837921, 0.22263653576374054, 0.24748992919921875, 0.21678414940834045, 0.0123676098883152, 0.16777747869491577, 0.4555601477622986, 0.20379866659641266, -0.4631747305393219, -0.128163143992424, -0.0007427632808685303, -0.49870485067367554, 0.16206641495227814, -0.17428044974803925, 0.044242121279239655, -0.21701620519161224, 0.19230327010154724, 0.060920409858226776, 0.08056659996509552, 0.049858808517456055, -0.2298944741487503, 0.15239444375038147, 0.22765468060970306, -0.31140661239624023, 0.021642277017235756, -0.09973377734422684, 0.01535944826900959, 0.05652216076850891, -0.5117585062980652, 0.03352532908320427, 0.45938652753829956, -0.011548962444067001, 0.026113253086805344, -0.1668691337108612, 0.39634716510772705, -0.0759613886475563, 0.3998523950576782, 0.2738583981990814, 0.1898055225610733, -0.034435708075761795, -0.3576897084712982, -0.5900070071220398, -0.11833404004573822, -0.15905672311782837, 0.2427486628293991, 0.0735798180103302, 0.1966087818145752, -0.36536774039268494, 0.1071208268404007, -0.28266507387161255, 0.21363984048366547, 0.04243067651987076, 0.27018308639526367, 0.0646425411105156, 0.13746976852416992, -0.19844357669353485, 0.23493263125419617, 0.147084578871727, 0.4824777841567993, 0.11598841845989227, 0.34657931327819824, -0.14170916378498077, -0.28973910212516785, 0.42651835083961487, -0.034636206924915314, -0.3466583788394928, 0.048783235251903534, 0.35725104808807373, 0.0830233246088028, 0.0903012752532959, -0.051602236926555634, -0.024357065558433533, 0.43122968077659607, -0.046190276741981506, -0.07044237852096558, 0.11233998835086823, -0.05722273141145706, 0.013258956372737885, -0.03387214615941048, 0.10767889022827148, 0.1411067098379135, -0.2597891390323639, -0.1683902144432068, -0.3423873782157898 ]
https://github.com/huggingface/datasets/issues/5870
PS - some work is definitely needed for 'special cases' docs, not explanations, just usages of 'functions' under mixture of special cases, like a combination of custom databuilder + iterable dataset for large size + dynamic .map() application.
Behaviour difference between datasets.map and IterableDatasets.map
### Describe the bug All the examples in all the docs mentioned throughout huggingface datasets correspond to datasets object, and not IterableDatasets object. At one point of time, they might have been in sync, but the code for datasets version >=2.9.0 is very different as compared to the docs. I basically need to .map() a transform on images in an iterable dataset, which was made using a custom databuilder config. This works very good in map-styles datasets, but the .map() fails in IterableDatasets, show behvaiour as such: "pixel_values" key not found, KeyError in examples object/dict passed into transform function for map, which works fine with map style, even as batch. In iterable style, the object/dict passed into map() paramter callable function is completely different as what is mentioned in all examples. Please look into this. Thank you My databuilder class is inherited as such: def _info(self): print ("Config: ",self.config.__dict__.keys()) return datasets.DatasetInfo( description=_DESCRIPTION, features=datasets.Features( { "labels": datasets.Sequence(datasets.Value("uint16")), # "labels_name": datasets.Value("string"), # "pixel_values": datasets.Array3D(shape=(3, 1280, 960), dtype="float32"), "pixel_values": datasets.Array3D(shape=(1280, 960, 3), dtype="uint8"), "image_s3_path": datasets.Value("string"), } ), supervised_keys=None, homepage="none", citation="", ) def _split_generators(self, dl_manager): records_train = list(db.mini_set.find({'split':'train'},{'image_s3_path':1, 'ocwen_template_name':1}))[:10000] records_val = list(db.mini_set.find({'split':'val'},{'image_s3_path':1, 'ocwen_template_name':1}))[:1000] # print (len(records),self.config.num_shards) # shard_size_train = len(records_train)//self.config.num_shards # sharded_records_train = [records_train[i:i+shard_size_train] for i in range(0,len(records_train),shard_size_train)] # shard_size_val = len(records_val)//self.config.num_shards # sharded_records_val = [records_val[i:i+shard_size_val] for i in range(0,len(records_val),shard_size_val)] return [ datasets.SplitGenerator( name=datasets.Split.TRAIN, gen_kwargs={"records":records_train} # passing list of records, for sharding to take over ), datasets.SplitGenerator( name=datasets.Split.VALIDATION, gen_kwargs={"records":records_val} # passing list of records, for sharding to take over ), ] def _generate_examples(self, records): # print ("Generating examples for [{}] shards".format(len(shards))) # initiate_db_connection() # records = list(db.mini_set.find({'split':split},{'image_s3_path':1, 'ocwen_template_name':1}))[:10] id_ = 0 # for records in shards: for i,rec in enumerate(records): img_local_path = fetch_file(rec['image_s3_path'],self.config.buffer_dir) # t = self.config.processor(Image.open(img_local_path), random_padding=True, return_tensors="np").pixel_values.squeeze() # print (t.shape, type(t),type(t[0][0][0])) # sys.exit() pvs = np.array(Image.open(img_local_path).resize((1280,960))) # image object is wxh, so resize as per that, numpy array of it is hxwxc, transposing to cxwxh # pvs = self.config.processor(Image.open(img_local_path), random_padding=True, return_tensors="np").pixel_values.astype(np.float16).squeeze() # print (type(pvs[0][0][0])) lblids = self.config.processor.tokenizer('<s_class>'+rec['ocwen_template_name']+'</s_class>'+'</s>', add_special_tokens=False, padding=False, truncation=False, return_tensors="np")["input_ids"].squeeze(0) # take padding later, as per batch collating # print (len(lblids),type(lblids[0])) # print (type(pvs),pvs.shape,type(pvs[0][0][0]), type(lblids)) yield id_, {"labels":lblids,"pixel_values":pvs,"image_s3_path":rec['image_s3_path']} id_+=1 os.remove(img_local_path) and I load it inside my trainer script as such `ds = load_dataset("/tmp/DonutDS/dataset/", split="train", streaming=True) # iterable dataset, where .map() falls` or also as `ds = load_from_disk('/tmp/DonutDS/dataset/') #map style dataset` Thank you to the team for having such a great library, and for this bug fix in advance! ### Steps to reproduce the bug Above config can allow one to reproduce the said bug ### Expected behavior .map() should show some consistency b/w map-style and iterable-style datasets, or atleast the docs should address iterable-style datasets behaviour and examples. I honestly do not figure the use of such docs. ### Environment info datasets==2.9.0 transformers==4.26.0
38
Behaviour difference between datasets.map and IterableDatasets.map ### Describe the bug All the examples in all the docs mentioned throughout huggingface datasets correspond to datasets object, and not IterableDatasets object. At one point of time, they might have been in sync, but the code for datasets version >=2.9.0 is very different as compared to the docs. I basically need to .map() a transform on images in an iterable dataset, which was made using a custom databuilder config. This works very good in map-styles datasets, but the .map() fails in IterableDatasets, show behvaiour as such: "pixel_values" key not found, KeyError in examples object/dict passed into transform function for map, which works fine with map style, even as batch. In iterable style, the object/dict passed into map() paramter callable function is completely different as what is mentioned in all examples. Please look into this. Thank you My databuilder class is inherited as such: def _info(self): print ("Config: ",self.config.__dict__.keys()) return datasets.DatasetInfo( description=_DESCRIPTION, features=datasets.Features( { "labels": datasets.Sequence(datasets.Value("uint16")), # "labels_name": datasets.Value("string"), # "pixel_values": datasets.Array3D(shape=(3, 1280, 960), dtype="float32"), "pixel_values": datasets.Array3D(shape=(1280, 960, 3), dtype="uint8"), "image_s3_path": datasets.Value("string"), } ), supervised_keys=None, homepage="none", citation="", ) def _split_generators(self, dl_manager): records_train = list(db.mini_set.find({'split':'train'},{'image_s3_path':1, 'ocwen_template_name':1}))[:10000] records_val = list(db.mini_set.find({'split':'val'},{'image_s3_path':1, 'ocwen_template_name':1}))[:1000] # print (len(records),self.config.num_shards) # shard_size_train = len(records_train)//self.config.num_shards # sharded_records_train = [records_train[i:i+shard_size_train] for i in range(0,len(records_train),shard_size_train)] # shard_size_val = len(records_val)//self.config.num_shards # sharded_records_val = [records_val[i:i+shard_size_val] for i in range(0,len(records_val),shard_size_val)] return [ datasets.SplitGenerator( name=datasets.Split.TRAIN, gen_kwargs={"records":records_train} # passing list of records, for sharding to take over ), datasets.SplitGenerator( name=datasets.Split.VALIDATION, gen_kwargs={"records":records_val} # passing list of records, for sharding to take over ), ] def _generate_examples(self, records): # print ("Generating examples for [{}] shards".format(len(shards))) # initiate_db_connection() # records = list(db.mini_set.find({'split':split},{'image_s3_path':1, 'ocwen_template_name':1}))[:10] id_ = 0 # for records in shards: for i,rec in enumerate(records): img_local_path = fetch_file(rec['image_s3_path'],self.config.buffer_dir) # t = self.config.processor(Image.open(img_local_path), random_padding=True, return_tensors="np").pixel_values.squeeze() # print (t.shape, type(t),type(t[0][0][0])) # sys.exit() pvs = np.array(Image.open(img_local_path).resize((1280,960))) # image object is wxh, so resize as per that, numpy array of it is hxwxc, transposing to cxwxh # pvs = self.config.processor(Image.open(img_local_path), random_padding=True, return_tensors="np").pixel_values.astype(np.float16).squeeze() # print (type(pvs[0][0][0])) lblids = self.config.processor.tokenizer('<s_class>'+rec['ocwen_template_name']+'</s_class>'+'</s>', add_special_tokens=False, padding=False, truncation=False, return_tensors="np")["input_ids"].squeeze(0) # take padding later, as per batch collating # print (len(lblids),type(lblids[0])) # print (type(pvs),pvs.shape,type(pvs[0][0][0]), type(lblids)) yield id_, {"labels":lblids,"pixel_values":pvs,"image_s3_path":rec['image_s3_path']} id_+=1 os.remove(img_local_path) and I load it inside my trainer script as such `ds = load_dataset("/tmp/DonutDS/dataset/", split="train", streaming=True) # iterable dataset, where .map() falls` or also as `ds = load_from_disk('/tmp/DonutDS/dataset/') #map style dataset` Thank you to the team for having such a great library, and for this bug fix in advance! ### Steps to reproduce the bug Above config can allow one to reproduce the said bug ### Expected behavior .map() should show some consistency b/w map-style and iterable-style datasets, or atleast the docs should address iterable-style datasets behaviour and examples. I honestly do not figure the use of such docs. ### Environment info datasets==2.9.0 transformers==4.26.0 PS - some work is definitely needed for 'special cases' docs, not explanations, just usages of 'functions' under mixture of special cases, like a combination of custom databuilder + iterable dataset for large size + dynamic .map() application.
[ -0.08458377420902252, -0.31345874071121216, 0.024995312094688416, 0.20392443239688873, 0.1627897322177887, -0.16763734817504883, 0.36135008931159973, 0.03422381728887558, -0.12551893293857574, 0.039429426193237305, -0.20617347955703735, 0.4666687846183777, -0.27213236689567566, -0.04151483625173569, -0.006431257352232933, 0.13353224098682404, 0.30104127526283264, 0.05368370935320854, -0.3178105354309082, -0.1432105302810669, -0.20404291152954102, 0.38365769386291504, -0.4874667525291443, 0.1660299301147461, -0.09419118613004684, 0.01272519864141941, -0.10414358973503113, 0.033535026013851166, 0.14421600103378296, -0.2568434476852417, 0.6056649088859558, 0.09806964546442032, 0.10764296352863312, 0.6591728925704956, -0.00012982232146896422, 0.10463394969701767, 0.32329607009887695, -0.10735666006803513, -0.12522950768470764, -0.14731478691101074, -0.2711960971355438, 0.11495992541313171, -0.06819187104701996, -0.22855207324028015, -0.02691323310136795, -0.2842739224433899, 0.017382478341460228, -0.18715010583400726, 0.28545308113098145, 0.15063956379890442, 0.09515658020973206, 0.1858527809381485, -0.09138382971286774, -0.15364676713943481, 0.08872967958450317, 0.4564794898033142, -0.24222570657730103, 0.0827258974313736, 0.2921145260334015, -0.07867953181266785, 0.06213613227009773, 0.3470708727836609, -0.1282266229391098, -0.04138268530368805, 0.3410242795944214, 0.04948845133185387, -0.22786083817481995, -0.31175410747528076, 0.08679577708244324, 0.1602555215358734, 0.03850073739886284, -0.31581467390060425, -0.40085214376449585, -0.5002116560935974, -0.36572155356407166, 0.40437471866607666, 0.3323392868041992, -0.22456008195877075, 0.030869245529174805, 0.08264584094285965, -0.6139196157455444, 0.16543227434158325, -0.049849651753902435, 0.2641848921775818, 0.006573379039764404, -0.06171254441142082, -0.42275118827819824, 0.44146642088890076, -0.023148972541093826, -0.20481985807418823, 0.1487254947423935, -0.2647991180419922, 0.0008779168128967285, 0.19125892221927643, -0.07506091892719269, -0.10224401205778122, 0.18093086779117584, 0.09893763065338135, 0.24290619790554047, -0.10511643439531326, 0.06353875249624252, -0.06294212490320206, -0.21112287044525146, -0.02596636489033699, 0.3228519856929779, 0.28607773780822754, 0.11549617350101471, 0.4404328465461731, 0.12239903956651688, 0.18611747026443481, -0.2365076243877411, -0.04917755722999573, 0.4155159294605255, -0.438898503780365, 0.45092809200286865, -0.1404871940612793, 0.4202263355255127, -0.09563395380973816, -0.15409868955612183, -0.28742700815200806, -0.2807036340236664, -0.034912705421447754, 0.25972434878349304, 0.15401270985603333, 0.25846797227859497, -0.18103116750717163, -0.08700567483901978, 0.23501881957054138, -0.049131087958812714, 0.08210298418998718, -0.12969300150871277, -0.17213957011699677, -0.11099904030561447, 0.23130986094474792, 0.07478301227092743, -0.407953679561615, 0.31588348746299744, 0.14473050832748413, -0.10617772489786148, 0.09305234253406525, -0.09363758563995361, -0.1840321123600006, 0.6878251433372498, 0.01572001352906227, -0.38353127241134644, 0.4132109582424164, 0.07818254828453064, -0.22160670161247253, -0.038469940423965454, 0.16512532532215118, -0.25991106033325195, -0.0547313429415226, 0.421555757522583, -0.029842447489500046, -0.24777990579605103, 0.05904311686754227, -0.2920245826244354, 0.4159682095050812, 0.2153213620185852, -0.3923543095588684, 0.33902695775032043, -0.2988593280315399, -0.25361067056655884, -0.30769333243370056, 0.09926316887140274, 0.454037070274353, -0.2742718458175659, -0.28994324803352356, 0.03774530813097954, -0.15548640489578247, 0.10494479537010193, 0.14858604967594147, -0.17689645290374756, 0.24518638849258423, -0.4257543385028839, 0.01616913080215454, 0.3370548486709595, -0.33563709259033203, -0.6956988573074341, 0.4216237962245941, 0.2940901219844818, 0.3603838086128235, -0.2908645570278168, -0.023890435695648193, 0.377821683883667, -0.237627312541008, -0.1983065903186798, -0.02752179279923439, -0.15885435044765472, 0.011394783854484558, -0.016388408839702606, 0.07843855768442154, 0.03781384229660034, -0.05793684720993042, 0.06972838938236237, 0.38910529017448425, 0.20990504324436188, -0.121133953332901, 0.11903974413871765, -0.12151321768760681, 0.1106034442782402, 0.14960050582885742, 0.11981319636106491, -0.11854121088981628, 0.3325773775577545, -0.23647885024547577, -0.5394037961959839, 0.30043017864227295, 0.009765535593032837, -0.13223758339881897, -0.2976323068141937, 0.0751902386546135, -0.09626346081495285, 0.18550872802734375, -0.3818557560443878, -0.28879794478416443, -0.05154937505722046, 0.06075739860534668, 0.28410881757736206, -0.14214737713336945, -0.034272126853466034, 0.11034128814935684, 0.13469816744327545, -0.01149781048297882, -0.18641042709350586, 0.12250445783138275, 0.20221123099327087, -0.18219907581806183, -0.2182469367980957, 0.02365199849009514, 0.24515274167060852, -0.36173880100250244, -0.2177582085132599, 0.3717630207538605, 0.12384982407093048, 0.11142612248659134, -0.19834761321544647, 0.23249542713165283, 0.351683109998703, -0.09877407550811768, -0.025656402111053467, 0.13185660541057587, 0.17543719708919525, -0.1587570309638977, -0.10946852713823318, 0.23299536108970642, -0.0623990073800087, 0.5614493489265442, -0.13493256270885468, 0.031047724187374115, -0.04204550012946129, 0.10119079798460007, -0.4156728684902191, -0.2846629023551941, -0.3585268259048462, -0.1440933346748352, 0.47449401021003723, -0.03482946753501892, 0.036188170313835144, 0.18226394057273865, 0.6840730905532837, 0.01668810099363327, 0.08544698357582092, 0.00272583425976336, -0.2795323133468628, 0.10238136351108551, 0.09007176756858826, 0.2573789060115814, 0.5980340242385864, -0.21876822412014008, 0.07931502163410187, 0.029672374948859215, 0.020012538880109787, 0.08718205988407135, 0.14493180811405182, 0.19727419316768646, 0.5140634775161743, -0.03224290907382965, 0.09760305285453796, 0.10425526648759842, -0.1812434196472168, -0.15512360632419586, -0.19312700629234314, -0.11342907696962357, -0.012401886284351349, 0.2472865730524063, -0.1926117092370987, 0.034327030181884766, -0.16300389170646667, -0.08039145171642303, 0.04732774570584297, -0.24980494379997253, -0.33575621247291565, 0.21932724118232727, -0.0443287119269371, 0.20367416739463806, 0.42367473244667053, 0.08990363031625748, 0.17287053167819977, -0.1639692336320877, -0.14681917428970337, -0.024266881868243217, -0.3322312533855438, -0.20234760642051697, 0.016878630965948105, -0.5430492758750916, 0.13174663484096527, -0.0338248685002327, -0.019045230001211166, -0.5890084505081177, -0.5537012219429016, 0.186553955078125, -0.12509742379188538, 0.30517616868019104, 0.47022199630737305, -0.09259501099586487, 0.06775245070457458, 0.2250203788280487, 0.4262075126171112, -0.2280099093914032, -0.05045796185731888, 0.09180863201618195, -0.053750429302453995, -0.18485067784786224, -0.017617076635360718, -0.0032608024775981903, 0.11266698688268661, -0.023487411439418793, 0.43140068650245667, -0.007899582386016846, 0.04025465250015259, 0.12356898188591003, 0.1631520688533783, -0.021189577877521515, 0.10881567746400833, -0.012309374287724495, -0.0908350870013237, -0.020340703427791595, 0.2307342141866684, -0.21400190889835358, -0.2279471457004547, -0.22626414895057678, -0.08798755705356598, 0.08325327932834625, 0.25268954038619995, -0.2781063914299011, -0.018500398844480515, -0.33656764030456543, 0.13614459335803986, 0.3295731544494629, -0.06455238163471222, 0.3204195201396942, 0.19533944129943848, 0.12344146519899368, -0.37489449977874756, -0.45128047466278076, 0.004225339740514755, 0.1595809906721115, 0.015156153589487076, 0.5928220152854919, 0.3636610209941864, 0.12305870652198792, 0.4995914101600647, 0.49897173047065735, -0.050858814269304276, 0.3330199420452118, 0.040339648723602295, 0.21979252994060516, -0.3284226655960083, -0.44530370831489563, 0.05396800488233566, 0.09310270845890045, -0.0743933916091919, 0.19247928261756897, 0.010475356131792068, -0.17473387718200684, -0.01652476191520691, -0.12395825982093811, -0.07828504592180252, -0.25701969861984253, -0.05784597992897034, 0.1554606854915619, 0.16779495775699615, 0.11875505745410919, 0.30566224455833435, -0.1127871721982956, 0.17186439037322998, 0.22948220372200012, -0.09642188996076584, 0.2915678322315216, -0.05266009271144867, -0.30591022968292236, -0.2211260199546814, -0.2651541233062744, 0.2021588683128357, 0.04323217645287514, 0.3841814398765564, -0.06469093263149261, -0.25264835357666016, 0.05358191207051277, 0.07068915665149689, 1.0037574768066406, -0.31564807891845703, -0.12222365289926529, -0.1563931703567505, -0.28547146916389465, -0.49308082461357117, -0.19796451926231384, -0.15191522240638733, 0.703407883644104, -0.005192454904317856, 0.879098117351532, -0.05047566443681717, -0.2003541737794876, 0.1297091841697693, -0.08484585583209991, -0.041065193712711334, -0.10467535257339478, -0.03490797430276871, -0.22275862097740173, -0.21250374615192413, -0.2280885875225067, 0.06056918948888779, -0.13165487349033356, 0.06488355249166489, -0.22493723034858704, -0.15941599011421204, 0.061281874775886536, -0.18927396833896637, 0.2127971649169922, 0.04436861351132393, -0.07352227717638016, 0.19255220890045166, 0.4093756675720215, 0.0440840907394886, 0.06036210060119629, 0.32420825958251953, -0.13098490238189697, -0.35673758387565613, -0.14275938272476196, -0.010483361780643463, -0.01817929744720459, 0.2604973018169403, -0.20133425295352936, -0.2469894289970398, 0.19780345261096954, 0.011179542168974876, -0.38435328006744385, -0.35534584522247314, 0.6252638697624207, 0.19567598402500153, -0.39765727519989014, -0.5082035064697266, 0.27450865507125854, 0.3377169370651245, -0.2865539789199829, 0.3158341348171234, 0.12767788767814636, -0.3845923840999603, 0.27791228890419006, -0.09038971364498138, 0.5293986797332764, -0.03557400405406952, 0.05164071545004845, 0.16588212549686432, 0.08247257769107819, 0.17113888263702393, 0.4199422597885132, -0.09927621483802795, -0.19698059558868408, -0.4715801775455475, -0.018882133066654205, -0.13148349523544312, 0.10225310176610947, 0.37728479504585266, -0.2470206320285797, 0.303284227848053, 0.15473011136054993, 0.3396899700164795, 0.08777209371328354, -0.377858430147171, 0.18058748543262482, -0.17546235024929047, -0.11712434887886047, 0.0512288361787796, 0.2495066523551941, 0.3346088230609894, 0.06436216831207275, -0.19457343220710754, -0.053260669112205505, -0.12873663008213043, -0.3012198209762573, -0.02298365905880928, -0.4261288642883301, 0.023982323706150055, 0.39354366064071655, -0.21308200061321259, 0.28743651509284973, 0.5573175549507141, 0.370779812335968, -0.1940750926733017, -0.06201536953449249, 0.10868621617555618, 0.20568984746932983, 0.41805291175842285, -0.05945878103375435, -0.20295679569244385, 0.26869258284568787, 0.12334979325532913, 0.03873041272163391, -0.15239444375038147, -0.0336918979883194, -0.025961846113204956, -0.22535744309425354, 0.17234395444393158, -0.059573736041784286, -0.4686022996902466, -0.265939325094223, -0.2249833643436432, -0.14762338995933533, -0.1910889744758606, -0.042177874594926834, -0.14165404438972473, 0.2023821473121643, 0.4187019467353821, -0.18559664487838745, -0.296953022480011, 0.12226930260658264, 0.4377732276916504, -0.1394205540418625, 0.2717558443546295, 0.3997228145599365, -0.15424126386642456, -0.10913899540901184, -0.077871173620224, 0.08359819650650024, 0.19273388385772705, -0.40074825286865234, 0.5041101574897766, -0.21027624607086182, 0.17486879229545593, 0.01254383847117424, 0.3041767179965973, 0.03199150040745735, -0.048826806247234344, -0.293484628200531, -0.18179774284362793, -0.06073160842061043, 0.1365085393190384, -0.06410166621208191, -0.002414002548903227, 0.017531104385852814, -0.22292281687259674, 0.10732617974281311, -0.18218247592449188, -0.16099244356155396, 0.02257758378982544, -0.0002086535096168518, 0.0777234137058258, 0.14591825008392334, 0.27266234159469604, 0.3029453754425049, 0.022362172603607178, -0.11726720631122589, 0.16161870956420898, 0.00693545863032341, -0.053507160395383835, -0.18198761343955994, 0.17720665037631989, 0.23299239575862885, -0.24029119312763214, -0.08477196097373962, -0.08820303529500961, -0.04461824893951416, -0.3675853908061981, 0.49699681997299194, 0.1469617635011673, 0.0631498396396637, 0.3364998698234558, -0.1679723560810089, -0.12730459868907928, 0.15549129247665405, 0.19336864352226257, -0.12956014275550842, 0.11033312976360321, 0.07314816117286682, 0.2289961576461792, -0.08281821012496948, -0.228040874004364, -0.14034956693649292, 0.12279082834720612, 0.14166615903377533, 0.17478759586811066, 0.3525042235851288, -0.3517117202281952, 0.13938282430171967, 0.44643834233283997, 0.25159281492233276, 0.19333139061927795, -0.324952632188797, -0.031326960772275925, -0.04501844942569733, -0.03662971034646034, 0.0018123462796211243, -0.16726036369800568, 0.3084551692008972, -0.027035977691411972, 0.20718657970428467, 0.46251794695854187, -0.09981003403663635, 0.04216304421424866, 0.08158324658870697, -0.03964158892631531, 0.2812236547470093, -0.31388428807258606, 0.1943063884973526, 0.5143686532974243, 0.1384166032075882, 0.30944281816482544, 0.5061781406402588, 0.15323719382286072, 0.06275033205747604, 0.42938169836997986, -0.13015741109848022, 0.10397690534591675, 0.10940849781036377, 0.1283959448337555, 0.7712929844856262, -0.29919740557670593, 0.11769650131464005, 0.08143830299377441, -0.01422596350312233, 0.18091313540935516, -0.042838700115680695, 0.12448779493570328, -0.09605007618665695, -0.18236283957958221, 0.049674615263938904, -0.08398856222629547, -0.1331343650817871, -0.22031542658805847, -0.08712968230247498, -0.17399641871452332, 0.023214519023895264, -0.09097111225128174, -0.30518341064453125, -0.31649091839790344, 0.44419530034065247, -0.06597060710191727, -0.0008383207023143768, -0.293254017829895, -0.23395363986492157, -0.18578165769577026, 0.33447346091270447, -0.0241558700799942, 0.23616589605808258, -0.0729333832859993, 0.0949828252196312, 0.12236261367797852, 0.486696720123291, 0.36782121658325195, 0.383933424949646, -0.2082662433385849, 0.16519419848918915, -0.023867405951023102, -0.23383787274360657, 0.10918581485748291, 0.2196037322282791, -0.5139199495315552, -0.2581234872341156, 0.1566370129585266, -0.04432124271988869, 0.07712197303771973, -0.09579317271709442, 0.16429631412029266, 0.2603778541088104, -0.2270452082157135, 0.007615186274051666, -0.5444303750991821, -0.0323781743645668, 0.012293033301830292, 0.056582365185022354, -0.09708656370639801, -0.4135323166847229, 0.2554088830947876, -0.3946956396102905, 0.3426431715488434, -0.04714405909180641, -0.014333587139844894, 0.0707201361656189, 0.36507099866867065, 0.2151383012533188, 0.05508699640631676, -0.0822746679186821, -0.029162012040615082, -0.21157976984977722, -0.07226860523223877, 0.13844738900661469, 0.07880956679582596, 0.05458589270710945, 0.13364917039871216, -0.196644127368927, -0.18288466334342957, 0.44932156801223755, -0.4429134726524353, 0.09983861446380615, 0.4334571957588196, 0.13045430183410645, -0.4102059006690979, -0.07775655388832092, -0.017945535480976105, 0.19203191995620728, -0.3727303147315979, 0.23777168989181519, -0.1712069809436798, -0.11108031868934631, -0.13229338824748993, 0.21360674500465393, -0.15467679500579834, -0.15477050840854645, 0.2584995925426483, 0.3698246479034424, -0.13830897212028503, -0.09466566890478134, -0.027681276202201843, -0.09526027739048004, -0.03237464651465416, -0.022411350160837173, 0.38370510935783386, -0.26077568531036377, 0.14886489510536194, -0.16914990544319153, -0.1938302367925644, -0.145572692155838, -0.16691312193870544, 0.24425271153450012, -0.022001542150974274, -0.3385935127735138, 0.30201637744903564, -0.317288339138031, -0.04911285638809204, 0.05827440321445465, 0.3073495626449585, -0.12735050916671753, 0.17011669278144836, -0.11003218591213226, -0.3604815602302551, 0.37946945428848267, -0.5288021564483643, -0.2080458402633667, 0.25468647480010986, -0.18086206912994385, 0.09239319711923599, -0.28001075983047485, -0.1486082822084427, -0.14902804791927338, 0.40177464485168457, -0.09619542956352234, -0.13098296523094177, 0.06878980994224548, -0.01721501164138317, 0.017262861132621765, -0.03200678899884224, 0.4841119647026062, 0.10734707117080688, -0.14225254952907562, 0.4328041672706604, -0.0368676483631134 ]
https://github.com/huggingface/datasets/issues/5869
Hi @PhilippeMoussalli thanks for opening a detailed issue. It seems the issue is more related to the `datasets` library so I'll ping @lhoestq @mariosasko on this one :) (edit: also can one of you move the issue to the datasets repo? Thanks in advance 🙏)
Image Encoding Issue when submitting a Parquet Dataset
### Describe the bug Hello, I'd like to report an issue related to pushing a dataset represented as a Parquet file to a dataset repository using Dask. Here are the details: We attempted to load an example dataset in Parquet format from the Hugging Face (HF) filesystem using Dask with the following code snippet: ``` import dask.dataframe as dd df = dd.read_parquet("hf://datasets/lambdalabs/pokemon-blip-captions",index=False) ``` In this dataset, the "image" column is represented as a dictionary/struct with the format: ``` df = df.compute() df["image"].iloc[0].keys() -> dict_keys(['bytes', 'path']) ``` I think this is the format encoded by the [`Image`](https://huggingface.co/docs/datasets/v2.0.0/en/package_reference/main_classes#datasets.Image) feature extractor from datasets to format suitable for Arrow. The next step was to push the dataset to a repository that I created: ``` dd.to_parquet(dask_df, path = "hf://datasets/philippemo/dummy_dataset/data") ``` However, after pushing the dataset using Dask, the "image" column is now represented as the encoded dictionary `(['bytes', 'path'])`, and the images are not properly visualized. You can find the dataset here: [Link to the problematic dataset](https://huggingface.co/datasets/philippemo/dummy_dataset). It's worth noting that both the original dataset and the one submitted with Dask have the same schema with minor alterations related to metadata: **[ Schema of original dummy example.](https://huggingface.co/datasets/lambdalabs/pokemon-blip-captions/blob/main/data/train-00000-of-00001-566cc9b19d7203f8.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` **[ Schema of pushed dataset with dask](https://huggingface.co/datasets/philippemo/dummy_dataset/blob/main/data/part.0.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` This issue seems to be related to an encoding type that occurs when pushing a model to the hub. Normally, models should be represented as an HF dataset before pushing, but we are working with an example where we need to push large datasets using Dask. Could you please provide clarification on how to resolve this issue? Thank you! ### Reproduction To get the schema I downloaded the parquet files and used pyarrow.parquet to read the schema ``` import pyarrow.parquet pyarrow.parquet.read_schema(<path_to_parquet>, memory_map=True) ``` ### Logs _No response_ ### System info ```shell - huggingface_hub version: 0.14.1 - Platform: Linux-5.19.0-41-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /home/philippe/.cache/huggingface/token - Has saved token ?: True - Who am I ?: philippemo - Configured git credential helpers: cache - FastAI: N/A - Tensorflow: N/A - Torch: N/A - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.4.0 - hf_transfer: N/A - gradio: N/A - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /home/philippe/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /home/philippe/.cache/huggingface/assets - HF_TOKEN_PATH: /home/philippe/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
45
Image Encoding Issue when submitting a Parquet Dataset ### Describe the bug Hello, I'd like to report an issue related to pushing a dataset represented as a Parquet file to a dataset repository using Dask. Here are the details: We attempted to load an example dataset in Parquet format from the Hugging Face (HF) filesystem using Dask with the following code snippet: ``` import dask.dataframe as dd df = dd.read_parquet("hf://datasets/lambdalabs/pokemon-blip-captions",index=False) ``` In this dataset, the "image" column is represented as a dictionary/struct with the format: ``` df = df.compute() df["image"].iloc[0].keys() -> dict_keys(['bytes', 'path']) ``` I think this is the format encoded by the [`Image`](https://huggingface.co/docs/datasets/v2.0.0/en/package_reference/main_classes#datasets.Image) feature extractor from datasets to format suitable for Arrow. The next step was to push the dataset to a repository that I created: ``` dd.to_parquet(dask_df, path = "hf://datasets/philippemo/dummy_dataset/data") ``` However, after pushing the dataset using Dask, the "image" column is now represented as the encoded dictionary `(['bytes', 'path'])`, and the images are not properly visualized. You can find the dataset here: [Link to the problematic dataset](https://huggingface.co/datasets/philippemo/dummy_dataset). It's worth noting that both the original dataset and the one submitted with Dask have the same schema with minor alterations related to metadata: **[ Schema of original dummy example.](https://huggingface.co/datasets/lambdalabs/pokemon-blip-captions/blob/main/data/train-00000-of-00001-566cc9b19d7203f8.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` **[ Schema of pushed dataset with dask](https://huggingface.co/datasets/philippemo/dummy_dataset/blob/main/data/part.0.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` This issue seems to be related to an encoding type that occurs when pushing a model to the hub. Normally, models should be represented as an HF dataset before pushing, but we are working with an example where we need to push large datasets using Dask. Could you please provide clarification on how to resolve this issue? Thank you! ### Reproduction To get the schema I downloaded the parquet files and used pyarrow.parquet to read the schema ``` import pyarrow.parquet pyarrow.parquet.read_schema(<path_to_parquet>, memory_map=True) ``` ### Logs _No response_ ### System info ```shell - huggingface_hub version: 0.14.1 - Platform: Linux-5.19.0-41-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /home/philippe/.cache/huggingface/token - Has saved token ?: True - Who am I ?: philippemo - Configured git credential helpers: cache - FastAI: N/A - Tensorflow: N/A - Torch: N/A - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.4.0 - hf_transfer: N/A - gradio: N/A - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /home/philippe/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /home/philippe/.cache/huggingface/assets - HF_TOKEN_PATH: /home/philippe/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` Hi @PhilippeMoussalli thanks for opening a detailed issue. It seems the issue is more related to the `datasets` library so I'll ping @lhoestq @mariosasko on this one :) (edit: also can one of you move the issue to the datasets repo? Thanks in advance 🙏)
[ -0.07916499674320221, -0.19343626499176025, 0.05645659565925598, 0.4631294906139374, 0.24050284922122955, -0.03627727925777435, -0.07235730439424515, 0.15203076601028442, -0.020293869078159332, 0.08434884250164032, 0.2394731044769287, 0.25118616223335266, -0.05058019608259201, 0.1921534389257431, 0.11636337637901306, 0.013332569971680641, 0.23355509340763092, -0.13842418789863586, 0.035421762615442276, -0.1840411126613617, 0.024526141583919525, 0.023211026564240456, 0.09557671844959259, -0.12756088376045227, -0.31958872079849243, -0.12848052382469177, -0.1838715821504593, 0.16795723140239716, -0.29963672161102295, -0.24417482316493988, 0.1643291413784027, -0.0545198954641819, -0.03208453953266144, 0.39378952980041504, -0.0001218078687088564, 0.19774697721004486, 0.34032559394836426, -0.17158105969429016, -0.5198479294776917, -0.07692272961139679, -0.3051050305366516, -0.3085200786590576, 0.05941668152809143, -0.309287965297699, 0.0069709718227386475, -0.25256574153900146, 0.20677407085895538, -0.22702455520629883, 0.4726438522338867, 0.08928938210010529, 0.14610987901687622, 0.005707211792469025, 0.0009384825825691223, 0.26594099402427673, 0.03785824775695801, 0.47385528683662415, -0.04954889416694641, 0.04280170425772667, -0.18786868453025818, 0.24820902943611145, -0.09282605350017548, 0.15272480249404907, 0.08712490648031235, -0.00805438868701458, -0.016361994668841362, 0.20589324831962585, 0.20241717994213104, -0.1180095225572586, 0.10727289319038391, -0.05603448301553726, 0.3830835819244385, -0.36889907717704773, -0.4593268036842346, -0.30965960025787354, -0.03681962192058563, -0.4328514337539673, 0.32440492510795593, 0.2548222243785858, -0.0003364458680152893, 0.03457079827785492, -0.21113935112953186, -0.09784790873527527, -0.018189646303653717, -0.0407535657286644, -0.42851364612579346, -0.08900092542171478, -0.05984817445278168, 0.006623944267630577, -0.19672420620918274, -0.19502106308937073, -0.25219568610191345, -0.3026195466518402, -0.1774444878101349, -0.013072261586785316, 0.01207483746111393, 0.08645853400230408, -0.38594385981559753, -0.17382048070430756, 0.24907076358795166, -0.21245458722114563, -0.02549496293067932, 0.044269971549510956, 0.07893548905849457, 0.03922950476408005, 0.5062429904937744, -0.12927505373954773, -0.03976383060216904, 0.2804526388645172, -0.14378151297569275, 0.2625155448913574, 0.11786860227584839, -0.1301410049200058, -0.09396785497665405, 0.04139737784862518, 0.008238278329372406, -0.33153077960014343, 0.3395339846611023, -0.20103085041046143, -0.26428651809692383, 0.3871088922023773, 0.014363810420036316, 0.15616726875305176, -0.2204391360282898, 0.05782905966043472, -0.05315091088414192, -0.09420032799243927, -0.04410804063081741, 0.47267287969589233, -0.16827616095542908, -0.15016549825668335, -0.1741468757390976, -0.030894160270690918, -0.23196938633918762, -0.18701446056365967, -0.2916504144668579, -0.11245979368686676, 0.10146734118461609, 0.33954858779907227, 0.26186174154281616, -0.0037779733538627625, -0.3535880744457245, -0.17566774785518646, 0.3936227262020111, 0.11428333818912506, -0.181613028049469, 0.07735942304134369, 0.22098040580749512, -0.5117228031158447, -0.022964052855968475, -0.11341151595115662, -0.5474387407302856, 0.2746683657169342, -0.2667553126811981, 0.011132691986858845, -0.08528672158718109, 0.044519055634737015, -0.7847863435745239, 0.2940651476383209, -0.1569625288248062, -0.06727255880832672, -0.0302228145301342, -0.12930867075920105, -0.15981081128120422, -0.05944700911641121, 0.340188592672348, 0.33771514892578125, -0.19652074575424194, -0.0005269423127174377, 0.211419016122818, 0.10521763563156128, 0.43732064962387085, 0.21744775772094727, 0.0002976544201374054, -0.2075202912092209, -0.19594281911849976, 0.2834984064102173, 0.2477104514837265, -0.3083104193210602, -0.3637264370918274, 0.20732124149799347, 0.05494142323732376, 0.5474240183830261, -0.1219802275300026, -0.33859020471572876, 0.706177294254303, 0.026742804795503616, -0.1680281013250351, 0.3964022994041443, -0.05914565175771713, 0.22435082495212555, -0.34280863404273987, -0.13862639665603638, 0.233963280916214, -0.0564732700586319, -0.15170186758041382, -0.03644343838095665, 0.2565060257911682, 0.131291002035141, 0.08944565802812576, -0.013808006420731544, 0.1822938770055771, 0.13118819892406464, 0.07572855055332184, 0.22033259272575378, 0.07828377932310104, 0.08855684101581573, -0.21446797251701355, 0.2078758329153061, 0.07565057277679443, -0.020138951018452644, -0.6611341238021851, -0.05346376821398735, -0.16341593861579895, 0.15432989597320557, -0.3454017639160156, -0.26112934947013855, 0.10302689671516418, -0.18398931622505188, -0.187301367521286, 0.3532286286354065, -0.043276917189359665, 0.4639715552330017, -0.07420756667852402, 0.09023401141166687, -0.0024136528372764587, 0.4434558153152466, 0.16038428246974945, -0.27561497688293457, 0.05932071805000305, 0.11286928504705429, 0.08718172460794449, -0.20341093838214874, -0.03168509528040886, 0.30247241258621216, 0.47361379861831665, 0.2217513471841812, 0.19026757776737213, -0.14624746143817902, 0.34467995166778564, -0.16282746195793152, 0.09265882521867752, 0.05102993920445442, 0.10109417140483856, 0.12053026258945465, -0.3240894675254822, 0.19300389289855957, 0.2009456604719162, 0.11035066843032837, -0.19701902568340302, 0.11846049875020981, 0.24099549651145935, 0.13371887803077698, 0.017451830208301544, -0.22268861532211304, -0.20250633358955383, -0.14895997941493988, 0.01594855636358261, -0.15677784383296967, -0.3826122283935547, -0.09111963212490082, 0.25387585163116455, 0.19720742106437683, -0.07561331987380981, 0.16839781403541565, -0.014281917363405228, -0.09961596876382828, 0.1962994486093521, 0.3102966547012329, -0.16031783819198608, 0.11406266689300537, -0.05157270282506943, -0.04516921192407608, -0.05097324773669243, 0.21072445809841156, 0.0645216554403305, 0.03468870744109154, 0.38239526748657227, 0.09176066517829895, 0.22126369178295135, 0.10599218308925629, -0.289608895778656, 0.3012440502643585, 0.06205640733242035, 0.08901318162679672, -0.130911722779274, 0.24661411345005035, -0.6420296430587769, -0.1346006691455841, -0.250227689743042, 0.5710702538490295, -0.682451605796814, -0.2674350440502167, -0.07291704416275024, -0.13285697996616364, -0.03968258202075958, 0.11197592318058014, -0.16302737593650818, -0.006094217300415039, -0.05273965001106262, -0.19894228875637054, -0.168374165892601, -0.23569059371948242, -0.23182329535484314, -0.027816852554678917, 0.3248855769634247, 0.21233808994293213, 0.38557004928588867, -0.02140980213880539, 0.03407187759876251, -0.518075704574585, -0.19129739701747894, 0.3227287530899048, -0.21198764443397522, 0.19274577498435974, 0.017438102513551712, 0.18571817874908447, -0.3791752755641937, -0.07872322201728821, 0.3171776533126831, 0.29951804876327515, -0.31969359517097473, 0.19377385079860687, 0.07341989874839783, -0.24825848639011383, -0.06052228808403015, 0.3777472674846649, -0.032671406865119934, -0.03471996262669563, 0.07491407543420792, 0.15761052072048187, 0.12044703960418701, 0.05838102102279663, 0.17136725783348083, -0.09452171623706818, 0.03701040893793106, -0.03860544413328171, -0.2712515592575073, -0.3488621711730957, 0.16746753454208374, -0.06116615608334541, -0.3941246271133423, -0.009151890873908997, -0.013774648308753967, 0.09752555936574936, 0.6122156381607056, -0.4919033348560333, -0.14909076690673828, -0.019757017493247986, 0.028535082936286926, 0.20034730434417725, -0.2247292846441269, -0.027866549789905548, -0.13298243284225464, 0.06330052763223648, -0.20220136642456055, -0.2573300898075104, 0.23993903398513794, 0.44075146317481995, 0.32058218121528625, 0.22766725718975067, 0.47231075167655945, 0.07370960712432861, 0.33951127529144287, 0.24130193889141083, -0.05962551757693291, 0.47799065709114075, -0.30464479327201843, 0.40736517310142517, -0.057125747203826904, 0.02726447582244873, 0.07030518352985382, 0.05161358416080475, -0.07665444910526276, 0.10197190940380096, -0.10778730362653732, -0.007601086050271988, 0.1210765466094017, 0.07934093475341797, -0.4577903747558594, -0.20341160893440247, -0.020402031019330025, -0.306393027305603, 0.22629229724407196, -0.05433841049671173, -0.06515920162200928, -0.04452984780073166, 0.001288682222366333, 0.1311672478914261, 0.08704619109630585, 0.2863551080226898, 0.15852703154087067, 0.1519756317138672, 0.20825409889221191, -0.3474852442741394, 0.0844966396689415, 0.08030015230178833, 0.41018542647361755, -0.08110155165195465, 0.14033301174640656, 0.263540118932724, -0.12458974123001099, 0.9913992285728455, -0.07324831932783127, 0.0463947169482708, 0.006614558398723602, -0.22308924794197083, -0.3880262076854706, -0.14035595953464508, -0.07921162247657776, 0.17726217210292816, -0.2802383005619049, 0.4486265480518341, -0.5790385007858276, -0.15004587173461914, -0.00007326342165470123, -0.03217074275016785, -0.2849447727203369, 0.2814604640007019, -0.273240864276886, -0.06345083564519882, -0.1931152641773224, 0.024621507152915, 0.3160390853881836, 0.2254040390253067, 0.29118281602859497, 0.20496916770935059, -0.3069373667240143, 0.3140944540500641, -0.09414389729499817, 0.16854235529899597, 0.7633002400398254, -0.0018072165548801422, 0.11994614452123642, 0.34088411927223206, 0.5542935729026794, 0.4060317575931549, 0.681222677230835, 0.1060827299952507, -0.5684740543365479, -0.026644669473171234, -0.2976146340370178, 0.2752879858016968, 0.3391740322113037, 0.19574227929115295, -0.1426192820072174, -0.2332392781972885, -0.12143495678901672, -0.5962797403335571, 0.0048218779265880585, 0.6384521126747131, -0.06977512687444687, -0.3294113576412201, -0.10974253714084625, 0.26602399349212646, 0.01982904225587845, 0.1059081107378006, -0.1032584011554718, 0.6814203858375549, -0.3524845540523529, 0.29314732551574707, 0.43852463364601135, 0.6986760497093201, -0.31745898723602295, 0.08485960960388184, 0.2611289918422699, -0.41698163747787476, 0.05339523032307625, -0.008640453219413757, -0.16793294250965118, -0.1286677122116089, 0.026765964925289154, -0.002383500337600708, 0.010570414364337921, 0.10287268459796906, 0.05427601933479309, -0.03950437903404236, -0.025233056396245956, -0.13475537300109863, -0.10187064111232758, -0.16843479871749878, 0.26752281188964844, 0.02645270712673664, -0.0855833888053894, -0.30577975511550903, 0.12090219557285309, -0.17668913304805756, -0.24624857306480408, 0.1322004199028015, -0.3132990896701813, -0.3896317481994629, 0.033578477799892426, -0.21205377578735352, 0.17872308194637299, 0.09609001874923706, 0.10728970170021057, 0.10292860865592957, -0.41311413049697876, 0.12592896819114685, 0.3106502294540405, 0.18212267756462097, -0.18301285803318024, -0.09230932593345642, 0.29682376980781555, -0.1273464411497116, 0.10368946194648743, 0.029159806668758392, 0.04628952592611313, 0.3173646926879883, -0.010158903896808624, 0.1919703185558319, -0.3208054304122925, -0.03930879384279251, 0.05043976008892059, -0.09223057329654694, -0.0019683297723531723, 0.29481789469718933, -0.0745924711227417, -0.08492542058229446, -0.20530332624912262, 0.15854820609092712, 0.05422896146774292, -0.0011428743600845337, -0.05587608739733696, 0.13133308291435242, -0.1556420922279358, 0.2875654995441437, -0.12445589900016785, 0.03552263230085373, 0.31148016452789307, -0.20124299824237823, -0.06983207166194916, 0.47928592562675476, -0.2162202000617981, -0.35114753246307373, 0.06262609362602234, -0.15597200393676758, 0.124468132853508, -0.35657575726509094, 0.22543083131313324, -0.3644396960735321, 0.10456603765487671, -0.3070925176143646, -0.08409903198480606, -0.007379754912108183, -0.4085598587989807, -0.09839437156915665, -0.04116646945476532, -0.038579411804676056, 0.3225950300693512, -0.30236488580703735, 0.1972884088754654, 0.06166757643222809, -0.07260958105325699, -0.1025754064321518, -0.16005875170230865, -0.1915740668773651, 0.24606581032276154, 0.07074514776468277, 0.3006419241428375, 0.3208974003791809, 0.03700247034430504, 0.11884783953428268, -0.39820000529289246, 0.08051833510398865, 0.09587366878986359, 0.06930314749479294, -0.021773288026452065, -0.3344597816467285, 0.1346713900566101, -0.028862766921520233, -0.03297141194343567, -0.009161468595266342, -0.08928275108337402, -0.11016947031021118, -0.3043563663959503, 0.06306718289852142, 0.209659144282341, -0.1419305056333542, -0.12058883905410767, 0.9170119762420654, 0.2859131097793579, 0.029125086963176727, -0.08836822211742401, 0.138609379529953, 0.33755743503570557, -0.06887565553188324, -0.02053120546042919, -0.21704143285751343, -0.000537477433681488, 0.06906968355178833, 0.2671671211719513, 0.01341732032597065, 0.05737423524260521, 0.4994564354419708, -0.3344879448413849, 0.21903619170188904, 0.27255484461784363, 0.400823712348938, 0.24880696833133698, -0.2676967978477478, -0.5458172559738159, 0.45789268612861633, 0.08216634392738342, -0.04859311506152153, 0.024749580770730972, 0.44291025400161743, -0.1257719099521637, -0.3181057572364807, 0.033412158489227295, 0.2590599060058594, 0.20852315425872803, -0.5375937819480896, -0.0032423213124275208, 0.42927515506744385, -0.2545764446258545, 0.10580794513225555, 0.08040713518857956, 0.05851776897907257, 0.23365382850170135, 0.026060422882437706, 0.17333675920963287, 0.06848163902759552, 0.3626081645488739, -0.08599037677049637, 0.1869955062866211, 0.3254638612270355, -0.09261880815029144, 0.08684144914150238, -0.11117130517959595, 0.1897805780172348, 0.08123205602169037, 0.04683030769228935, 0.5865591168403625, 0.3055868446826935, 0.10792411863803864, 0.32768091559410095, -0.495758056640625, -0.19348132610321045, 0.05727165937423706, -0.09897714853286743, 0.13845551013946533, 0.12484008073806763, -0.05365820229053497, -0.3922593593597412, 0.25666868686676025, -0.33554723858833313, -0.19774621725082397, -0.13969971239566803, 0.22027626633644104, -0.0032346993684768677, -0.060584839433431625, -0.39027321338653564, -0.15120570361614227, 0.47595852613449097, -0.2736614942550659, 0.2344486266374588, 0.05876272916793823, -0.2052232325077057, 0.23883210122585297, 0.33249086141586304, 0.4195669889450073, 0.07144515216350555, 0.08306039869785309, -0.1600944995880127, 0.281386137008667, 0.02718251198530197, 0.08298996090888977, 0.052955709397792816, -0.09173879772424698, -0.03044990822672844, 0.14321619272232056, 0.05522787570953369, 0.012671142816543579, -0.5502858757972717, 0.3455536663532257, 0.10991154611110687, 0.046859823167324066, -0.19337791204452515, -0.13313499093055725, 0.041244372725486755, -0.19122137129306793, -0.18751804530620575, -0.2555430233478546, -0.33245784044265747, -0.004474034532904625, 0.06573499739170074, 0.09889018535614014, 0.19960926473140717, 0.01873113214969635, -0.038432635366916656, 0.37142181396484375, 0.4363003373146057, -0.30787989497184753, -0.0035356003791093826, -0.12242960184812546, -0.5355163812637329, 0.29517385363578796, -0.269599586725235, -0.4630351662635803, 0.4378815293312073, 0.20798969268798828, 0.13077384233474731, 0.05380599573254585, 0.01805943250656128, 0.1585981696844101, -0.29508212208747864, 0.14028210937976837, -0.26408645510673523, -0.16466931998729706, 0.24281570315361023, -0.19256681203842163, -0.07076211273670197, 0.003395870327949524, 0.35976552963256836, -0.020562320947647095, -0.016280006617307663, 0.09018146991729736, 0.1677822768688202, -0.5286961793899536, -0.4443299174308777, -0.03129997104406357, 0.1747814267873764, 0.19653204083442688, -0.22732099890708923, -0.2542477250099182, -0.22993382811546326, -0.0498366542160511, -0.19927209615707397, 0.5373099446296692, -0.26691287755966187, 0.5406489372253418, 0.06785796582698822, -0.27915582060813904, -0.12024100124835968, 0.2953866720199585, 0.0641380324959755, -0.16347941756248474, -0.1523139327764511, 0.10899059474468231, 0.057386696338653564, -0.07962803542613983, -0.0009504631161689758, 0.26892566680908203, 0.1437426656484604, 0.16440999507904053, 0.061094820499420166, -0.24893951416015625, 0.2889636754989624, -0.3820137083530426, -0.21670272946357727, 0.1949497014284134, -0.07249452918767929, 0.1960967481136322, 0.06945039331912994, -0.42897215485572815, 0.030249804258346558, 0.12145823240280151, -0.22034421563148499, -0.026455849409103394, 0.2109253853559494, 0.1932188868522644, -0.07092390209436417, -0.004424840211868286, 0.07811242341995239, -0.169754296541214, -0.15706488490104675, 0.1803692877292633, -0.11369789391756058 ]
https://github.com/huggingface/datasets/issues/5869
Hi ! The `Image()` info is stored in the **schema metadata**. More precisely there should be a "huggingface" field in the schema metadata that contains the `datasets` feature type of each column. To fix your issue, you can use the same schema as the original Parquet files to write the new ones. You can also get the schema with metadata from a `Features` object, e.g. ```python from datasets import Features, Image, Value features = Features({"image": Image(), "text": Value("string")}) schema = features.arrow_schema print(schema.metadata) # {b'huggingface': b'{"info": {"features": {"image": {"_type": "Image"}, "text": {"dtype": "string", "_type": "Value"}}}}'} ```
Image Encoding Issue when submitting a Parquet Dataset
### Describe the bug Hello, I'd like to report an issue related to pushing a dataset represented as a Parquet file to a dataset repository using Dask. Here are the details: We attempted to load an example dataset in Parquet format from the Hugging Face (HF) filesystem using Dask with the following code snippet: ``` import dask.dataframe as dd df = dd.read_parquet("hf://datasets/lambdalabs/pokemon-blip-captions",index=False) ``` In this dataset, the "image" column is represented as a dictionary/struct with the format: ``` df = df.compute() df["image"].iloc[0].keys() -> dict_keys(['bytes', 'path']) ``` I think this is the format encoded by the [`Image`](https://huggingface.co/docs/datasets/v2.0.0/en/package_reference/main_classes#datasets.Image) feature extractor from datasets to format suitable for Arrow. The next step was to push the dataset to a repository that I created: ``` dd.to_parquet(dask_df, path = "hf://datasets/philippemo/dummy_dataset/data") ``` However, after pushing the dataset using Dask, the "image" column is now represented as the encoded dictionary `(['bytes', 'path'])`, and the images are not properly visualized. You can find the dataset here: [Link to the problematic dataset](https://huggingface.co/datasets/philippemo/dummy_dataset). It's worth noting that both the original dataset and the one submitted with Dask have the same schema with minor alterations related to metadata: **[ Schema of original dummy example.](https://huggingface.co/datasets/lambdalabs/pokemon-blip-captions/blob/main/data/train-00000-of-00001-566cc9b19d7203f8.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` **[ Schema of pushed dataset with dask](https://huggingface.co/datasets/philippemo/dummy_dataset/blob/main/data/part.0.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` This issue seems to be related to an encoding type that occurs when pushing a model to the hub. Normally, models should be represented as an HF dataset before pushing, but we are working with an example where we need to push large datasets using Dask. Could you please provide clarification on how to resolve this issue? Thank you! ### Reproduction To get the schema I downloaded the parquet files and used pyarrow.parquet to read the schema ``` import pyarrow.parquet pyarrow.parquet.read_schema(<path_to_parquet>, memory_map=True) ``` ### Logs _No response_ ### System info ```shell - huggingface_hub version: 0.14.1 - Platform: Linux-5.19.0-41-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /home/philippe/.cache/huggingface/token - Has saved token ?: True - Who am I ?: philippemo - Configured git credential helpers: cache - FastAI: N/A - Tensorflow: N/A - Torch: N/A - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.4.0 - hf_transfer: N/A - gradio: N/A - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /home/philippe/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /home/philippe/.cache/huggingface/assets - HF_TOKEN_PATH: /home/philippe/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
95
Image Encoding Issue when submitting a Parquet Dataset ### Describe the bug Hello, I'd like to report an issue related to pushing a dataset represented as a Parquet file to a dataset repository using Dask. Here are the details: We attempted to load an example dataset in Parquet format from the Hugging Face (HF) filesystem using Dask with the following code snippet: ``` import dask.dataframe as dd df = dd.read_parquet("hf://datasets/lambdalabs/pokemon-blip-captions",index=False) ``` In this dataset, the "image" column is represented as a dictionary/struct with the format: ``` df = df.compute() df["image"].iloc[0].keys() -> dict_keys(['bytes', 'path']) ``` I think this is the format encoded by the [`Image`](https://huggingface.co/docs/datasets/v2.0.0/en/package_reference/main_classes#datasets.Image) feature extractor from datasets to format suitable for Arrow. The next step was to push the dataset to a repository that I created: ``` dd.to_parquet(dask_df, path = "hf://datasets/philippemo/dummy_dataset/data") ``` However, after pushing the dataset using Dask, the "image" column is now represented as the encoded dictionary `(['bytes', 'path'])`, and the images are not properly visualized. You can find the dataset here: [Link to the problematic dataset](https://huggingface.co/datasets/philippemo/dummy_dataset). It's worth noting that both the original dataset and the one submitted with Dask have the same schema with minor alterations related to metadata: **[ Schema of original dummy example.](https://huggingface.co/datasets/lambdalabs/pokemon-blip-captions/blob/main/data/train-00000-of-00001-566cc9b19d7203f8.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` **[ Schema of pushed dataset with dask](https://huggingface.co/datasets/philippemo/dummy_dataset/blob/main/data/part.0.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` This issue seems to be related to an encoding type that occurs when pushing a model to the hub. Normally, models should be represented as an HF dataset before pushing, but we are working with an example where we need to push large datasets using Dask. Could you please provide clarification on how to resolve this issue? Thank you! ### Reproduction To get the schema I downloaded the parquet files and used pyarrow.parquet to read the schema ``` import pyarrow.parquet pyarrow.parquet.read_schema(<path_to_parquet>, memory_map=True) ``` ### Logs _No response_ ### System info ```shell - huggingface_hub version: 0.14.1 - Platform: Linux-5.19.0-41-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /home/philippe/.cache/huggingface/token - Has saved token ?: True - Who am I ?: philippemo - Configured git credential helpers: cache - FastAI: N/A - Tensorflow: N/A - Torch: N/A - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.4.0 - hf_transfer: N/A - gradio: N/A - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /home/philippe/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /home/philippe/.cache/huggingface/assets - HF_TOKEN_PATH: /home/philippe/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` Hi ! The `Image()` info is stored in the **schema metadata**. More precisely there should be a "huggingface" field in the schema metadata that contains the `datasets` feature type of each column. To fix your issue, you can use the same schema as the original Parquet files to write the new ones. You can also get the schema with metadata from a `Features` object, e.g. ```python from datasets import Features, Image, Value features = Features({"image": Image(), "text": Value("string")}) schema = features.arrow_schema print(schema.metadata) # {b'huggingface': b'{"info": {"features": {"image": {"_type": "Image"}, "text": {"dtype": "string", "_type": "Value"}}}}'} ```
[ -0.07916499674320221, -0.19343626499176025, 0.05645659565925598, 0.4631294906139374, 0.24050284922122955, -0.03627727925777435, -0.07235730439424515, 0.15203076601028442, -0.020293869078159332, 0.08434884250164032, 0.2394731044769287, 0.25118616223335266, -0.05058019608259201, 0.1921534389257431, 0.11636337637901306, 0.013332569971680641, 0.23355509340763092, -0.13842418789863586, 0.035421762615442276, -0.1840411126613617, 0.024526141583919525, 0.023211026564240456, 0.09557671844959259, -0.12756088376045227, -0.31958872079849243, -0.12848052382469177, -0.1838715821504593, 0.16795723140239716, -0.29963672161102295, -0.24417482316493988, 0.1643291413784027, -0.0545198954641819, -0.03208453953266144, 0.39378952980041504, -0.0001218078687088564, 0.19774697721004486, 0.34032559394836426, -0.17158105969429016, -0.5198479294776917, -0.07692272961139679, -0.3051050305366516, -0.3085200786590576, 0.05941668152809143, -0.309287965297699, 0.0069709718227386475, -0.25256574153900146, 0.20677407085895538, -0.22702455520629883, 0.4726438522338867, 0.08928938210010529, 0.14610987901687622, 0.005707211792469025, 0.0009384825825691223, 0.26594099402427673, 0.03785824775695801, 0.47385528683662415, -0.04954889416694641, 0.04280170425772667, -0.18786868453025818, 0.24820902943611145, -0.09282605350017548, 0.15272480249404907, 0.08712490648031235, -0.00805438868701458, -0.016361994668841362, 0.20589324831962585, 0.20241717994213104, -0.1180095225572586, 0.10727289319038391, -0.05603448301553726, 0.3830835819244385, -0.36889907717704773, -0.4593268036842346, -0.30965960025787354, -0.03681962192058563, -0.4328514337539673, 0.32440492510795593, 0.2548222243785858, -0.0003364458680152893, 0.03457079827785492, -0.21113935112953186, -0.09784790873527527, -0.018189646303653717, -0.0407535657286644, -0.42851364612579346, -0.08900092542171478, -0.05984817445278168, 0.006623944267630577, -0.19672420620918274, -0.19502106308937073, -0.25219568610191345, -0.3026195466518402, -0.1774444878101349, -0.013072261586785316, 0.01207483746111393, 0.08645853400230408, -0.38594385981559753, -0.17382048070430756, 0.24907076358795166, -0.21245458722114563, -0.02549496293067932, 0.044269971549510956, 0.07893548905849457, 0.03922950476408005, 0.5062429904937744, -0.12927505373954773, -0.03976383060216904, 0.2804526388645172, -0.14378151297569275, 0.2625155448913574, 0.11786860227584839, -0.1301410049200058, -0.09396785497665405, 0.04139737784862518, 0.008238278329372406, -0.33153077960014343, 0.3395339846611023, -0.20103085041046143, -0.26428651809692383, 0.3871088922023773, 0.014363810420036316, 0.15616726875305176, -0.2204391360282898, 0.05782905966043472, -0.05315091088414192, -0.09420032799243927, -0.04410804063081741, 0.47267287969589233, -0.16827616095542908, -0.15016549825668335, -0.1741468757390976, -0.030894160270690918, -0.23196938633918762, -0.18701446056365967, -0.2916504144668579, -0.11245979368686676, 0.10146734118461609, 0.33954858779907227, 0.26186174154281616, -0.0037779733538627625, -0.3535880744457245, -0.17566774785518646, 0.3936227262020111, 0.11428333818912506, -0.181613028049469, 0.07735942304134369, 0.22098040580749512, -0.5117228031158447, -0.022964052855968475, -0.11341151595115662, -0.5474387407302856, 0.2746683657169342, -0.2667553126811981, 0.011132691986858845, -0.08528672158718109, 0.044519055634737015, -0.7847863435745239, 0.2940651476383209, -0.1569625288248062, -0.06727255880832672, -0.0302228145301342, -0.12930867075920105, -0.15981081128120422, -0.05944700911641121, 0.340188592672348, 0.33771514892578125, -0.19652074575424194, -0.0005269423127174377, 0.211419016122818, 0.10521763563156128, 0.43732064962387085, 0.21744775772094727, 0.0002976544201374054, -0.2075202912092209, -0.19594281911849976, 0.2834984064102173, 0.2477104514837265, -0.3083104193210602, -0.3637264370918274, 0.20732124149799347, 0.05494142323732376, 0.5474240183830261, -0.1219802275300026, -0.33859020471572876, 0.706177294254303, 0.026742804795503616, -0.1680281013250351, 0.3964022994041443, -0.05914565175771713, 0.22435082495212555, -0.34280863404273987, -0.13862639665603638, 0.233963280916214, -0.0564732700586319, -0.15170186758041382, -0.03644343838095665, 0.2565060257911682, 0.131291002035141, 0.08944565802812576, -0.013808006420731544, 0.1822938770055771, 0.13118819892406464, 0.07572855055332184, 0.22033259272575378, 0.07828377932310104, 0.08855684101581573, -0.21446797251701355, 0.2078758329153061, 0.07565057277679443, -0.020138951018452644, -0.6611341238021851, -0.05346376821398735, -0.16341593861579895, 0.15432989597320557, -0.3454017639160156, -0.26112934947013855, 0.10302689671516418, -0.18398931622505188, -0.187301367521286, 0.3532286286354065, -0.043276917189359665, 0.4639715552330017, -0.07420756667852402, 0.09023401141166687, -0.0024136528372764587, 0.4434558153152466, 0.16038428246974945, -0.27561497688293457, 0.05932071805000305, 0.11286928504705429, 0.08718172460794449, -0.20341093838214874, -0.03168509528040886, 0.30247241258621216, 0.47361379861831665, 0.2217513471841812, 0.19026757776737213, -0.14624746143817902, 0.34467995166778564, -0.16282746195793152, 0.09265882521867752, 0.05102993920445442, 0.10109417140483856, 0.12053026258945465, -0.3240894675254822, 0.19300389289855957, 0.2009456604719162, 0.11035066843032837, -0.19701902568340302, 0.11846049875020981, 0.24099549651145935, 0.13371887803077698, 0.017451830208301544, -0.22268861532211304, -0.20250633358955383, -0.14895997941493988, 0.01594855636358261, -0.15677784383296967, -0.3826122283935547, -0.09111963212490082, 0.25387585163116455, 0.19720742106437683, -0.07561331987380981, 0.16839781403541565, -0.014281917363405228, -0.09961596876382828, 0.1962994486093521, 0.3102966547012329, -0.16031783819198608, 0.11406266689300537, -0.05157270282506943, -0.04516921192407608, -0.05097324773669243, 0.21072445809841156, 0.0645216554403305, 0.03468870744109154, 0.38239526748657227, 0.09176066517829895, 0.22126369178295135, 0.10599218308925629, -0.289608895778656, 0.3012440502643585, 0.06205640733242035, 0.08901318162679672, -0.130911722779274, 0.24661411345005035, -0.6420296430587769, -0.1346006691455841, -0.250227689743042, 0.5710702538490295, -0.682451605796814, -0.2674350440502167, -0.07291704416275024, -0.13285697996616364, -0.03968258202075958, 0.11197592318058014, -0.16302737593650818, -0.006094217300415039, -0.05273965001106262, -0.19894228875637054, -0.168374165892601, -0.23569059371948242, -0.23182329535484314, -0.027816852554678917, 0.3248855769634247, 0.21233808994293213, 0.38557004928588867, -0.02140980213880539, 0.03407187759876251, -0.518075704574585, -0.19129739701747894, 0.3227287530899048, -0.21198764443397522, 0.19274577498435974, 0.017438102513551712, 0.18571817874908447, -0.3791752755641937, -0.07872322201728821, 0.3171776533126831, 0.29951804876327515, -0.31969359517097473, 0.19377385079860687, 0.07341989874839783, -0.24825848639011383, -0.06052228808403015, 0.3777472674846649, -0.032671406865119934, -0.03471996262669563, 0.07491407543420792, 0.15761052072048187, 0.12044703960418701, 0.05838102102279663, 0.17136725783348083, -0.09452171623706818, 0.03701040893793106, -0.03860544413328171, -0.2712515592575073, -0.3488621711730957, 0.16746753454208374, -0.06116615608334541, -0.3941246271133423, -0.009151890873908997, -0.013774648308753967, 0.09752555936574936, 0.6122156381607056, -0.4919033348560333, -0.14909076690673828, -0.019757017493247986, 0.028535082936286926, 0.20034730434417725, -0.2247292846441269, -0.027866549789905548, -0.13298243284225464, 0.06330052763223648, -0.20220136642456055, -0.2573300898075104, 0.23993903398513794, 0.44075146317481995, 0.32058218121528625, 0.22766725718975067, 0.47231075167655945, 0.07370960712432861, 0.33951127529144287, 0.24130193889141083, -0.05962551757693291, 0.47799065709114075, -0.30464479327201843, 0.40736517310142517, -0.057125747203826904, 0.02726447582244873, 0.07030518352985382, 0.05161358416080475, -0.07665444910526276, 0.10197190940380096, -0.10778730362653732, -0.007601086050271988, 0.1210765466094017, 0.07934093475341797, -0.4577903747558594, -0.20341160893440247, -0.020402031019330025, -0.306393027305603, 0.22629229724407196, -0.05433841049671173, -0.06515920162200928, -0.04452984780073166, 0.001288682222366333, 0.1311672478914261, 0.08704619109630585, 0.2863551080226898, 0.15852703154087067, 0.1519756317138672, 0.20825409889221191, -0.3474852442741394, 0.0844966396689415, 0.08030015230178833, 0.41018542647361755, -0.08110155165195465, 0.14033301174640656, 0.263540118932724, -0.12458974123001099, 0.9913992285728455, -0.07324831932783127, 0.0463947169482708, 0.006614558398723602, -0.22308924794197083, -0.3880262076854706, -0.14035595953464508, -0.07921162247657776, 0.17726217210292816, -0.2802383005619049, 0.4486265480518341, -0.5790385007858276, -0.15004587173461914, -0.00007326342165470123, -0.03217074275016785, -0.2849447727203369, 0.2814604640007019, -0.273240864276886, -0.06345083564519882, -0.1931152641773224, 0.024621507152915, 0.3160390853881836, 0.2254040390253067, 0.29118281602859497, 0.20496916770935059, -0.3069373667240143, 0.3140944540500641, -0.09414389729499817, 0.16854235529899597, 0.7633002400398254, -0.0018072165548801422, 0.11994614452123642, 0.34088411927223206, 0.5542935729026794, 0.4060317575931549, 0.681222677230835, 0.1060827299952507, -0.5684740543365479, -0.026644669473171234, -0.2976146340370178, 0.2752879858016968, 0.3391740322113037, 0.19574227929115295, -0.1426192820072174, -0.2332392781972885, -0.12143495678901672, -0.5962797403335571, 0.0048218779265880585, 0.6384521126747131, -0.06977512687444687, -0.3294113576412201, -0.10974253714084625, 0.26602399349212646, 0.01982904225587845, 0.1059081107378006, -0.1032584011554718, 0.6814203858375549, -0.3524845540523529, 0.29314732551574707, 0.43852463364601135, 0.6986760497093201, -0.31745898723602295, 0.08485960960388184, 0.2611289918422699, -0.41698163747787476, 0.05339523032307625, -0.008640453219413757, -0.16793294250965118, -0.1286677122116089, 0.026765964925289154, -0.002383500337600708, 0.010570414364337921, 0.10287268459796906, 0.05427601933479309, -0.03950437903404236, -0.025233056396245956, -0.13475537300109863, -0.10187064111232758, -0.16843479871749878, 0.26752281188964844, 0.02645270712673664, -0.0855833888053894, -0.30577975511550903, 0.12090219557285309, -0.17668913304805756, -0.24624857306480408, 0.1322004199028015, -0.3132990896701813, -0.3896317481994629, 0.033578477799892426, -0.21205377578735352, 0.17872308194637299, 0.09609001874923706, 0.10728970170021057, 0.10292860865592957, -0.41311413049697876, 0.12592896819114685, 0.3106502294540405, 0.18212267756462097, -0.18301285803318024, -0.09230932593345642, 0.29682376980781555, -0.1273464411497116, 0.10368946194648743, 0.029159806668758392, 0.04628952592611313, 0.3173646926879883, -0.010158903896808624, 0.1919703185558319, -0.3208054304122925, -0.03930879384279251, 0.05043976008892059, -0.09223057329654694, -0.0019683297723531723, 0.29481789469718933, -0.0745924711227417, -0.08492542058229446, -0.20530332624912262, 0.15854820609092712, 0.05422896146774292, -0.0011428743600845337, -0.05587608739733696, 0.13133308291435242, -0.1556420922279358, 0.2875654995441437, -0.12445589900016785, 0.03552263230085373, 0.31148016452789307, -0.20124299824237823, -0.06983207166194916, 0.47928592562675476, -0.2162202000617981, -0.35114753246307373, 0.06262609362602234, -0.15597200393676758, 0.124468132853508, -0.35657575726509094, 0.22543083131313324, -0.3644396960735321, 0.10456603765487671, -0.3070925176143646, -0.08409903198480606, -0.007379754912108183, -0.4085598587989807, -0.09839437156915665, -0.04116646945476532, -0.038579411804676056, 0.3225950300693512, -0.30236488580703735, 0.1972884088754654, 0.06166757643222809, -0.07260958105325699, -0.1025754064321518, -0.16005875170230865, -0.1915740668773651, 0.24606581032276154, 0.07074514776468277, 0.3006419241428375, 0.3208974003791809, 0.03700247034430504, 0.11884783953428268, -0.39820000529289246, 0.08051833510398865, 0.09587366878986359, 0.06930314749479294, -0.021773288026452065, -0.3344597816467285, 0.1346713900566101, -0.028862766921520233, -0.03297141194343567, -0.009161468595266342, -0.08928275108337402, -0.11016947031021118, -0.3043563663959503, 0.06306718289852142, 0.209659144282341, -0.1419305056333542, -0.12058883905410767, 0.9170119762420654, 0.2859131097793579, 0.029125086963176727, -0.08836822211742401, 0.138609379529953, 0.33755743503570557, -0.06887565553188324, -0.02053120546042919, -0.21704143285751343, -0.000537477433681488, 0.06906968355178833, 0.2671671211719513, 0.01341732032597065, 0.05737423524260521, 0.4994564354419708, -0.3344879448413849, 0.21903619170188904, 0.27255484461784363, 0.400823712348938, 0.24880696833133698, -0.2676967978477478, -0.5458172559738159, 0.45789268612861633, 0.08216634392738342, -0.04859311506152153, 0.024749580770730972, 0.44291025400161743, -0.1257719099521637, -0.3181057572364807, 0.033412158489227295, 0.2590599060058594, 0.20852315425872803, -0.5375937819480896, -0.0032423213124275208, 0.42927515506744385, -0.2545764446258545, 0.10580794513225555, 0.08040713518857956, 0.05851776897907257, 0.23365382850170135, 0.026060422882437706, 0.17333675920963287, 0.06848163902759552, 0.3626081645488739, -0.08599037677049637, 0.1869955062866211, 0.3254638612270355, -0.09261880815029144, 0.08684144914150238, -0.11117130517959595, 0.1897805780172348, 0.08123205602169037, 0.04683030769228935, 0.5865591168403625, 0.3055868446826935, 0.10792411863803864, 0.32768091559410095, -0.495758056640625, -0.19348132610321045, 0.05727165937423706, -0.09897714853286743, 0.13845551013946533, 0.12484008073806763, -0.05365820229053497, -0.3922593593597412, 0.25666868686676025, -0.33554723858833313, -0.19774621725082397, -0.13969971239566803, 0.22027626633644104, -0.0032346993684768677, -0.060584839433431625, -0.39027321338653564, -0.15120570361614227, 0.47595852613449097, -0.2736614942550659, 0.2344486266374588, 0.05876272916793823, -0.2052232325077057, 0.23883210122585297, 0.33249086141586304, 0.4195669889450073, 0.07144515216350555, 0.08306039869785309, -0.1600944995880127, 0.281386137008667, 0.02718251198530197, 0.08298996090888977, 0.052955709397792816, -0.09173879772424698, -0.03044990822672844, 0.14321619272232056, 0.05522787570953369, 0.012671142816543579, -0.5502858757972717, 0.3455536663532257, 0.10991154611110687, 0.046859823167324066, -0.19337791204452515, -0.13313499093055725, 0.041244372725486755, -0.19122137129306793, -0.18751804530620575, -0.2555430233478546, -0.33245784044265747, -0.004474034532904625, 0.06573499739170074, 0.09889018535614014, 0.19960926473140717, 0.01873113214969635, -0.038432635366916656, 0.37142181396484375, 0.4363003373146057, -0.30787989497184753, -0.0035356003791093826, -0.12242960184812546, -0.5355163812637329, 0.29517385363578796, -0.269599586725235, -0.4630351662635803, 0.4378815293312073, 0.20798969268798828, 0.13077384233474731, 0.05380599573254585, 0.01805943250656128, 0.1585981696844101, -0.29508212208747864, 0.14028210937976837, -0.26408645510673523, -0.16466931998729706, 0.24281570315361023, -0.19256681203842163, -0.07076211273670197, 0.003395870327949524, 0.35976552963256836, -0.020562320947647095, -0.016280006617307663, 0.09018146991729736, 0.1677822768688202, -0.5286961793899536, -0.4443299174308777, -0.03129997104406357, 0.1747814267873764, 0.19653204083442688, -0.22732099890708923, -0.2542477250099182, -0.22993382811546326, -0.0498366542160511, -0.19927209615707397, 0.5373099446296692, -0.26691287755966187, 0.5406489372253418, 0.06785796582698822, -0.27915582060813904, -0.12024100124835968, 0.2953866720199585, 0.0641380324959755, -0.16347941756248474, -0.1523139327764511, 0.10899059474468231, 0.057386696338653564, -0.07962803542613983, -0.0009504631161689758, 0.26892566680908203, 0.1437426656484604, 0.16440999507904053, 0.061094820499420166, -0.24893951416015625, 0.2889636754989624, -0.3820137083530426, -0.21670272946357727, 0.1949497014284134, -0.07249452918767929, 0.1960967481136322, 0.06945039331912994, -0.42897215485572815, 0.030249804258346558, 0.12145823240280151, -0.22034421563148499, -0.026455849409103394, 0.2109253853559494, 0.1932188868522644, -0.07092390209436417, -0.004424840211868286, 0.07811242341995239, -0.169754296541214, -0.15706488490104675, 0.1803692877292633, -0.11369789391756058 ]
https://github.com/huggingface/datasets/issues/5869
It appears that the parquet files at `hf://datasets/lambdalabs/pokemon-blip-captions` don't have this metadata, and it is defined in the dataset_infos.json instead (legacy). You can get the right schema with the HF metadata this way: ```python from datasets import load_dataset_builder features = load_dataset_builder("lambdalabs/pokemon-blip-captions").info.features schema = features.arrow_schema ```
Image Encoding Issue when submitting a Parquet Dataset
### Describe the bug Hello, I'd like to report an issue related to pushing a dataset represented as a Parquet file to a dataset repository using Dask. Here are the details: We attempted to load an example dataset in Parquet format from the Hugging Face (HF) filesystem using Dask with the following code snippet: ``` import dask.dataframe as dd df = dd.read_parquet("hf://datasets/lambdalabs/pokemon-blip-captions",index=False) ``` In this dataset, the "image" column is represented as a dictionary/struct with the format: ``` df = df.compute() df["image"].iloc[0].keys() -> dict_keys(['bytes', 'path']) ``` I think this is the format encoded by the [`Image`](https://huggingface.co/docs/datasets/v2.0.0/en/package_reference/main_classes#datasets.Image) feature extractor from datasets to format suitable for Arrow. The next step was to push the dataset to a repository that I created: ``` dd.to_parquet(dask_df, path = "hf://datasets/philippemo/dummy_dataset/data") ``` However, after pushing the dataset using Dask, the "image" column is now represented as the encoded dictionary `(['bytes', 'path'])`, and the images are not properly visualized. You can find the dataset here: [Link to the problematic dataset](https://huggingface.co/datasets/philippemo/dummy_dataset). It's worth noting that both the original dataset and the one submitted with Dask have the same schema with minor alterations related to metadata: **[ Schema of original dummy example.](https://huggingface.co/datasets/lambdalabs/pokemon-blip-captions/blob/main/data/train-00000-of-00001-566cc9b19d7203f8.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` **[ Schema of pushed dataset with dask](https://huggingface.co/datasets/philippemo/dummy_dataset/blob/main/data/part.0.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` This issue seems to be related to an encoding type that occurs when pushing a model to the hub. Normally, models should be represented as an HF dataset before pushing, but we are working with an example where we need to push large datasets using Dask. Could you please provide clarification on how to resolve this issue? Thank you! ### Reproduction To get the schema I downloaded the parquet files and used pyarrow.parquet to read the schema ``` import pyarrow.parquet pyarrow.parquet.read_schema(<path_to_parquet>, memory_map=True) ``` ### Logs _No response_ ### System info ```shell - huggingface_hub version: 0.14.1 - Platform: Linux-5.19.0-41-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /home/philippe/.cache/huggingface/token - Has saved token ?: True - Who am I ?: philippemo - Configured git credential helpers: cache - FastAI: N/A - Tensorflow: N/A - Torch: N/A - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.4.0 - hf_transfer: N/A - gradio: N/A - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /home/philippe/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /home/philippe/.cache/huggingface/assets - HF_TOKEN_PATH: /home/philippe/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
45
Image Encoding Issue when submitting a Parquet Dataset ### Describe the bug Hello, I'd like to report an issue related to pushing a dataset represented as a Parquet file to a dataset repository using Dask. Here are the details: We attempted to load an example dataset in Parquet format from the Hugging Face (HF) filesystem using Dask with the following code snippet: ``` import dask.dataframe as dd df = dd.read_parquet("hf://datasets/lambdalabs/pokemon-blip-captions",index=False) ``` In this dataset, the "image" column is represented as a dictionary/struct with the format: ``` df = df.compute() df["image"].iloc[0].keys() -> dict_keys(['bytes', 'path']) ``` I think this is the format encoded by the [`Image`](https://huggingface.co/docs/datasets/v2.0.0/en/package_reference/main_classes#datasets.Image) feature extractor from datasets to format suitable for Arrow. The next step was to push the dataset to a repository that I created: ``` dd.to_parquet(dask_df, path = "hf://datasets/philippemo/dummy_dataset/data") ``` However, after pushing the dataset using Dask, the "image" column is now represented as the encoded dictionary `(['bytes', 'path'])`, and the images are not properly visualized. You can find the dataset here: [Link to the problematic dataset](https://huggingface.co/datasets/philippemo/dummy_dataset). It's worth noting that both the original dataset and the one submitted with Dask have the same schema with minor alterations related to metadata: **[ Schema of original dummy example.](https://huggingface.co/datasets/lambdalabs/pokemon-blip-captions/blob/main/data/train-00000-of-00001-566cc9b19d7203f8.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` **[ Schema of pushed dataset with dask](https://huggingface.co/datasets/philippemo/dummy_dataset/blob/main/data/part.0.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` This issue seems to be related to an encoding type that occurs when pushing a model to the hub. Normally, models should be represented as an HF dataset before pushing, but we are working with an example where we need to push large datasets using Dask. Could you please provide clarification on how to resolve this issue? Thank you! ### Reproduction To get the schema I downloaded the parquet files and used pyarrow.parquet to read the schema ``` import pyarrow.parquet pyarrow.parquet.read_schema(<path_to_parquet>, memory_map=True) ``` ### Logs _No response_ ### System info ```shell - huggingface_hub version: 0.14.1 - Platform: Linux-5.19.0-41-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /home/philippe/.cache/huggingface/token - Has saved token ?: True - Who am I ?: philippemo - Configured git credential helpers: cache - FastAI: N/A - Tensorflow: N/A - Torch: N/A - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.4.0 - hf_transfer: N/A - gradio: N/A - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /home/philippe/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /home/philippe/.cache/huggingface/assets - HF_TOKEN_PATH: /home/philippe/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` It appears that the parquet files at `hf://datasets/lambdalabs/pokemon-blip-captions` don't have this metadata, and it is defined in the dataset_infos.json instead (legacy). You can get the right schema with the HF metadata this way: ```python from datasets import load_dataset_builder features = load_dataset_builder("lambdalabs/pokemon-blip-captions").info.features schema = features.arrow_schema ```
[ -0.07916499674320221, -0.19343626499176025, 0.05645659565925598, 0.4631294906139374, 0.24050284922122955, -0.03627727925777435, -0.07235730439424515, 0.15203076601028442, -0.020293869078159332, 0.08434884250164032, 0.2394731044769287, 0.25118616223335266, -0.05058019608259201, 0.1921534389257431, 0.11636337637901306, 0.013332569971680641, 0.23355509340763092, -0.13842418789863586, 0.035421762615442276, -0.1840411126613617, 0.024526141583919525, 0.023211026564240456, 0.09557671844959259, -0.12756088376045227, -0.31958872079849243, -0.12848052382469177, -0.1838715821504593, 0.16795723140239716, -0.29963672161102295, -0.24417482316493988, 0.1643291413784027, -0.0545198954641819, -0.03208453953266144, 0.39378952980041504, -0.0001218078687088564, 0.19774697721004486, 0.34032559394836426, -0.17158105969429016, -0.5198479294776917, -0.07692272961139679, -0.3051050305366516, -0.3085200786590576, 0.05941668152809143, -0.309287965297699, 0.0069709718227386475, -0.25256574153900146, 0.20677407085895538, -0.22702455520629883, 0.4726438522338867, 0.08928938210010529, 0.14610987901687622, 0.005707211792469025, 0.0009384825825691223, 0.26594099402427673, 0.03785824775695801, 0.47385528683662415, -0.04954889416694641, 0.04280170425772667, -0.18786868453025818, 0.24820902943611145, -0.09282605350017548, 0.15272480249404907, 0.08712490648031235, -0.00805438868701458, -0.016361994668841362, 0.20589324831962585, 0.20241717994213104, -0.1180095225572586, 0.10727289319038391, -0.05603448301553726, 0.3830835819244385, -0.36889907717704773, -0.4593268036842346, -0.30965960025787354, -0.03681962192058563, -0.4328514337539673, 0.32440492510795593, 0.2548222243785858, -0.0003364458680152893, 0.03457079827785492, -0.21113935112953186, -0.09784790873527527, -0.018189646303653717, -0.0407535657286644, -0.42851364612579346, -0.08900092542171478, -0.05984817445278168, 0.006623944267630577, -0.19672420620918274, -0.19502106308937073, -0.25219568610191345, -0.3026195466518402, -0.1774444878101349, -0.013072261586785316, 0.01207483746111393, 0.08645853400230408, -0.38594385981559753, -0.17382048070430756, 0.24907076358795166, -0.21245458722114563, -0.02549496293067932, 0.044269971549510956, 0.07893548905849457, 0.03922950476408005, 0.5062429904937744, -0.12927505373954773, -0.03976383060216904, 0.2804526388645172, -0.14378151297569275, 0.2625155448913574, 0.11786860227584839, -0.1301410049200058, -0.09396785497665405, 0.04139737784862518, 0.008238278329372406, -0.33153077960014343, 0.3395339846611023, -0.20103085041046143, -0.26428651809692383, 0.3871088922023773, 0.014363810420036316, 0.15616726875305176, -0.2204391360282898, 0.05782905966043472, -0.05315091088414192, -0.09420032799243927, -0.04410804063081741, 0.47267287969589233, -0.16827616095542908, -0.15016549825668335, -0.1741468757390976, -0.030894160270690918, -0.23196938633918762, -0.18701446056365967, -0.2916504144668579, -0.11245979368686676, 0.10146734118461609, 0.33954858779907227, 0.26186174154281616, -0.0037779733538627625, -0.3535880744457245, -0.17566774785518646, 0.3936227262020111, 0.11428333818912506, -0.181613028049469, 0.07735942304134369, 0.22098040580749512, -0.5117228031158447, -0.022964052855968475, -0.11341151595115662, -0.5474387407302856, 0.2746683657169342, -0.2667553126811981, 0.011132691986858845, -0.08528672158718109, 0.044519055634737015, -0.7847863435745239, 0.2940651476383209, -0.1569625288248062, -0.06727255880832672, -0.0302228145301342, -0.12930867075920105, -0.15981081128120422, -0.05944700911641121, 0.340188592672348, 0.33771514892578125, -0.19652074575424194, -0.0005269423127174377, 0.211419016122818, 0.10521763563156128, 0.43732064962387085, 0.21744775772094727, 0.0002976544201374054, -0.2075202912092209, -0.19594281911849976, 0.2834984064102173, 0.2477104514837265, -0.3083104193210602, -0.3637264370918274, 0.20732124149799347, 0.05494142323732376, 0.5474240183830261, -0.1219802275300026, -0.33859020471572876, 0.706177294254303, 0.026742804795503616, -0.1680281013250351, 0.3964022994041443, -0.05914565175771713, 0.22435082495212555, -0.34280863404273987, -0.13862639665603638, 0.233963280916214, -0.0564732700586319, -0.15170186758041382, -0.03644343838095665, 0.2565060257911682, 0.131291002035141, 0.08944565802812576, -0.013808006420731544, 0.1822938770055771, 0.13118819892406464, 0.07572855055332184, 0.22033259272575378, 0.07828377932310104, 0.08855684101581573, -0.21446797251701355, 0.2078758329153061, 0.07565057277679443, -0.020138951018452644, -0.6611341238021851, -0.05346376821398735, -0.16341593861579895, 0.15432989597320557, -0.3454017639160156, -0.26112934947013855, 0.10302689671516418, -0.18398931622505188, -0.187301367521286, 0.3532286286354065, -0.043276917189359665, 0.4639715552330017, -0.07420756667852402, 0.09023401141166687, -0.0024136528372764587, 0.4434558153152466, 0.16038428246974945, -0.27561497688293457, 0.05932071805000305, 0.11286928504705429, 0.08718172460794449, -0.20341093838214874, -0.03168509528040886, 0.30247241258621216, 0.47361379861831665, 0.2217513471841812, 0.19026757776737213, -0.14624746143817902, 0.34467995166778564, -0.16282746195793152, 0.09265882521867752, 0.05102993920445442, 0.10109417140483856, 0.12053026258945465, -0.3240894675254822, 0.19300389289855957, 0.2009456604719162, 0.11035066843032837, -0.19701902568340302, 0.11846049875020981, 0.24099549651145935, 0.13371887803077698, 0.017451830208301544, -0.22268861532211304, -0.20250633358955383, -0.14895997941493988, 0.01594855636358261, -0.15677784383296967, -0.3826122283935547, -0.09111963212490082, 0.25387585163116455, 0.19720742106437683, -0.07561331987380981, 0.16839781403541565, -0.014281917363405228, -0.09961596876382828, 0.1962994486093521, 0.3102966547012329, -0.16031783819198608, 0.11406266689300537, -0.05157270282506943, -0.04516921192407608, -0.05097324773669243, 0.21072445809841156, 0.0645216554403305, 0.03468870744109154, 0.38239526748657227, 0.09176066517829895, 0.22126369178295135, 0.10599218308925629, -0.289608895778656, 0.3012440502643585, 0.06205640733242035, 0.08901318162679672, -0.130911722779274, 0.24661411345005035, -0.6420296430587769, -0.1346006691455841, -0.250227689743042, 0.5710702538490295, -0.682451605796814, -0.2674350440502167, -0.07291704416275024, -0.13285697996616364, -0.03968258202075958, 0.11197592318058014, -0.16302737593650818, -0.006094217300415039, -0.05273965001106262, -0.19894228875637054, -0.168374165892601, -0.23569059371948242, -0.23182329535484314, -0.027816852554678917, 0.3248855769634247, 0.21233808994293213, 0.38557004928588867, -0.02140980213880539, 0.03407187759876251, -0.518075704574585, -0.19129739701747894, 0.3227287530899048, -0.21198764443397522, 0.19274577498435974, 0.017438102513551712, 0.18571817874908447, -0.3791752755641937, -0.07872322201728821, 0.3171776533126831, 0.29951804876327515, -0.31969359517097473, 0.19377385079860687, 0.07341989874839783, -0.24825848639011383, -0.06052228808403015, 0.3777472674846649, -0.032671406865119934, -0.03471996262669563, 0.07491407543420792, 0.15761052072048187, 0.12044703960418701, 0.05838102102279663, 0.17136725783348083, -0.09452171623706818, 0.03701040893793106, -0.03860544413328171, -0.2712515592575073, -0.3488621711730957, 0.16746753454208374, -0.06116615608334541, -0.3941246271133423, -0.009151890873908997, -0.013774648308753967, 0.09752555936574936, 0.6122156381607056, -0.4919033348560333, -0.14909076690673828, -0.019757017493247986, 0.028535082936286926, 0.20034730434417725, -0.2247292846441269, -0.027866549789905548, -0.13298243284225464, 0.06330052763223648, -0.20220136642456055, -0.2573300898075104, 0.23993903398513794, 0.44075146317481995, 0.32058218121528625, 0.22766725718975067, 0.47231075167655945, 0.07370960712432861, 0.33951127529144287, 0.24130193889141083, -0.05962551757693291, 0.47799065709114075, -0.30464479327201843, 0.40736517310142517, -0.057125747203826904, 0.02726447582244873, 0.07030518352985382, 0.05161358416080475, -0.07665444910526276, 0.10197190940380096, -0.10778730362653732, -0.007601086050271988, 0.1210765466094017, 0.07934093475341797, -0.4577903747558594, -0.20341160893440247, -0.020402031019330025, -0.306393027305603, 0.22629229724407196, -0.05433841049671173, -0.06515920162200928, -0.04452984780073166, 0.001288682222366333, 0.1311672478914261, 0.08704619109630585, 0.2863551080226898, 0.15852703154087067, 0.1519756317138672, 0.20825409889221191, -0.3474852442741394, 0.0844966396689415, 0.08030015230178833, 0.41018542647361755, -0.08110155165195465, 0.14033301174640656, 0.263540118932724, -0.12458974123001099, 0.9913992285728455, -0.07324831932783127, 0.0463947169482708, 0.006614558398723602, -0.22308924794197083, -0.3880262076854706, -0.14035595953464508, -0.07921162247657776, 0.17726217210292816, -0.2802383005619049, 0.4486265480518341, -0.5790385007858276, -0.15004587173461914, -0.00007326342165470123, -0.03217074275016785, -0.2849447727203369, 0.2814604640007019, -0.273240864276886, -0.06345083564519882, -0.1931152641773224, 0.024621507152915, 0.3160390853881836, 0.2254040390253067, 0.29118281602859497, 0.20496916770935059, -0.3069373667240143, 0.3140944540500641, -0.09414389729499817, 0.16854235529899597, 0.7633002400398254, -0.0018072165548801422, 0.11994614452123642, 0.34088411927223206, 0.5542935729026794, 0.4060317575931549, 0.681222677230835, 0.1060827299952507, -0.5684740543365479, -0.026644669473171234, -0.2976146340370178, 0.2752879858016968, 0.3391740322113037, 0.19574227929115295, -0.1426192820072174, -0.2332392781972885, -0.12143495678901672, -0.5962797403335571, 0.0048218779265880585, 0.6384521126747131, -0.06977512687444687, -0.3294113576412201, -0.10974253714084625, 0.26602399349212646, 0.01982904225587845, 0.1059081107378006, -0.1032584011554718, 0.6814203858375549, -0.3524845540523529, 0.29314732551574707, 0.43852463364601135, 0.6986760497093201, -0.31745898723602295, 0.08485960960388184, 0.2611289918422699, -0.41698163747787476, 0.05339523032307625, -0.008640453219413757, -0.16793294250965118, -0.1286677122116089, 0.026765964925289154, -0.002383500337600708, 0.010570414364337921, 0.10287268459796906, 0.05427601933479309, -0.03950437903404236, -0.025233056396245956, -0.13475537300109863, -0.10187064111232758, -0.16843479871749878, 0.26752281188964844, 0.02645270712673664, -0.0855833888053894, -0.30577975511550903, 0.12090219557285309, -0.17668913304805756, -0.24624857306480408, 0.1322004199028015, -0.3132990896701813, -0.3896317481994629, 0.033578477799892426, -0.21205377578735352, 0.17872308194637299, 0.09609001874923706, 0.10728970170021057, 0.10292860865592957, -0.41311413049697876, 0.12592896819114685, 0.3106502294540405, 0.18212267756462097, -0.18301285803318024, -0.09230932593345642, 0.29682376980781555, -0.1273464411497116, 0.10368946194648743, 0.029159806668758392, 0.04628952592611313, 0.3173646926879883, -0.010158903896808624, 0.1919703185558319, -0.3208054304122925, -0.03930879384279251, 0.05043976008892059, -0.09223057329654694, -0.0019683297723531723, 0.29481789469718933, -0.0745924711227417, -0.08492542058229446, -0.20530332624912262, 0.15854820609092712, 0.05422896146774292, -0.0011428743600845337, -0.05587608739733696, 0.13133308291435242, -0.1556420922279358, 0.2875654995441437, -0.12445589900016785, 0.03552263230085373, 0.31148016452789307, -0.20124299824237823, -0.06983207166194916, 0.47928592562675476, -0.2162202000617981, -0.35114753246307373, 0.06262609362602234, -0.15597200393676758, 0.124468132853508, -0.35657575726509094, 0.22543083131313324, -0.3644396960735321, 0.10456603765487671, -0.3070925176143646, -0.08409903198480606, -0.007379754912108183, -0.4085598587989807, -0.09839437156915665, -0.04116646945476532, -0.038579411804676056, 0.3225950300693512, -0.30236488580703735, 0.1972884088754654, 0.06166757643222809, -0.07260958105325699, -0.1025754064321518, -0.16005875170230865, -0.1915740668773651, 0.24606581032276154, 0.07074514776468277, 0.3006419241428375, 0.3208974003791809, 0.03700247034430504, 0.11884783953428268, -0.39820000529289246, 0.08051833510398865, 0.09587366878986359, 0.06930314749479294, -0.021773288026452065, -0.3344597816467285, 0.1346713900566101, -0.028862766921520233, -0.03297141194343567, -0.009161468595266342, -0.08928275108337402, -0.11016947031021118, -0.3043563663959503, 0.06306718289852142, 0.209659144282341, -0.1419305056333542, -0.12058883905410767, 0.9170119762420654, 0.2859131097793579, 0.029125086963176727, -0.08836822211742401, 0.138609379529953, 0.33755743503570557, -0.06887565553188324, -0.02053120546042919, -0.21704143285751343, -0.000537477433681488, 0.06906968355178833, 0.2671671211719513, 0.01341732032597065, 0.05737423524260521, 0.4994564354419708, -0.3344879448413849, 0.21903619170188904, 0.27255484461784363, 0.400823712348938, 0.24880696833133698, -0.2676967978477478, -0.5458172559738159, 0.45789268612861633, 0.08216634392738342, -0.04859311506152153, 0.024749580770730972, 0.44291025400161743, -0.1257719099521637, -0.3181057572364807, 0.033412158489227295, 0.2590599060058594, 0.20852315425872803, -0.5375937819480896, -0.0032423213124275208, 0.42927515506744385, -0.2545764446258545, 0.10580794513225555, 0.08040713518857956, 0.05851776897907257, 0.23365382850170135, 0.026060422882437706, 0.17333675920963287, 0.06848163902759552, 0.3626081645488739, -0.08599037677049637, 0.1869955062866211, 0.3254638612270355, -0.09261880815029144, 0.08684144914150238, -0.11117130517959595, 0.1897805780172348, 0.08123205602169037, 0.04683030769228935, 0.5865591168403625, 0.3055868446826935, 0.10792411863803864, 0.32768091559410095, -0.495758056640625, -0.19348132610321045, 0.05727165937423706, -0.09897714853286743, 0.13845551013946533, 0.12484008073806763, -0.05365820229053497, -0.3922593593597412, 0.25666868686676025, -0.33554723858833313, -0.19774621725082397, -0.13969971239566803, 0.22027626633644104, -0.0032346993684768677, -0.060584839433431625, -0.39027321338653564, -0.15120570361614227, 0.47595852613449097, -0.2736614942550659, 0.2344486266374588, 0.05876272916793823, -0.2052232325077057, 0.23883210122585297, 0.33249086141586304, 0.4195669889450073, 0.07144515216350555, 0.08306039869785309, -0.1600944995880127, 0.281386137008667, 0.02718251198530197, 0.08298996090888977, 0.052955709397792816, -0.09173879772424698, -0.03044990822672844, 0.14321619272232056, 0.05522787570953369, 0.012671142816543579, -0.5502858757972717, 0.3455536663532257, 0.10991154611110687, 0.046859823167324066, -0.19337791204452515, -0.13313499093055725, 0.041244372725486755, -0.19122137129306793, -0.18751804530620575, -0.2555430233478546, -0.33245784044265747, -0.004474034532904625, 0.06573499739170074, 0.09889018535614014, 0.19960926473140717, 0.01873113214969635, -0.038432635366916656, 0.37142181396484375, 0.4363003373146057, -0.30787989497184753, -0.0035356003791093826, -0.12242960184812546, -0.5355163812637329, 0.29517385363578796, -0.269599586725235, -0.4630351662635803, 0.4378815293312073, 0.20798969268798828, 0.13077384233474731, 0.05380599573254585, 0.01805943250656128, 0.1585981696844101, -0.29508212208747864, 0.14028210937976837, -0.26408645510673523, -0.16466931998729706, 0.24281570315361023, -0.19256681203842163, -0.07076211273670197, 0.003395870327949524, 0.35976552963256836, -0.020562320947647095, -0.016280006617307663, 0.09018146991729736, 0.1677822768688202, -0.5286961793899536, -0.4443299174308777, -0.03129997104406357, 0.1747814267873764, 0.19653204083442688, -0.22732099890708923, -0.2542477250099182, -0.22993382811546326, -0.0498366542160511, -0.19927209615707397, 0.5373099446296692, -0.26691287755966187, 0.5406489372253418, 0.06785796582698822, -0.27915582060813904, -0.12024100124835968, 0.2953866720199585, 0.0641380324959755, -0.16347941756248474, -0.1523139327764511, 0.10899059474468231, 0.057386696338653564, -0.07962803542613983, -0.0009504631161689758, 0.26892566680908203, 0.1437426656484604, 0.16440999507904053, 0.061094820499420166, -0.24893951416015625, 0.2889636754989624, -0.3820137083530426, -0.21670272946357727, 0.1949497014284134, -0.07249452918767929, 0.1960967481136322, 0.06945039331912994, -0.42897215485572815, 0.030249804258346558, 0.12145823240280151, -0.22034421563148499, -0.026455849409103394, 0.2109253853559494, 0.1932188868522644, -0.07092390209436417, -0.004424840211868286, 0.07811242341995239, -0.169754296541214, -0.15706488490104675, 0.1803692877292633, -0.11369789391756058 ]
https://github.com/huggingface/datasets/issues/5869
Btw in the future we might add support for an dedicated Image extension type in Arrow so that you won't need to add the schema metadata anymore ;)
Image Encoding Issue when submitting a Parquet Dataset
### Describe the bug Hello, I'd like to report an issue related to pushing a dataset represented as a Parquet file to a dataset repository using Dask. Here are the details: We attempted to load an example dataset in Parquet format from the Hugging Face (HF) filesystem using Dask with the following code snippet: ``` import dask.dataframe as dd df = dd.read_parquet("hf://datasets/lambdalabs/pokemon-blip-captions",index=False) ``` In this dataset, the "image" column is represented as a dictionary/struct with the format: ``` df = df.compute() df["image"].iloc[0].keys() -> dict_keys(['bytes', 'path']) ``` I think this is the format encoded by the [`Image`](https://huggingface.co/docs/datasets/v2.0.0/en/package_reference/main_classes#datasets.Image) feature extractor from datasets to format suitable for Arrow. The next step was to push the dataset to a repository that I created: ``` dd.to_parquet(dask_df, path = "hf://datasets/philippemo/dummy_dataset/data") ``` However, after pushing the dataset using Dask, the "image" column is now represented as the encoded dictionary `(['bytes', 'path'])`, and the images are not properly visualized. You can find the dataset here: [Link to the problematic dataset](https://huggingface.co/datasets/philippemo/dummy_dataset). It's worth noting that both the original dataset and the one submitted with Dask have the same schema with minor alterations related to metadata: **[ Schema of original dummy example.](https://huggingface.co/datasets/lambdalabs/pokemon-blip-captions/blob/main/data/train-00000-of-00001-566cc9b19d7203f8.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` **[ Schema of pushed dataset with dask](https://huggingface.co/datasets/philippemo/dummy_dataset/blob/main/data/part.0.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` This issue seems to be related to an encoding type that occurs when pushing a model to the hub. Normally, models should be represented as an HF dataset before pushing, but we are working with an example where we need to push large datasets using Dask. Could you please provide clarification on how to resolve this issue? Thank you! ### Reproduction To get the schema I downloaded the parquet files and used pyarrow.parquet to read the schema ``` import pyarrow.parquet pyarrow.parquet.read_schema(<path_to_parquet>, memory_map=True) ``` ### Logs _No response_ ### System info ```shell - huggingface_hub version: 0.14.1 - Platform: Linux-5.19.0-41-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /home/philippe/.cache/huggingface/token - Has saved token ?: True - Who am I ?: philippemo - Configured git credential helpers: cache - FastAI: N/A - Tensorflow: N/A - Torch: N/A - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.4.0 - hf_transfer: N/A - gradio: N/A - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /home/philippe/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /home/philippe/.cache/huggingface/assets - HF_TOKEN_PATH: /home/philippe/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
28
Image Encoding Issue when submitting a Parquet Dataset ### Describe the bug Hello, I'd like to report an issue related to pushing a dataset represented as a Parquet file to a dataset repository using Dask. Here are the details: We attempted to load an example dataset in Parquet format from the Hugging Face (HF) filesystem using Dask with the following code snippet: ``` import dask.dataframe as dd df = dd.read_parquet("hf://datasets/lambdalabs/pokemon-blip-captions",index=False) ``` In this dataset, the "image" column is represented as a dictionary/struct with the format: ``` df = df.compute() df["image"].iloc[0].keys() -> dict_keys(['bytes', 'path']) ``` I think this is the format encoded by the [`Image`](https://huggingface.co/docs/datasets/v2.0.0/en/package_reference/main_classes#datasets.Image) feature extractor from datasets to format suitable for Arrow. The next step was to push the dataset to a repository that I created: ``` dd.to_parquet(dask_df, path = "hf://datasets/philippemo/dummy_dataset/data") ``` However, after pushing the dataset using Dask, the "image" column is now represented as the encoded dictionary `(['bytes', 'path'])`, and the images are not properly visualized. You can find the dataset here: [Link to the problematic dataset](https://huggingface.co/datasets/philippemo/dummy_dataset). It's worth noting that both the original dataset and the one submitted with Dask have the same schema with minor alterations related to metadata: **[ Schema of original dummy example.](https://huggingface.co/datasets/lambdalabs/pokemon-blip-captions/blob/main/data/train-00000-of-00001-566cc9b19d7203f8.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` **[ Schema of pushed dataset with dask](https://huggingface.co/datasets/philippemo/dummy_dataset/blob/main/data/part.0.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` This issue seems to be related to an encoding type that occurs when pushing a model to the hub. Normally, models should be represented as an HF dataset before pushing, but we are working with an example where we need to push large datasets using Dask. Could you please provide clarification on how to resolve this issue? Thank you! ### Reproduction To get the schema I downloaded the parquet files and used pyarrow.parquet to read the schema ``` import pyarrow.parquet pyarrow.parquet.read_schema(<path_to_parquet>, memory_map=True) ``` ### Logs _No response_ ### System info ```shell - huggingface_hub version: 0.14.1 - Platform: Linux-5.19.0-41-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /home/philippe/.cache/huggingface/token - Has saved token ?: True - Who am I ?: philippemo - Configured git credential helpers: cache - FastAI: N/A - Tensorflow: N/A - Torch: N/A - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.4.0 - hf_transfer: N/A - gradio: N/A - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /home/philippe/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /home/philippe/.cache/huggingface/assets - HF_TOKEN_PATH: /home/philippe/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` Btw in the future we might add support for an dedicated Image extension type in Arrow so that you won't need to add the schema metadata anymore ;)
[ -0.07916499674320221, -0.19343626499176025, 0.05645659565925598, 0.4631294906139374, 0.24050284922122955, -0.03627727925777435, -0.07235730439424515, 0.15203076601028442, -0.020293869078159332, 0.08434884250164032, 0.2394731044769287, 0.25118616223335266, -0.05058019608259201, 0.1921534389257431, 0.11636337637901306, 0.013332569971680641, 0.23355509340763092, -0.13842418789863586, 0.035421762615442276, -0.1840411126613617, 0.024526141583919525, 0.023211026564240456, 0.09557671844959259, -0.12756088376045227, -0.31958872079849243, -0.12848052382469177, -0.1838715821504593, 0.16795723140239716, -0.29963672161102295, -0.24417482316493988, 0.1643291413784027, -0.0545198954641819, -0.03208453953266144, 0.39378952980041504, -0.0001218078687088564, 0.19774697721004486, 0.34032559394836426, -0.17158105969429016, -0.5198479294776917, -0.07692272961139679, -0.3051050305366516, -0.3085200786590576, 0.05941668152809143, -0.309287965297699, 0.0069709718227386475, -0.25256574153900146, 0.20677407085895538, -0.22702455520629883, 0.4726438522338867, 0.08928938210010529, 0.14610987901687622, 0.005707211792469025, 0.0009384825825691223, 0.26594099402427673, 0.03785824775695801, 0.47385528683662415, -0.04954889416694641, 0.04280170425772667, -0.18786868453025818, 0.24820902943611145, -0.09282605350017548, 0.15272480249404907, 0.08712490648031235, -0.00805438868701458, -0.016361994668841362, 0.20589324831962585, 0.20241717994213104, -0.1180095225572586, 0.10727289319038391, -0.05603448301553726, 0.3830835819244385, -0.36889907717704773, -0.4593268036842346, -0.30965960025787354, -0.03681962192058563, -0.4328514337539673, 0.32440492510795593, 0.2548222243785858, -0.0003364458680152893, 0.03457079827785492, -0.21113935112953186, -0.09784790873527527, -0.018189646303653717, -0.0407535657286644, -0.42851364612579346, -0.08900092542171478, -0.05984817445278168, 0.006623944267630577, -0.19672420620918274, -0.19502106308937073, -0.25219568610191345, -0.3026195466518402, -0.1774444878101349, -0.013072261586785316, 0.01207483746111393, 0.08645853400230408, -0.38594385981559753, -0.17382048070430756, 0.24907076358795166, -0.21245458722114563, -0.02549496293067932, 0.044269971549510956, 0.07893548905849457, 0.03922950476408005, 0.5062429904937744, -0.12927505373954773, -0.03976383060216904, 0.2804526388645172, -0.14378151297569275, 0.2625155448913574, 0.11786860227584839, -0.1301410049200058, -0.09396785497665405, 0.04139737784862518, 0.008238278329372406, -0.33153077960014343, 0.3395339846611023, -0.20103085041046143, -0.26428651809692383, 0.3871088922023773, 0.014363810420036316, 0.15616726875305176, -0.2204391360282898, 0.05782905966043472, -0.05315091088414192, -0.09420032799243927, -0.04410804063081741, 0.47267287969589233, -0.16827616095542908, -0.15016549825668335, -0.1741468757390976, -0.030894160270690918, -0.23196938633918762, -0.18701446056365967, -0.2916504144668579, -0.11245979368686676, 0.10146734118461609, 0.33954858779907227, 0.26186174154281616, -0.0037779733538627625, -0.3535880744457245, -0.17566774785518646, 0.3936227262020111, 0.11428333818912506, -0.181613028049469, 0.07735942304134369, 0.22098040580749512, -0.5117228031158447, -0.022964052855968475, -0.11341151595115662, -0.5474387407302856, 0.2746683657169342, -0.2667553126811981, 0.011132691986858845, -0.08528672158718109, 0.044519055634737015, -0.7847863435745239, 0.2940651476383209, -0.1569625288248062, -0.06727255880832672, -0.0302228145301342, -0.12930867075920105, -0.15981081128120422, -0.05944700911641121, 0.340188592672348, 0.33771514892578125, -0.19652074575424194, -0.0005269423127174377, 0.211419016122818, 0.10521763563156128, 0.43732064962387085, 0.21744775772094727, 0.0002976544201374054, -0.2075202912092209, -0.19594281911849976, 0.2834984064102173, 0.2477104514837265, -0.3083104193210602, -0.3637264370918274, 0.20732124149799347, 0.05494142323732376, 0.5474240183830261, -0.1219802275300026, -0.33859020471572876, 0.706177294254303, 0.026742804795503616, -0.1680281013250351, 0.3964022994041443, -0.05914565175771713, 0.22435082495212555, -0.34280863404273987, -0.13862639665603638, 0.233963280916214, -0.0564732700586319, -0.15170186758041382, -0.03644343838095665, 0.2565060257911682, 0.131291002035141, 0.08944565802812576, -0.013808006420731544, 0.1822938770055771, 0.13118819892406464, 0.07572855055332184, 0.22033259272575378, 0.07828377932310104, 0.08855684101581573, -0.21446797251701355, 0.2078758329153061, 0.07565057277679443, -0.020138951018452644, -0.6611341238021851, -0.05346376821398735, -0.16341593861579895, 0.15432989597320557, -0.3454017639160156, -0.26112934947013855, 0.10302689671516418, -0.18398931622505188, -0.187301367521286, 0.3532286286354065, -0.043276917189359665, 0.4639715552330017, -0.07420756667852402, 0.09023401141166687, -0.0024136528372764587, 0.4434558153152466, 0.16038428246974945, -0.27561497688293457, 0.05932071805000305, 0.11286928504705429, 0.08718172460794449, -0.20341093838214874, -0.03168509528040886, 0.30247241258621216, 0.47361379861831665, 0.2217513471841812, 0.19026757776737213, -0.14624746143817902, 0.34467995166778564, -0.16282746195793152, 0.09265882521867752, 0.05102993920445442, 0.10109417140483856, 0.12053026258945465, -0.3240894675254822, 0.19300389289855957, 0.2009456604719162, 0.11035066843032837, -0.19701902568340302, 0.11846049875020981, 0.24099549651145935, 0.13371887803077698, 0.017451830208301544, -0.22268861532211304, -0.20250633358955383, -0.14895997941493988, 0.01594855636358261, -0.15677784383296967, -0.3826122283935547, -0.09111963212490082, 0.25387585163116455, 0.19720742106437683, -0.07561331987380981, 0.16839781403541565, -0.014281917363405228, -0.09961596876382828, 0.1962994486093521, 0.3102966547012329, -0.16031783819198608, 0.11406266689300537, -0.05157270282506943, -0.04516921192407608, -0.05097324773669243, 0.21072445809841156, 0.0645216554403305, 0.03468870744109154, 0.38239526748657227, 0.09176066517829895, 0.22126369178295135, 0.10599218308925629, -0.289608895778656, 0.3012440502643585, 0.06205640733242035, 0.08901318162679672, -0.130911722779274, 0.24661411345005035, -0.6420296430587769, -0.1346006691455841, -0.250227689743042, 0.5710702538490295, -0.682451605796814, -0.2674350440502167, -0.07291704416275024, -0.13285697996616364, -0.03968258202075958, 0.11197592318058014, -0.16302737593650818, -0.006094217300415039, -0.05273965001106262, -0.19894228875637054, -0.168374165892601, -0.23569059371948242, -0.23182329535484314, -0.027816852554678917, 0.3248855769634247, 0.21233808994293213, 0.38557004928588867, -0.02140980213880539, 0.03407187759876251, -0.518075704574585, -0.19129739701747894, 0.3227287530899048, -0.21198764443397522, 0.19274577498435974, 0.017438102513551712, 0.18571817874908447, -0.3791752755641937, -0.07872322201728821, 0.3171776533126831, 0.29951804876327515, -0.31969359517097473, 0.19377385079860687, 0.07341989874839783, -0.24825848639011383, -0.06052228808403015, 0.3777472674846649, -0.032671406865119934, -0.03471996262669563, 0.07491407543420792, 0.15761052072048187, 0.12044703960418701, 0.05838102102279663, 0.17136725783348083, -0.09452171623706818, 0.03701040893793106, -0.03860544413328171, -0.2712515592575073, -0.3488621711730957, 0.16746753454208374, -0.06116615608334541, -0.3941246271133423, -0.009151890873908997, -0.013774648308753967, 0.09752555936574936, 0.6122156381607056, -0.4919033348560333, -0.14909076690673828, -0.019757017493247986, 0.028535082936286926, 0.20034730434417725, -0.2247292846441269, -0.027866549789905548, -0.13298243284225464, 0.06330052763223648, -0.20220136642456055, -0.2573300898075104, 0.23993903398513794, 0.44075146317481995, 0.32058218121528625, 0.22766725718975067, 0.47231075167655945, 0.07370960712432861, 0.33951127529144287, 0.24130193889141083, -0.05962551757693291, 0.47799065709114075, -0.30464479327201843, 0.40736517310142517, -0.057125747203826904, 0.02726447582244873, 0.07030518352985382, 0.05161358416080475, -0.07665444910526276, 0.10197190940380096, -0.10778730362653732, -0.007601086050271988, 0.1210765466094017, 0.07934093475341797, -0.4577903747558594, -0.20341160893440247, -0.020402031019330025, -0.306393027305603, 0.22629229724407196, -0.05433841049671173, -0.06515920162200928, -0.04452984780073166, 0.001288682222366333, 0.1311672478914261, 0.08704619109630585, 0.2863551080226898, 0.15852703154087067, 0.1519756317138672, 0.20825409889221191, -0.3474852442741394, 0.0844966396689415, 0.08030015230178833, 0.41018542647361755, -0.08110155165195465, 0.14033301174640656, 0.263540118932724, -0.12458974123001099, 0.9913992285728455, -0.07324831932783127, 0.0463947169482708, 0.006614558398723602, -0.22308924794197083, -0.3880262076854706, -0.14035595953464508, -0.07921162247657776, 0.17726217210292816, -0.2802383005619049, 0.4486265480518341, -0.5790385007858276, -0.15004587173461914, -0.00007326342165470123, -0.03217074275016785, -0.2849447727203369, 0.2814604640007019, -0.273240864276886, -0.06345083564519882, -0.1931152641773224, 0.024621507152915, 0.3160390853881836, 0.2254040390253067, 0.29118281602859497, 0.20496916770935059, -0.3069373667240143, 0.3140944540500641, -0.09414389729499817, 0.16854235529899597, 0.7633002400398254, -0.0018072165548801422, 0.11994614452123642, 0.34088411927223206, 0.5542935729026794, 0.4060317575931549, 0.681222677230835, 0.1060827299952507, -0.5684740543365479, -0.026644669473171234, -0.2976146340370178, 0.2752879858016968, 0.3391740322113037, 0.19574227929115295, -0.1426192820072174, -0.2332392781972885, -0.12143495678901672, -0.5962797403335571, 0.0048218779265880585, 0.6384521126747131, -0.06977512687444687, -0.3294113576412201, -0.10974253714084625, 0.26602399349212646, 0.01982904225587845, 0.1059081107378006, -0.1032584011554718, 0.6814203858375549, -0.3524845540523529, 0.29314732551574707, 0.43852463364601135, 0.6986760497093201, -0.31745898723602295, 0.08485960960388184, 0.2611289918422699, -0.41698163747787476, 0.05339523032307625, -0.008640453219413757, -0.16793294250965118, -0.1286677122116089, 0.026765964925289154, -0.002383500337600708, 0.010570414364337921, 0.10287268459796906, 0.05427601933479309, -0.03950437903404236, -0.025233056396245956, -0.13475537300109863, -0.10187064111232758, -0.16843479871749878, 0.26752281188964844, 0.02645270712673664, -0.0855833888053894, -0.30577975511550903, 0.12090219557285309, -0.17668913304805756, -0.24624857306480408, 0.1322004199028015, -0.3132990896701813, -0.3896317481994629, 0.033578477799892426, -0.21205377578735352, 0.17872308194637299, 0.09609001874923706, 0.10728970170021057, 0.10292860865592957, -0.41311413049697876, 0.12592896819114685, 0.3106502294540405, 0.18212267756462097, -0.18301285803318024, -0.09230932593345642, 0.29682376980781555, -0.1273464411497116, 0.10368946194648743, 0.029159806668758392, 0.04628952592611313, 0.3173646926879883, -0.010158903896808624, 0.1919703185558319, -0.3208054304122925, -0.03930879384279251, 0.05043976008892059, -0.09223057329654694, -0.0019683297723531723, 0.29481789469718933, -0.0745924711227417, -0.08492542058229446, -0.20530332624912262, 0.15854820609092712, 0.05422896146774292, -0.0011428743600845337, -0.05587608739733696, 0.13133308291435242, -0.1556420922279358, 0.2875654995441437, -0.12445589900016785, 0.03552263230085373, 0.31148016452789307, -0.20124299824237823, -0.06983207166194916, 0.47928592562675476, -0.2162202000617981, -0.35114753246307373, 0.06262609362602234, -0.15597200393676758, 0.124468132853508, -0.35657575726509094, 0.22543083131313324, -0.3644396960735321, 0.10456603765487671, -0.3070925176143646, -0.08409903198480606, -0.007379754912108183, -0.4085598587989807, -0.09839437156915665, -0.04116646945476532, -0.038579411804676056, 0.3225950300693512, -0.30236488580703735, 0.1972884088754654, 0.06166757643222809, -0.07260958105325699, -0.1025754064321518, -0.16005875170230865, -0.1915740668773651, 0.24606581032276154, 0.07074514776468277, 0.3006419241428375, 0.3208974003791809, 0.03700247034430504, 0.11884783953428268, -0.39820000529289246, 0.08051833510398865, 0.09587366878986359, 0.06930314749479294, -0.021773288026452065, -0.3344597816467285, 0.1346713900566101, -0.028862766921520233, -0.03297141194343567, -0.009161468595266342, -0.08928275108337402, -0.11016947031021118, -0.3043563663959503, 0.06306718289852142, 0.209659144282341, -0.1419305056333542, -0.12058883905410767, 0.9170119762420654, 0.2859131097793579, 0.029125086963176727, -0.08836822211742401, 0.138609379529953, 0.33755743503570557, -0.06887565553188324, -0.02053120546042919, -0.21704143285751343, -0.000537477433681488, 0.06906968355178833, 0.2671671211719513, 0.01341732032597065, 0.05737423524260521, 0.4994564354419708, -0.3344879448413849, 0.21903619170188904, 0.27255484461784363, 0.400823712348938, 0.24880696833133698, -0.2676967978477478, -0.5458172559738159, 0.45789268612861633, 0.08216634392738342, -0.04859311506152153, 0.024749580770730972, 0.44291025400161743, -0.1257719099521637, -0.3181057572364807, 0.033412158489227295, 0.2590599060058594, 0.20852315425872803, -0.5375937819480896, -0.0032423213124275208, 0.42927515506744385, -0.2545764446258545, 0.10580794513225555, 0.08040713518857956, 0.05851776897907257, 0.23365382850170135, 0.026060422882437706, 0.17333675920963287, 0.06848163902759552, 0.3626081645488739, -0.08599037677049637, 0.1869955062866211, 0.3254638612270355, -0.09261880815029144, 0.08684144914150238, -0.11117130517959595, 0.1897805780172348, 0.08123205602169037, 0.04683030769228935, 0.5865591168403625, 0.3055868446826935, 0.10792411863803864, 0.32768091559410095, -0.495758056640625, -0.19348132610321045, 0.05727165937423706, -0.09897714853286743, 0.13845551013946533, 0.12484008073806763, -0.05365820229053497, -0.3922593593597412, 0.25666868686676025, -0.33554723858833313, -0.19774621725082397, -0.13969971239566803, 0.22027626633644104, -0.0032346993684768677, -0.060584839433431625, -0.39027321338653564, -0.15120570361614227, 0.47595852613449097, -0.2736614942550659, 0.2344486266374588, 0.05876272916793823, -0.2052232325077057, 0.23883210122585297, 0.33249086141586304, 0.4195669889450073, 0.07144515216350555, 0.08306039869785309, -0.1600944995880127, 0.281386137008667, 0.02718251198530197, 0.08298996090888977, 0.052955709397792816, -0.09173879772424698, -0.03044990822672844, 0.14321619272232056, 0.05522787570953369, 0.012671142816543579, -0.5502858757972717, 0.3455536663532257, 0.10991154611110687, 0.046859823167324066, -0.19337791204452515, -0.13313499093055725, 0.041244372725486755, -0.19122137129306793, -0.18751804530620575, -0.2555430233478546, -0.33245784044265747, -0.004474034532904625, 0.06573499739170074, 0.09889018535614014, 0.19960926473140717, 0.01873113214969635, -0.038432635366916656, 0.37142181396484375, 0.4363003373146057, -0.30787989497184753, -0.0035356003791093826, -0.12242960184812546, -0.5355163812637329, 0.29517385363578796, -0.269599586725235, -0.4630351662635803, 0.4378815293312073, 0.20798969268798828, 0.13077384233474731, 0.05380599573254585, 0.01805943250656128, 0.1585981696844101, -0.29508212208747864, 0.14028210937976837, -0.26408645510673523, -0.16466931998729706, 0.24281570315361023, -0.19256681203842163, -0.07076211273670197, 0.003395870327949524, 0.35976552963256836, -0.020562320947647095, -0.016280006617307663, 0.09018146991729736, 0.1677822768688202, -0.5286961793899536, -0.4443299174308777, -0.03129997104406357, 0.1747814267873764, 0.19653204083442688, -0.22732099890708923, -0.2542477250099182, -0.22993382811546326, -0.0498366542160511, -0.19927209615707397, 0.5373099446296692, -0.26691287755966187, 0.5406489372253418, 0.06785796582698822, -0.27915582060813904, -0.12024100124835968, 0.2953866720199585, 0.0641380324959755, -0.16347941756248474, -0.1523139327764511, 0.10899059474468231, 0.057386696338653564, -0.07962803542613983, -0.0009504631161689758, 0.26892566680908203, 0.1437426656484604, 0.16440999507904053, 0.061094820499420166, -0.24893951416015625, 0.2889636754989624, -0.3820137083530426, -0.21670272946357727, 0.1949497014284134, -0.07249452918767929, 0.1960967481136322, 0.06945039331912994, -0.42897215485572815, 0.030249804258346558, 0.12145823240280151, -0.22034421563148499, -0.026455849409103394, 0.2109253853559494, 0.1932188868522644, -0.07092390209436417, -0.004424840211868286, 0.07811242341995239, -0.169754296541214, -0.15706488490104675, 0.1803692877292633, -0.11369789391756058 ]
https://github.com/huggingface/datasets/issues/5869
Thanks @Wauplin @lhoestq for the quick reply :)! I tried your approach by passing the huggingface schema to the dask writer ``` from datasets import Features, Image, Value df = dd.read_parquet(f"hf://datasets/lambdalabs/pokemon-blip-captions",index=False) features = Features({"image": Image(), "text": Value("string")}) schema = features.arrow_schema dd.to_parquet(df, path = "hf://datasets/philippemo/dummy_dataset/data", schema=schema) ``` At first it didn't work as I was not able to visualize the images, so then I manually added the `dataset_infos.json` from the example dataset and it worked :) However, It's not very ideal since there are some metadata in that file that need to be computed in order to load the data properly such as `num_of_bytes` and `num_examples` which might be unknown in my use case. ![Screenshot from 2023-05-16 16-54-55](https://github.com/huggingface/datasets/assets/47530815/b2b448d2-d3d8-43a7-9682-9c0187a5192b) Do you have any pointers there? you mentioned that `datasets_info.json` will be deprecated/legacy. Could you point me to some example image datasets on the hub that are stored as parquet and don't have the `datasets_info.json`?
Image Encoding Issue when submitting a Parquet Dataset
### Describe the bug Hello, I'd like to report an issue related to pushing a dataset represented as a Parquet file to a dataset repository using Dask. Here are the details: We attempted to load an example dataset in Parquet format from the Hugging Face (HF) filesystem using Dask with the following code snippet: ``` import dask.dataframe as dd df = dd.read_parquet("hf://datasets/lambdalabs/pokemon-blip-captions",index=False) ``` In this dataset, the "image" column is represented as a dictionary/struct with the format: ``` df = df.compute() df["image"].iloc[0].keys() -> dict_keys(['bytes', 'path']) ``` I think this is the format encoded by the [`Image`](https://huggingface.co/docs/datasets/v2.0.0/en/package_reference/main_classes#datasets.Image) feature extractor from datasets to format suitable for Arrow. The next step was to push the dataset to a repository that I created: ``` dd.to_parquet(dask_df, path = "hf://datasets/philippemo/dummy_dataset/data") ``` However, after pushing the dataset using Dask, the "image" column is now represented as the encoded dictionary `(['bytes', 'path'])`, and the images are not properly visualized. You can find the dataset here: [Link to the problematic dataset](https://huggingface.co/datasets/philippemo/dummy_dataset). It's worth noting that both the original dataset and the one submitted with Dask have the same schema with minor alterations related to metadata: **[ Schema of original dummy example.](https://huggingface.co/datasets/lambdalabs/pokemon-blip-captions/blob/main/data/train-00000-of-00001-566cc9b19d7203f8.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` **[ Schema of pushed dataset with dask](https://huggingface.co/datasets/philippemo/dummy_dataset/blob/main/data/part.0.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` This issue seems to be related to an encoding type that occurs when pushing a model to the hub. Normally, models should be represented as an HF dataset before pushing, but we are working with an example where we need to push large datasets using Dask. Could you please provide clarification on how to resolve this issue? Thank you! ### Reproduction To get the schema I downloaded the parquet files and used pyarrow.parquet to read the schema ``` import pyarrow.parquet pyarrow.parquet.read_schema(<path_to_parquet>, memory_map=True) ``` ### Logs _No response_ ### System info ```shell - huggingface_hub version: 0.14.1 - Platform: Linux-5.19.0-41-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /home/philippe/.cache/huggingface/token - Has saved token ?: True - Who am I ?: philippemo - Configured git credential helpers: cache - FastAI: N/A - Tensorflow: N/A - Torch: N/A - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.4.0 - hf_transfer: N/A - gradio: N/A - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /home/philippe/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /home/philippe/.cache/huggingface/assets - HF_TOKEN_PATH: /home/philippe/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
152
Image Encoding Issue when submitting a Parquet Dataset ### Describe the bug Hello, I'd like to report an issue related to pushing a dataset represented as a Parquet file to a dataset repository using Dask. Here are the details: We attempted to load an example dataset in Parquet format from the Hugging Face (HF) filesystem using Dask with the following code snippet: ``` import dask.dataframe as dd df = dd.read_parquet("hf://datasets/lambdalabs/pokemon-blip-captions",index=False) ``` In this dataset, the "image" column is represented as a dictionary/struct with the format: ``` df = df.compute() df["image"].iloc[0].keys() -> dict_keys(['bytes', 'path']) ``` I think this is the format encoded by the [`Image`](https://huggingface.co/docs/datasets/v2.0.0/en/package_reference/main_classes#datasets.Image) feature extractor from datasets to format suitable for Arrow. The next step was to push the dataset to a repository that I created: ``` dd.to_parquet(dask_df, path = "hf://datasets/philippemo/dummy_dataset/data") ``` However, after pushing the dataset using Dask, the "image" column is now represented as the encoded dictionary `(['bytes', 'path'])`, and the images are not properly visualized. You can find the dataset here: [Link to the problematic dataset](https://huggingface.co/datasets/philippemo/dummy_dataset). It's worth noting that both the original dataset and the one submitted with Dask have the same schema with minor alterations related to metadata: **[ Schema of original dummy example.](https://huggingface.co/datasets/lambdalabs/pokemon-blip-captions/blob/main/data/train-00000-of-00001-566cc9b19d7203f8.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` **[ Schema of pushed dataset with dask](https://huggingface.co/datasets/philippemo/dummy_dataset/blob/main/data/part.0.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` This issue seems to be related to an encoding type that occurs when pushing a model to the hub. Normally, models should be represented as an HF dataset before pushing, but we are working with an example where we need to push large datasets using Dask. Could you please provide clarification on how to resolve this issue? Thank you! ### Reproduction To get the schema I downloaded the parquet files and used pyarrow.parquet to read the schema ``` import pyarrow.parquet pyarrow.parquet.read_schema(<path_to_parquet>, memory_map=True) ``` ### Logs _No response_ ### System info ```shell - huggingface_hub version: 0.14.1 - Platform: Linux-5.19.0-41-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /home/philippe/.cache/huggingface/token - Has saved token ?: True - Who am I ?: philippemo - Configured git credential helpers: cache - FastAI: N/A - Tensorflow: N/A - Torch: N/A - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.4.0 - hf_transfer: N/A - gradio: N/A - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /home/philippe/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /home/philippe/.cache/huggingface/assets - HF_TOKEN_PATH: /home/philippe/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` Thanks @Wauplin @lhoestq for the quick reply :)! I tried your approach by passing the huggingface schema to the dask writer ``` from datasets import Features, Image, Value df = dd.read_parquet(f"hf://datasets/lambdalabs/pokemon-blip-captions",index=False) features = Features({"image": Image(), "text": Value("string")}) schema = features.arrow_schema dd.to_parquet(df, path = "hf://datasets/philippemo/dummy_dataset/data", schema=schema) ``` At first it didn't work as I was not able to visualize the images, so then I manually added the `dataset_infos.json` from the example dataset and it worked :) However, It's not very ideal since there are some metadata in that file that need to be computed in order to load the data properly such as `num_of_bytes` and `num_examples` which might be unknown in my use case. ![Screenshot from 2023-05-16 16-54-55](https://github.com/huggingface/datasets/assets/47530815/b2b448d2-d3d8-43a7-9682-9c0187a5192b) Do you have any pointers there? you mentioned that `datasets_info.json` will be deprecated/legacy. Could you point me to some example image datasets on the hub that are stored as parquet and don't have the `datasets_info.json`?
[ -0.07916499674320221, -0.19343626499176025, 0.05645659565925598, 0.4631294906139374, 0.24050284922122955, -0.03627727925777435, -0.07235730439424515, 0.15203076601028442, -0.020293869078159332, 0.08434884250164032, 0.2394731044769287, 0.25118616223335266, -0.05058019608259201, 0.1921534389257431, 0.11636337637901306, 0.013332569971680641, 0.23355509340763092, -0.13842418789863586, 0.035421762615442276, -0.1840411126613617, 0.024526141583919525, 0.023211026564240456, 0.09557671844959259, -0.12756088376045227, -0.31958872079849243, -0.12848052382469177, -0.1838715821504593, 0.16795723140239716, -0.29963672161102295, -0.24417482316493988, 0.1643291413784027, -0.0545198954641819, -0.03208453953266144, 0.39378952980041504, -0.0001218078687088564, 0.19774697721004486, 0.34032559394836426, -0.17158105969429016, -0.5198479294776917, -0.07692272961139679, -0.3051050305366516, -0.3085200786590576, 0.05941668152809143, -0.309287965297699, 0.0069709718227386475, -0.25256574153900146, 0.20677407085895538, -0.22702455520629883, 0.4726438522338867, 0.08928938210010529, 0.14610987901687622, 0.005707211792469025, 0.0009384825825691223, 0.26594099402427673, 0.03785824775695801, 0.47385528683662415, -0.04954889416694641, 0.04280170425772667, -0.18786868453025818, 0.24820902943611145, -0.09282605350017548, 0.15272480249404907, 0.08712490648031235, -0.00805438868701458, -0.016361994668841362, 0.20589324831962585, 0.20241717994213104, -0.1180095225572586, 0.10727289319038391, -0.05603448301553726, 0.3830835819244385, -0.36889907717704773, -0.4593268036842346, -0.30965960025787354, -0.03681962192058563, -0.4328514337539673, 0.32440492510795593, 0.2548222243785858, -0.0003364458680152893, 0.03457079827785492, -0.21113935112953186, -0.09784790873527527, -0.018189646303653717, -0.0407535657286644, -0.42851364612579346, -0.08900092542171478, -0.05984817445278168, 0.006623944267630577, -0.19672420620918274, -0.19502106308937073, -0.25219568610191345, -0.3026195466518402, -0.1774444878101349, -0.013072261586785316, 0.01207483746111393, 0.08645853400230408, -0.38594385981559753, -0.17382048070430756, 0.24907076358795166, -0.21245458722114563, -0.02549496293067932, 0.044269971549510956, 0.07893548905849457, 0.03922950476408005, 0.5062429904937744, -0.12927505373954773, -0.03976383060216904, 0.2804526388645172, -0.14378151297569275, 0.2625155448913574, 0.11786860227584839, -0.1301410049200058, -0.09396785497665405, 0.04139737784862518, 0.008238278329372406, -0.33153077960014343, 0.3395339846611023, -0.20103085041046143, -0.26428651809692383, 0.3871088922023773, 0.014363810420036316, 0.15616726875305176, -0.2204391360282898, 0.05782905966043472, -0.05315091088414192, -0.09420032799243927, -0.04410804063081741, 0.47267287969589233, -0.16827616095542908, -0.15016549825668335, -0.1741468757390976, -0.030894160270690918, -0.23196938633918762, -0.18701446056365967, -0.2916504144668579, -0.11245979368686676, 0.10146734118461609, 0.33954858779907227, 0.26186174154281616, -0.0037779733538627625, -0.3535880744457245, -0.17566774785518646, 0.3936227262020111, 0.11428333818912506, -0.181613028049469, 0.07735942304134369, 0.22098040580749512, -0.5117228031158447, -0.022964052855968475, -0.11341151595115662, -0.5474387407302856, 0.2746683657169342, -0.2667553126811981, 0.011132691986858845, -0.08528672158718109, 0.044519055634737015, -0.7847863435745239, 0.2940651476383209, -0.1569625288248062, -0.06727255880832672, -0.0302228145301342, -0.12930867075920105, -0.15981081128120422, -0.05944700911641121, 0.340188592672348, 0.33771514892578125, -0.19652074575424194, -0.0005269423127174377, 0.211419016122818, 0.10521763563156128, 0.43732064962387085, 0.21744775772094727, 0.0002976544201374054, -0.2075202912092209, -0.19594281911849976, 0.2834984064102173, 0.2477104514837265, -0.3083104193210602, -0.3637264370918274, 0.20732124149799347, 0.05494142323732376, 0.5474240183830261, -0.1219802275300026, -0.33859020471572876, 0.706177294254303, 0.026742804795503616, -0.1680281013250351, 0.3964022994041443, -0.05914565175771713, 0.22435082495212555, -0.34280863404273987, -0.13862639665603638, 0.233963280916214, -0.0564732700586319, -0.15170186758041382, -0.03644343838095665, 0.2565060257911682, 0.131291002035141, 0.08944565802812576, -0.013808006420731544, 0.1822938770055771, 0.13118819892406464, 0.07572855055332184, 0.22033259272575378, 0.07828377932310104, 0.08855684101581573, -0.21446797251701355, 0.2078758329153061, 0.07565057277679443, -0.020138951018452644, -0.6611341238021851, -0.05346376821398735, -0.16341593861579895, 0.15432989597320557, -0.3454017639160156, -0.26112934947013855, 0.10302689671516418, -0.18398931622505188, -0.187301367521286, 0.3532286286354065, -0.043276917189359665, 0.4639715552330017, -0.07420756667852402, 0.09023401141166687, -0.0024136528372764587, 0.4434558153152466, 0.16038428246974945, -0.27561497688293457, 0.05932071805000305, 0.11286928504705429, 0.08718172460794449, -0.20341093838214874, -0.03168509528040886, 0.30247241258621216, 0.47361379861831665, 0.2217513471841812, 0.19026757776737213, -0.14624746143817902, 0.34467995166778564, -0.16282746195793152, 0.09265882521867752, 0.05102993920445442, 0.10109417140483856, 0.12053026258945465, -0.3240894675254822, 0.19300389289855957, 0.2009456604719162, 0.11035066843032837, -0.19701902568340302, 0.11846049875020981, 0.24099549651145935, 0.13371887803077698, 0.017451830208301544, -0.22268861532211304, -0.20250633358955383, -0.14895997941493988, 0.01594855636358261, -0.15677784383296967, -0.3826122283935547, -0.09111963212490082, 0.25387585163116455, 0.19720742106437683, -0.07561331987380981, 0.16839781403541565, -0.014281917363405228, -0.09961596876382828, 0.1962994486093521, 0.3102966547012329, -0.16031783819198608, 0.11406266689300537, -0.05157270282506943, -0.04516921192407608, -0.05097324773669243, 0.21072445809841156, 0.0645216554403305, 0.03468870744109154, 0.38239526748657227, 0.09176066517829895, 0.22126369178295135, 0.10599218308925629, -0.289608895778656, 0.3012440502643585, 0.06205640733242035, 0.08901318162679672, -0.130911722779274, 0.24661411345005035, -0.6420296430587769, -0.1346006691455841, -0.250227689743042, 0.5710702538490295, -0.682451605796814, -0.2674350440502167, -0.07291704416275024, -0.13285697996616364, -0.03968258202075958, 0.11197592318058014, -0.16302737593650818, -0.006094217300415039, -0.05273965001106262, -0.19894228875637054, -0.168374165892601, -0.23569059371948242, -0.23182329535484314, -0.027816852554678917, 0.3248855769634247, 0.21233808994293213, 0.38557004928588867, -0.02140980213880539, 0.03407187759876251, -0.518075704574585, -0.19129739701747894, 0.3227287530899048, -0.21198764443397522, 0.19274577498435974, 0.017438102513551712, 0.18571817874908447, -0.3791752755641937, -0.07872322201728821, 0.3171776533126831, 0.29951804876327515, -0.31969359517097473, 0.19377385079860687, 0.07341989874839783, -0.24825848639011383, -0.06052228808403015, 0.3777472674846649, -0.032671406865119934, -0.03471996262669563, 0.07491407543420792, 0.15761052072048187, 0.12044703960418701, 0.05838102102279663, 0.17136725783348083, -0.09452171623706818, 0.03701040893793106, -0.03860544413328171, -0.2712515592575073, -0.3488621711730957, 0.16746753454208374, -0.06116615608334541, -0.3941246271133423, -0.009151890873908997, -0.013774648308753967, 0.09752555936574936, 0.6122156381607056, -0.4919033348560333, -0.14909076690673828, -0.019757017493247986, 0.028535082936286926, 0.20034730434417725, -0.2247292846441269, -0.027866549789905548, -0.13298243284225464, 0.06330052763223648, -0.20220136642456055, -0.2573300898075104, 0.23993903398513794, 0.44075146317481995, 0.32058218121528625, 0.22766725718975067, 0.47231075167655945, 0.07370960712432861, 0.33951127529144287, 0.24130193889141083, -0.05962551757693291, 0.47799065709114075, -0.30464479327201843, 0.40736517310142517, -0.057125747203826904, 0.02726447582244873, 0.07030518352985382, 0.05161358416080475, -0.07665444910526276, 0.10197190940380096, -0.10778730362653732, -0.007601086050271988, 0.1210765466094017, 0.07934093475341797, -0.4577903747558594, -0.20341160893440247, -0.020402031019330025, -0.306393027305603, 0.22629229724407196, -0.05433841049671173, -0.06515920162200928, -0.04452984780073166, 0.001288682222366333, 0.1311672478914261, 0.08704619109630585, 0.2863551080226898, 0.15852703154087067, 0.1519756317138672, 0.20825409889221191, -0.3474852442741394, 0.0844966396689415, 0.08030015230178833, 0.41018542647361755, -0.08110155165195465, 0.14033301174640656, 0.263540118932724, -0.12458974123001099, 0.9913992285728455, -0.07324831932783127, 0.0463947169482708, 0.006614558398723602, -0.22308924794197083, -0.3880262076854706, -0.14035595953464508, -0.07921162247657776, 0.17726217210292816, -0.2802383005619049, 0.4486265480518341, -0.5790385007858276, -0.15004587173461914, -0.00007326342165470123, -0.03217074275016785, -0.2849447727203369, 0.2814604640007019, -0.273240864276886, -0.06345083564519882, -0.1931152641773224, 0.024621507152915, 0.3160390853881836, 0.2254040390253067, 0.29118281602859497, 0.20496916770935059, -0.3069373667240143, 0.3140944540500641, -0.09414389729499817, 0.16854235529899597, 0.7633002400398254, -0.0018072165548801422, 0.11994614452123642, 0.34088411927223206, 0.5542935729026794, 0.4060317575931549, 0.681222677230835, 0.1060827299952507, -0.5684740543365479, -0.026644669473171234, -0.2976146340370178, 0.2752879858016968, 0.3391740322113037, 0.19574227929115295, -0.1426192820072174, -0.2332392781972885, -0.12143495678901672, -0.5962797403335571, 0.0048218779265880585, 0.6384521126747131, -0.06977512687444687, -0.3294113576412201, -0.10974253714084625, 0.26602399349212646, 0.01982904225587845, 0.1059081107378006, -0.1032584011554718, 0.6814203858375549, -0.3524845540523529, 0.29314732551574707, 0.43852463364601135, 0.6986760497093201, -0.31745898723602295, 0.08485960960388184, 0.2611289918422699, -0.41698163747787476, 0.05339523032307625, -0.008640453219413757, -0.16793294250965118, -0.1286677122116089, 0.026765964925289154, -0.002383500337600708, 0.010570414364337921, 0.10287268459796906, 0.05427601933479309, -0.03950437903404236, -0.025233056396245956, -0.13475537300109863, -0.10187064111232758, -0.16843479871749878, 0.26752281188964844, 0.02645270712673664, -0.0855833888053894, -0.30577975511550903, 0.12090219557285309, -0.17668913304805756, -0.24624857306480408, 0.1322004199028015, -0.3132990896701813, -0.3896317481994629, 0.033578477799892426, -0.21205377578735352, 0.17872308194637299, 0.09609001874923706, 0.10728970170021057, 0.10292860865592957, -0.41311413049697876, 0.12592896819114685, 0.3106502294540405, 0.18212267756462097, -0.18301285803318024, -0.09230932593345642, 0.29682376980781555, -0.1273464411497116, 0.10368946194648743, 0.029159806668758392, 0.04628952592611313, 0.3173646926879883, -0.010158903896808624, 0.1919703185558319, -0.3208054304122925, -0.03930879384279251, 0.05043976008892059, -0.09223057329654694, -0.0019683297723531723, 0.29481789469718933, -0.0745924711227417, -0.08492542058229446, -0.20530332624912262, 0.15854820609092712, 0.05422896146774292, -0.0011428743600845337, -0.05587608739733696, 0.13133308291435242, -0.1556420922279358, 0.2875654995441437, -0.12445589900016785, 0.03552263230085373, 0.31148016452789307, -0.20124299824237823, -0.06983207166194916, 0.47928592562675476, -0.2162202000617981, -0.35114753246307373, 0.06262609362602234, -0.15597200393676758, 0.124468132853508, -0.35657575726509094, 0.22543083131313324, -0.3644396960735321, 0.10456603765487671, -0.3070925176143646, -0.08409903198480606, -0.007379754912108183, -0.4085598587989807, -0.09839437156915665, -0.04116646945476532, -0.038579411804676056, 0.3225950300693512, -0.30236488580703735, 0.1972884088754654, 0.06166757643222809, -0.07260958105325699, -0.1025754064321518, -0.16005875170230865, -0.1915740668773651, 0.24606581032276154, 0.07074514776468277, 0.3006419241428375, 0.3208974003791809, 0.03700247034430504, 0.11884783953428268, -0.39820000529289246, 0.08051833510398865, 0.09587366878986359, 0.06930314749479294, -0.021773288026452065, -0.3344597816467285, 0.1346713900566101, -0.028862766921520233, -0.03297141194343567, -0.009161468595266342, -0.08928275108337402, -0.11016947031021118, -0.3043563663959503, 0.06306718289852142, 0.209659144282341, -0.1419305056333542, -0.12058883905410767, 0.9170119762420654, 0.2859131097793579, 0.029125086963176727, -0.08836822211742401, 0.138609379529953, 0.33755743503570557, -0.06887565553188324, -0.02053120546042919, -0.21704143285751343, -0.000537477433681488, 0.06906968355178833, 0.2671671211719513, 0.01341732032597065, 0.05737423524260521, 0.4994564354419708, -0.3344879448413849, 0.21903619170188904, 0.27255484461784363, 0.400823712348938, 0.24880696833133698, -0.2676967978477478, -0.5458172559738159, 0.45789268612861633, 0.08216634392738342, -0.04859311506152153, 0.024749580770730972, 0.44291025400161743, -0.1257719099521637, -0.3181057572364807, 0.033412158489227295, 0.2590599060058594, 0.20852315425872803, -0.5375937819480896, -0.0032423213124275208, 0.42927515506744385, -0.2545764446258545, 0.10580794513225555, 0.08040713518857956, 0.05851776897907257, 0.23365382850170135, 0.026060422882437706, 0.17333675920963287, 0.06848163902759552, 0.3626081645488739, -0.08599037677049637, 0.1869955062866211, 0.3254638612270355, -0.09261880815029144, 0.08684144914150238, -0.11117130517959595, 0.1897805780172348, 0.08123205602169037, 0.04683030769228935, 0.5865591168403625, 0.3055868446826935, 0.10792411863803864, 0.32768091559410095, -0.495758056640625, -0.19348132610321045, 0.05727165937423706, -0.09897714853286743, 0.13845551013946533, 0.12484008073806763, -0.05365820229053497, -0.3922593593597412, 0.25666868686676025, -0.33554723858833313, -0.19774621725082397, -0.13969971239566803, 0.22027626633644104, -0.0032346993684768677, -0.060584839433431625, -0.39027321338653564, -0.15120570361614227, 0.47595852613449097, -0.2736614942550659, 0.2344486266374588, 0.05876272916793823, -0.2052232325077057, 0.23883210122585297, 0.33249086141586304, 0.4195669889450073, 0.07144515216350555, 0.08306039869785309, -0.1600944995880127, 0.281386137008667, 0.02718251198530197, 0.08298996090888977, 0.052955709397792816, -0.09173879772424698, -0.03044990822672844, 0.14321619272232056, 0.05522787570953369, 0.012671142816543579, -0.5502858757972717, 0.3455536663532257, 0.10991154611110687, 0.046859823167324066, -0.19337791204452515, -0.13313499093055725, 0.041244372725486755, -0.19122137129306793, -0.18751804530620575, -0.2555430233478546, -0.33245784044265747, -0.004474034532904625, 0.06573499739170074, 0.09889018535614014, 0.19960926473140717, 0.01873113214969635, -0.038432635366916656, 0.37142181396484375, 0.4363003373146057, -0.30787989497184753, -0.0035356003791093826, -0.12242960184812546, -0.5355163812637329, 0.29517385363578796, -0.269599586725235, -0.4630351662635803, 0.4378815293312073, 0.20798969268798828, 0.13077384233474731, 0.05380599573254585, 0.01805943250656128, 0.1585981696844101, -0.29508212208747864, 0.14028210937976837, -0.26408645510673523, -0.16466931998729706, 0.24281570315361023, -0.19256681203842163, -0.07076211273670197, 0.003395870327949524, 0.35976552963256836, -0.020562320947647095, -0.016280006617307663, 0.09018146991729736, 0.1677822768688202, -0.5286961793899536, -0.4443299174308777, -0.03129997104406357, 0.1747814267873764, 0.19653204083442688, -0.22732099890708923, -0.2542477250099182, -0.22993382811546326, -0.0498366542160511, -0.19927209615707397, 0.5373099446296692, -0.26691287755966187, 0.5406489372253418, 0.06785796582698822, -0.27915582060813904, -0.12024100124835968, 0.2953866720199585, 0.0641380324959755, -0.16347941756248474, -0.1523139327764511, 0.10899059474468231, 0.057386696338653564, -0.07962803542613983, -0.0009504631161689758, 0.26892566680908203, 0.1437426656484604, 0.16440999507904053, 0.061094820499420166, -0.24893951416015625, 0.2889636754989624, -0.3820137083530426, -0.21670272946357727, 0.1949497014284134, -0.07249452918767929, 0.1960967481136322, 0.06945039331912994, -0.42897215485572815, 0.030249804258346558, 0.12145823240280151, -0.22034421563148499, -0.026455849409103394, 0.2109253853559494, 0.1932188868522644, -0.07092390209436417, -0.004424840211868286, 0.07811242341995239, -0.169754296541214, -0.15706488490104675, 0.1803692877292633, -0.11369789391756058 ]
https://github.com/huggingface/datasets/issues/5869
You don't need the dataset_infos.json file as long as you have the schema with HF metadata ;) I could also check that it works fine myself on the git revision without the dataset_infos.json file. What made you think it didn't work ?
Image Encoding Issue when submitting a Parquet Dataset
### Describe the bug Hello, I'd like to report an issue related to pushing a dataset represented as a Parquet file to a dataset repository using Dask. Here are the details: We attempted to load an example dataset in Parquet format from the Hugging Face (HF) filesystem using Dask with the following code snippet: ``` import dask.dataframe as dd df = dd.read_parquet("hf://datasets/lambdalabs/pokemon-blip-captions",index=False) ``` In this dataset, the "image" column is represented as a dictionary/struct with the format: ``` df = df.compute() df["image"].iloc[0].keys() -> dict_keys(['bytes', 'path']) ``` I think this is the format encoded by the [`Image`](https://huggingface.co/docs/datasets/v2.0.0/en/package_reference/main_classes#datasets.Image) feature extractor from datasets to format suitable for Arrow. The next step was to push the dataset to a repository that I created: ``` dd.to_parquet(dask_df, path = "hf://datasets/philippemo/dummy_dataset/data") ``` However, after pushing the dataset using Dask, the "image" column is now represented as the encoded dictionary `(['bytes', 'path'])`, and the images are not properly visualized. You can find the dataset here: [Link to the problematic dataset](https://huggingface.co/datasets/philippemo/dummy_dataset). It's worth noting that both the original dataset and the one submitted with Dask have the same schema with minor alterations related to metadata: **[ Schema of original dummy example.](https://huggingface.co/datasets/lambdalabs/pokemon-blip-captions/blob/main/data/train-00000-of-00001-566cc9b19d7203f8.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` **[ Schema of pushed dataset with dask](https://huggingface.co/datasets/philippemo/dummy_dataset/blob/main/data/part.0.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` This issue seems to be related to an encoding type that occurs when pushing a model to the hub. Normally, models should be represented as an HF dataset before pushing, but we are working with an example where we need to push large datasets using Dask. Could you please provide clarification on how to resolve this issue? Thank you! ### Reproduction To get the schema I downloaded the parquet files and used pyarrow.parquet to read the schema ``` import pyarrow.parquet pyarrow.parquet.read_schema(<path_to_parquet>, memory_map=True) ``` ### Logs _No response_ ### System info ```shell - huggingface_hub version: 0.14.1 - Platform: Linux-5.19.0-41-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /home/philippe/.cache/huggingface/token - Has saved token ?: True - Who am I ?: philippemo - Configured git credential helpers: cache - FastAI: N/A - Tensorflow: N/A - Torch: N/A - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.4.0 - hf_transfer: N/A - gradio: N/A - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /home/philippe/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /home/philippe/.cache/huggingface/assets - HF_TOKEN_PATH: /home/philippe/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
42
Image Encoding Issue when submitting a Parquet Dataset ### Describe the bug Hello, I'd like to report an issue related to pushing a dataset represented as a Parquet file to a dataset repository using Dask. Here are the details: We attempted to load an example dataset in Parquet format from the Hugging Face (HF) filesystem using Dask with the following code snippet: ``` import dask.dataframe as dd df = dd.read_parquet("hf://datasets/lambdalabs/pokemon-blip-captions",index=False) ``` In this dataset, the "image" column is represented as a dictionary/struct with the format: ``` df = df.compute() df["image"].iloc[0].keys() -> dict_keys(['bytes', 'path']) ``` I think this is the format encoded by the [`Image`](https://huggingface.co/docs/datasets/v2.0.0/en/package_reference/main_classes#datasets.Image) feature extractor from datasets to format suitable for Arrow. The next step was to push the dataset to a repository that I created: ``` dd.to_parquet(dask_df, path = "hf://datasets/philippemo/dummy_dataset/data") ``` However, after pushing the dataset using Dask, the "image" column is now represented as the encoded dictionary `(['bytes', 'path'])`, and the images are not properly visualized. You can find the dataset here: [Link to the problematic dataset](https://huggingface.co/datasets/philippemo/dummy_dataset). It's worth noting that both the original dataset and the one submitted with Dask have the same schema with minor alterations related to metadata: **[ Schema of original dummy example.](https://huggingface.co/datasets/lambdalabs/pokemon-blip-captions/blob/main/data/train-00000-of-00001-566cc9b19d7203f8.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` **[ Schema of pushed dataset with dask](https://huggingface.co/datasets/philippemo/dummy_dataset/blob/main/data/part.0.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` This issue seems to be related to an encoding type that occurs when pushing a model to the hub. Normally, models should be represented as an HF dataset before pushing, but we are working with an example where we need to push large datasets using Dask. Could you please provide clarification on how to resolve this issue? Thank you! ### Reproduction To get the schema I downloaded the parquet files and used pyarrow.parquet to read the schema ``` import pyarrow.parquet pyarrow.parquet.read_schema(<path_to_parquet>, memory_map=True) ``` ### Logs _No response_ ### System info ```shell - huggingface_hub version: 0.14.1 - Platform: Linux-5.19.0-41-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /home/philippe/.cache/huggingface/token - Has saved token ?: True - Who am I ?: philippemo - Configured git credential helpers: cache - FastAI: N/A - Tensorflow: N/A - Torch: N/A - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.4.0 - hf_transfer: N/A - gradio: N/A - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /home/philippe/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /home/philippe/.cache/huggingface/assets - HF_TOKEN_PATH: /home/philippe/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` You don't need the dataset_infos.json file as long as you have the schema with HF metadata ;) I could also check that it works fine myself on the git revision without the dataset_infos.json file. What made you think it didn't work ?
[ -0.07916499674320221, -0.19343626499176025, 0.05645659565925598, 0.4631294906139374, 0.24050284922122955, -0.03627727925777435, -0.07235730439424515, 0.15203076601028442, -0.020293869078159332, 0.08434884250164032, 0.2394731044769287, 0.25118616223335266, -0.05058019608259201, 0.1921534389257431, 0.11636337637901306, 0.013332569971680641, 0.23355509340763092, -0.13842418789863586, 0.035421762615442276, -0.1840411126613617, 0.024526141583919525, 0.023211026564240456, 0.09557671844959259, -0.12756088376045227, -0.31958872079849243, -0.12848052382469177, -0.1838715821504593, 0.16795723140239716, -0.29963672161102295, -0.24417482316493988, 0.1643291413784027, -0.0545198954641819, -0.03208453953266144, 0.39378952980041504, -0.0001218078687088564, 0.19774697721004486, 0.34032559394836426, -0.17158105969429016, -0.5198479294776917, -0.07692272961139679, -0.3051050305366516, -0.3085200786590576, 0.05941668152809143, -0.309287965297699, 0.0069709718227386475, -0.25256574153900146, 0.20677407085895538, -0.22702455520629883, 0.4726438522338867, 0.08928938210010529, 0.14610987901687622, 0.005707211792469025, 0.0009384825825691223, 0.26594099402427673, 0.03785824775695801, 0.47385528683662415, -0.04954889416694641, 0.04280170425772667, -0.18786868453025818, 0.24820902943611145, -0.09282605350017548, 0.15272480249404907, 0.08712490648031235, -0.00805438868701458, -0.016361994668841362, 0.20589324831962585, 0.20241717994213104, -0.1180095225572586, 0.10727289319038391, -0.05603448301553726, 0.3830835819244385, -0.36889907717704773, -0.4593268036842346, -0.30965960025787354, -0.03681962192058563, -0.4328514337539673, 0.32440492510795593, 0.2548222243785858, -0.0003364458680152893, 0.03457079827785492, -0.21113935112953186, -0.09784790873527527, -0.018189646303653717, -0.0407535657286644, -0.42851364612579346, -0.08900092542171478, -0.05984817445278168, 0.006623944267630577, -0.19672420620918274, -0.19502106308937073, -0.25219568610191345, -0.3026195466518402, -0.1774444878101349, -0.013072261586785316, 0.01207483746111393, 0.08645853400230408, -0.38594385981559753, -0.17382048070430756, 0.24907076358795166, -0.21245458722114563, -0.02549496293067932, 0.044269971549510956, 0.07893548905849457, 0.03922950476408005, 0.5062429904937744, -0.12927505373954773, -0.03976383060216904, 0.2804526388645172, -0.14378151297569275, 0.2625155448913574, 0.11786860227584839, -0.1301410049200058, -0.09396785497665405, 0.04139737784862518, 0.008238278329372406, -0.33153077960014343, 0.3395339846611023, -0.20103085041046143, -0.26428651809692383, 0.3871088922023773, 0.014363810420036316, 0.15616726875305176, -0.2204391360282898, 0.05782905966043472, -0.05315091088414192, -0.09420032799243927, -0.04410804063081741, 0.47267287969589233, -0.16827616095542908, -0.15016549825668335, -0.1741468757390976, -0.030894160270690918, -0.23196938633918762, -0.18701446056365967, -0.2916504144668579, -0.11245979368686676, 0.10146734118461609, 0.33954858779907227, 0.26186174154281616, -0.0037779733538627625, -0.3535880744457245, -0.17566774785518646, 0.3936227262020111, 0.11428333818912506, -0.181613028049469, 0.07735942304134369, 0.22098040580749512, -0.5117228031158447, -0.022964052855968475, -0.11341151595115662, -0.5474387407302856, 0.2746683657169342, -0.2667553126811981, 0.011132691986858845, -0.08528672158718109, 0.044519055634737015, -0.7847863435745239, 0.2940651476383209, -0.1569625288248062, -0.06727255880832672, -0.0302228145301342, -0.12930867075920105, -0.15981081128120422, -0.05944700911641121, 0.340188592672348, 0.33771514892578125, -0.19652074575424194, -0.0005269423127174377, 0.211419016122818, 0.10521763563156128, 0.43732064962387085, 0.21744775772094727, 0.0002976544201374054, -0.2075202912092209, -0.19594281911849976, 0.2834984064102173, 0.2477104514837265, -0.3083104193210602, -0.3637264370918274, 0.20732124149799347, 0.05494142323732376, 0.5474240183830261, -0.1219802275300026, -0.33859020471572876, 0.706177294254303, 0.026742804795503616, -0.1680281013250351, 0.3964022994041443, -0.05914565175771713, 0.22435082495212555, -0.34280863404273987, -0.13862639665603638, 0.233963280916214, -0.0564732700586319, -0.15170186758041382, -0.03644343838095665, 0.2565060257911682, 0.131291002035141, 0.08944565802812576, -0.013808006420731544, 0.1822938770055771, 0.13118819892406464, 0.07572855055332184, 0.22033259272575378, 0.07828377932310104, 0.08855684101581573, -0.21446797251701355, 0.2078758329153061, 0.07565057277679443, -0.020138951018452644, -0.6611341238021851, -0.05346376821398735, -0.16341593861579895, 0.15432989597320557, -0.3454017639160156, -0.26112934947013855, 0.10302689671516418, -0.18398931622505188, -0.187301367521286, 0.3532286286354065, -0.043276917189359665, 0.4639715552330017, -0.07420756667852402, 0.09023401141166687, -0.0024136528372764587, 0.4434558153152466, 0.16038428246974945, -0.27561497688293457, 0.05932071805000305, 0.11286928504705429, 0.08718172460794449, -0.20341093838214874, -0.03168509528040886, 0.30247241258621216, 0.47361379861831665, 0.2217513471841812, 0.19026757776737213, -0.14624746143817902, 0.34467995166778564, -0.16282746195793152, 0.09265882521867752, 0.05102993920445442, 0.10109417140483856, 0.12053026258945465, -0.3240894675254822, 0.19300389289855957, 0.2009456604719162, 0.11035066843032837, -0.19701902568340302, 0.11846049875020981, 0.24099549651145935, 0.13371887803077698, 0.017451830208301544, -0.22268861532211304, -0.20250633358955383, -0.14895997941493988, 0.01594855636358261, -0.15677784383296967, -0.3826122283935547, -0.09111963212490082, 0.25387585163116455, 0.19720742106437683, -0.07561331987380981, 0.16839781403541565, -0.014281917363405228, -0.09961596876382828, 0.1962994486093521, 0.3102966547012329, -0.16031783819198608, 0.11406266689300537, -0.05157270282506943, -0.04516921192407608, -0.05097324773669243, 0.21072445809841156, 0.0645216554403305, 0.03468870744109154, 0.38239526748657227, 0.09176066517829895, 0.22126369178295135, 0.10599218308925629, -0.289608895778656, 0.3012440502643585, 0.06205640733242035, 0.08901318162679672, -0.130911722779274, 0.24661411345005035, -0.6420296430587769, -0.1346006691455841, -0.250227689743042, 0.5710702538490295, -0.682451605796814, -0.2674350440502167, -0.07291704416275024, -0.13285697996616364, -0.03968258202075958, 0.11197592318058014, -0.16302737593650818, -0.006094217300415039, -0.05273965001106262, -0.19894228875637054, -0.168374165892601, -0.23569059371948242, -0.23182329535484314, -0.027816852554678917, 0.3248855769634247, 0.21233808994293213, 0.38557004928588867, -0.02140980213880539, 0.03407187759876251, -0.518075704574585, -0.19129739701747894, 0.3227287530899048, -0.21198764443397522, 0.19274577498435974, 0.017438102513551712, 0.18571817874908447, -0.3791752755641937, -0.07872322201728821, 0.3171776533126831, 0.29951804876327515, -0.31969359517097473, 0.19377385079860687, 0.07341989874839783, -0.24825848639011383, -0.06052228808403015, 0.3777472674846649, -0.032671406865119934, -0.03471996262669563, 0.07491407543420792, 0.15761052072048187, 0.12044703960418701, 0.05838102102279663, 0.17136725783348083, -0.09452171623706818, 0.03701040893793106, -0.03860544413328171, -0.2712515592575073, -0.3488621711730957, 0.16746753454208374, -0.06116615608334541, -0.3941246271133423, -0.009151890873908997, -0.013774648308753967, 0.09752555936574936, 0.6122156381607056, -0.4919033348560333, -0.14909076690673828, -0.019757017493247986, 0.028535082936286926, 0.20034730434417725, -0.2247292846441269, -0.027866549789905548, -0.13298243284225464, 0.06330052763223648, -0.20220136642456055, -0.2573300898075104, 0.23993903398513794, 0.44075146317481995, 0.32058218121528625, 0.22766725718975067, 0.47231075167655945, 0.07370960712432861, 0.33951127529144287, 0.24130193889141083, -0.05962551757693291, 0.47799065709114075, -0.30464479327201843, 0.40736517310142517, -0.057125747203826904, 0.02726447582244873, 0.07030518352985382, 0.05161358416080475, -0.07665444910526276, 0.10197190940380096, -0.10778730362653732, -0.007601086050271988, 0.1210765466094017, 0.07934093475341797, -0.4577903747558594, -0.20341160893440247, -0.020402031019330025, -0.306393027305603, 0.22629229724407196, -0.05433841049671173, -0.06515920162200928, -0.04452984780073166, 0.001288682222366333, 0.1311672478914261, 0.08704619109630585, 0.2863551080226898, 0.15852703154087067, 0.1519756317138672, 0.20825409889221191, -0.3474852442741394, 0.0844966396689415, 0.08030015230178833, 0.41018542647361755, -0.08110155165195465, 0.14033301174640656, 0.263540118932724, -0.12458974123001099, 0.9913992285728455, -0.07324831932783127, 0.0463947169482708, 0.006614558398723602, -0.22308924794197083, -0.3880262076854706, -0.14035595953464508, -0.07921162247657776, 0.17726217210292816, -0.2802383005619049, 0.4486265480518341, -0.5790385007858276, -0.15004587173461914, -0.00007326342165470123, -0.03217074275016785, -0.2849447727203369, 0.2814604640007019, -0.273240864276886, -0.06345083564519882, -0.1931152641773224, 0.024621507152915, 0.3160390853881836, 0.2254040390253067, 0.29118281602859497, 0.20496916770935059, -0.3069373667240143, 0.3140944540500641, -0.09414389729499817, 0.16854235529899597, 0.7633002400398254, -0.0018072165548801422, 0.11994614452123642, 0.34088411927223206, 0.5542935729026794, 0.4060317575931549, 0.681222677230835, 0.1060827299952507, -0.5684740543365479, -0.026644669473171234, -0.2976146340370178, 0.2752879858016968, 0.3391740322113037, 0.19574227929115295, -0.1426192820072174, -0.2332392781972885, -0.12143495678901672, -0.5962797403335571, 0.0048218779265880585, 0.6384521126747131, -0.06977512687444687, -0.3294113576412201, -0.10974253714084625, 0.26602399349212646, 0.01982904225587845, 0.1059081107378006, -0.1032584011554718, 0.6814203858375549, -0.3524845540523529, 0.29314732551574707, 0.43852463364601135, 0.6986760497093201, -0.31745898723602295, 0.08485960960388184, 0.2611289918422699, -0.41698163747787476, 0.05339523032307625, -0.008640453219413757, -0.16793294250965118, -0.1286677122116089, 0.026765964925289154, -0.002383500337600708, 0.010570414364337921, 0.10287268459796906, 0.05427601933479309, -0.03950437903404236, -0.025233056396245956, -0.13475537300109863, -0.10187064111232758, -0.16843479871749878, 0.26752281188964844, 0.02645270712673664, -0.0855833888053894, -0.30577975511550903, 0.12090219557285309, -0.17668913304805756, -0.24624857306480408, 0.1322004199028015, -0.3132990896701813, -0.3896317481994629, 0.033578477799892426, -0.21205377578735352, 0.17872308194637299, 0.09609001874923706, 0.10728970170021057, 0.10292860865592957, -0.41311413049697876, 0.12592896819114685, 0.3106502294540405, 0.18212267756462097, -0.18301285803318024, -0.09230932593345642, 0.29682376980781555, -0.1273464411497116, 0.10368946194648743, 0.029159806668758392, 0.04628952592611313, 0.3173646926879883, -0.010158903896808624, 0.1919703185558319, -0.3208054304122925, -0.03930879384279251, 0.05043976008892059, -0.09223057329654694, -0.0019683297723531723, 0.29481789469718933, -0.0745924711227417, -0.08492542058229446, -0.20530332624912262, 0.15854820609092712, 0.05422896146774292, -0.0011428743600845337, -0.05587608739733696, 0.13133308291435242, -0.1556420922279358, 0.2875654995441437, -0.12445589900016785, 0.03552263230085373, 0.31148016452789307, -0.20124299824237823, -0.06983207166194916, 0.47928592562675476, -0.2162202000617981, -0.35114753246307373, 0.06262609362602234, -0.15597200393676758, 0.124468132853508, -0.35657575726509094, 0.22543083131313324, -0.3644396960735321, 0.10456603765487671, -0.3070925176143646, -0.08409903198480606, -0.007379754912108183, -0.4085598587989807, -0.09839437156915665, -0.04116646945476532, -0.038579411804676056, 0.3225950300693512, -0.30236488580703735, 0.1972884088754654, 0.06166757643222809, -0.07260958105325699, -0.1025754064321518, -0.16005875170230865, -0.1915740668773651, 0.24606581032276154, 0.07074514776468277, 0.3006419241428375, 0.3208974003791809, 0.03700247034430504, 0.11884783953428268, -0.39820000529289246, 0.08051833510398865, 0.09587366878986359, 0.06930314749479294, -0.021773288026452065, -0.3344597816467285, 0.1346713900566101, -0.028862766921520233, -0.03297141194343567, -0.009161468595266342, -0.08928275108337402, -0.11016947031021118, -0.3043563663959503, 0.06306718289852142, 0.209659144282341, -0.1419305056333542, -0.12058883905410767, 0.9170119762420654, 0.2859131097793579, 0.029125086963176727, -0.08836822211742401, 0.138609379529953, 0.33755743503570557, -0.06887565553188324, -0.02053120546042919, -0.21704143285751343, -0.000537477433681488, 0.06906968355178833, 0.2671671211719513, 0.01341732032597065, 0.05737423524260521, 0.4994564354419708, -0.3344879448413849, 0.21903619170188904, 0.27255484461784363, 0.400823712348938, 0.24880696833133698, -0.2676967978477478, -0.5458172559738159, 0.45789268612861633, 0.08216634392738342, -0.04859311506152153, 0.024749580770730972, 0.44291025400161743, -0.1257719099521637, -0.3181057572364807, 0.033412158489227295, 0.2590599060058594, 0.20852315425872803, -0.5375937819480896, -0.0032423213124275208, 0.42927515506744385, -0.2545764446258545, 0.10580794513225555, 0.08040713518857956, 0.05851776897907257, 0.23365382850170135, 0.026060422882437706, 0.17333675920963287, 0.06848163902759552, 0.3626081645488739, -0.08599037677049637, 0.1869955062866211, 0.3254638612270355, -0.09261880815029144, 0.08684144914150238, -0.11117130517959595, 0.1897805780172348, 0.08123205602169037, 0.04683030769228935, 0.5865591168403625, 0.3055868446826935, 0.10792411863803864, 0.32768091559410095, -0.495758056640625, -0.19348132610321045, 0.05727165937423706, -0.09897714853286743, 0.13845551013946533, 0.12484008073806763, -0.05365820229053497, -0.3922593593597412, 0.25666868686676025, -0.33554723858833313, -0.19774621725082397, -0.13969971239566803, 0.22027626633644104, -0.0032346993684768677, -0.060584839433431625, -0.39027321338653564, -0.15120570361614227, 0.47595852613449097, -0.2736614942550659, 0.2344486266374588, 0.05876272916793823, -0.2052232325077057, 0.23883210122585297, 0.33249086141586304, 0.4195669889450073, 0.07144515216350555, 0.08306039869785309, -0.1600944995880127, 0.281386137008667, 0.02718251198530197, 0.08298996090888977, 0.052955709397792816, -0.09173879772424698, -0.03044990822672844, 0.14321619272232056, 0.05522787570953369, 0.012671142816543579, -0.5502858757972717, 0.3455536663532257, 0.10991154611110687, 0.046859823167324066, -0.19337791204452515, -0.13313499093055725, 0.041244372725486755, -0.19122137129306793, -0.18751804530620575, -0.2555430233478546, -0.33245784044265747, -0.004474034532904625, 0.06573499739170074, 0.09889018535614014, 0.19960926473140717, 0.01873113214969635, -0.038432635366916656, 0.37142181396484375, 0.4363003373146057, -0.30787989497184753, -0.0035356003791093826, -0.12242960184812546, -0.5355163812637329, 0.29517385363578796, -0.269599586725235, -0.4630351662635803, 0.4378815293312073, 0.20798969268798828, 0.13077384233474731, 0.05380599573254585, 0.01805943250656128, 0.1585981696844101, -0.29508212208747864, 0.14028210937976837, -0.26408645510673523, -0.16466931998729706, 0.24281570315361023, -0.19256681203842163, -0.07076211273670197, 0.003395870327949524, 0.35976552963256836, -0.020562320947647095, -0.016280006617307663, 0.09018146991729736, 0.1677822768688202, -0.5286961793899536, -0.4443299174308777, -0.03129997104406357, 0.1747814267873764, 0.19653204083442688, -0.22732099890708923, -0.2542477250099182, -0.22993382811546326, -0.0498366542160511, -0.19927209615707397, 0.5373099446296692, -0.26691287755966187, 0.5406489372253418, 0.06785796582698822, -0.27915582060813904, -0.12024100124835968, 0.2953866720199585, 0.0641380324959755, -0.16347941756248474, -0.1523139327764511, 0.10899059474468231, 0.057386696338653564, -0.07962803542613983, -0.0009504631161689758, 0.26892566680908203, 0.1437426656484604, 0.16440999507904053, 0.061094820499420166, -0.24893951416015625, 0.2889636754989624, -0.3820137083530426, -0.21670272946357727, 0.1949497014284134, -0.07249452918767929, 0.1960967481136322, 0.06945039331912994, -0.42897215485572815, 0.030249804258346558, 0.12145823240280151, -0.22034421563148499, -0.026455849409103394, 0.2109253853559494, 0.1932188868522644, -0.07092390209436417, -0.004424840211868286, 0.07811242341995239, -0.169754296541214, -0.15706488490104675, 0.1803692877292633, -0.11369789391756058 ]
https://github.com/huggingface/datasets/issues/5869
> You don't need the dataset_infos.json file as long as you have the schema with HF metadata ;) I could also check that it works fine myself on the git revision without the dataset_infos.json file. > > What made you think it didn't work ? Those are two identical dataset repos where both were pushed with dask with the specified schema you mentioned above. I then uploaded the `dataset_infos.json` manually taken from the original example dataset into one of them. * **With schema**: https://huggingface.co/datasets/philippemo/dummy_dataset_with_schema * **Without schema**: https://huggingface.co/datasets/philippemo/dummy_dataset_without_schema You can see that in the examples without schema the images fail to render properly. When loaded with `datasets` they return an dict and not a Pillow Image
Image Encoding Issue when submitting a Parquet Dataset
### Describe the bug Hello, I'd like to report an issue related to pushing a dataset represented as a Parquet file to a dataset repository using Dask. Here are the details: We attempted to load an example dataset in Parquet format from the Hugging Face (HF) filesystem using Dask with the following code snippet: ``` import dask.dataframe as dd df = dd.read_parquet("hf://datasets/lambdalabs/pokemon-blip-captions",index=False) ``` In this dataset, the "image" column is represented as a dictionary/struct with the format: ``` df = df.compute() df["image"].iloc[0].keys() -> dict_keys(['bytes', 'path']) ``` I think this is the format encoded by the [`Image`](https://huggingface.co/docs/datasets/v2.0.0/en/package_reference/main_classes#datasets.Image) feature extractor from datasets to format suitable for Arrow. The next step was to push the dataset to a repository that I created: ``` dd.to_parquet(dask_df, path = "hf://datasets/philippemo/dummy_dataset/data") ``` However, after pushing the dataset using Dask, the "image" column is now represented as the encoded dictionary `(['bytes', 'path'])`, and the images are not properly visualized. You can find the dataset here: [Link to the problematic dataset](https://huggingface.co/datasets/philippemo/dummy_dataset). It's worth noting that both the original dataset and the one submitted with Dask have the same schema with minor alterations related to metadata: **[ Schema of original dummy example.](https://huggingface.co/datasets/lambdalabs/pokemon-blip-captions/blob/main/data/train-00000-of-00001-566cc9b19d7203f8.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` **[ Schema of pushed dataset with dask](https://huggingface.co/datasets/philippemo/dummy_dataset/blob/main/data/part.0.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` This issue seems to be related to an encoding type that occurs when pushing a model to the hub. Normally, models should be represented as an HF dataset before pushing, but we are working with an example where we need to push large datasets using Dask. Could you please provide clarification on how to resolve this issue? Thank you! ### Reproduction To get the schema I downloaded the parquet files and used pyarrow.parquet to read the schema ``` import pyarrow.parquet pyarrow.parquet.read_schema(<path_to_parquet>, memory_map=True) ``` ### Logs _No response_ ### System info ```shell - huggingface_hub version: 0.14.1 - Platform: Linux-5.19.0-41-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /home/philippe/.cache/huggingface/token - Has saved token ?: True - Who am I ?: philippemo - Configured git credential helpers: cache - FastAI: N/A - Tensorflow: N/A - Torch: N/A - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.4.0 - hf_transfer: N/A - gradio: N/A - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /home/philippe/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /home/philippe/.cache/huggingface/assets - HF_TOKEN_PATH: /home/philippe/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
116
Image Encoding Issue when submitting a Parquet Dataset ### Describe the bug Hello, I'd like to report an issue related to pushing a dataset represented as a Parquet file to a dataset repository using Dask. Here are the details: We attempted to load an example dataset in Parquet format from the Hugging Face (HF) filesystem using Dask with the following code snippet: ``` import dask.dataframe as dd df = dd.read_parquet("hf://datasets/lambdalabs/pokemon-blip-captions",index=False) ``` In this dataset, the "image" column is represented as a dictionary/struct with the format: ``` df = df.compute() df["image"].iloc[0].keys() -> dict_keys(['bytes', 'path']) ``` I think this is the format encoded by the [`Image`](https://huggingface.co/docs/datasets/v2.0.0/en/package_reference/main_classes#datasets.Image) feature extractor from datasets to format suitable for Arrow. The next step was to push the dataset to a repository that I created: ``` dd.to_parquet(dask_df, path = "hf://datasets/philippemo/dummy_dataset/data") ``` However, after pushing the dataset using Dask, the "image" column is now represented as the encoded dictionary `(['bytes', 'path'])`, and the images are not properly visualized. You can find the dataset here: [Link to the problematic dataset](https://huggingface.co/datasets/philippemo/dummy_dataset). It's worth noting that both the original dataset and the one submitted with Dask have the same schema with minor alterations related to metadata: **[ Schema of original dummy example.](https://huggingface.co/datasets/lambdalabs/pokemon-blip-captions/blob/main/data/train-00000-of-00001-566cc9b19d7203f8.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` **[ Schema of pushed dataset with dask](https://huggingface.co/datasets/philippemo/dummy_dataset/blob/main/data/part.0.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` This issue seems to be related to an encoding type that occurs when pushing a model to the hub. Normally, models should be represented as an HF dataset before pushing, but we are working with an example where we need to push large datasets using Dask. Could you please provide clarification on how to resolve this issue? Thank you! ### Reproduction To get the schema I downloaded the parquet files and used pyarrow.parquet to read the schema ``` import pyarrow.parquet pyarrow.parquet.read_schema(<path_to_parquet>, memory_map=True) ``` ### Logs _No response_ ### System info ```shell - huggingface_hub version: 0.14.1 - Platform: Linux-5.19.0-41-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /home/philippe/.cache/huggingface/token - Has saved token ?: True - Who am I ?: philippemo - Configured git credential helpers: cache - FastAI: N/A - Tensorflow: N/A - Torch: N/A - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.4.0 - hf_transfer: N/A - gradio: N/A - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /home/philippe/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /home/philippe/.cache/huggingface/assets - HF_TOKEN_PATH: /home/philippe/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` > You don't need the dataset_infos.json file as long as you have the schema with HF metadata ;) I could also check that it works fine myself on the git revision without the dataset_infos.json file. > > What made you think it didn't work ? Those are two identical dataset repos where both were pushed with dask with the specified schema you mentioned above. I then uploaded the `dataset_infos.json` manually taken from the original example dataset into one of them. * **With schema**: https://huggingface.co/datasets/philippemo/dummy_dataset_with_schema * **Without schema**: https://huggingface.co/datasets/philippemo/dummy_dataset_without_schema You can see that in the examples without schema the images fail to render properly. When loaded with `datasets` they return an dict and not a Pillow Image
[ -0.07916499674320221, -0.19343626499176025, 0.05645659565925598, 0.4631294906139374, 0.24050284922122955, -0.03627727925777435, -0.07235730439424515, 0.15203076601028442, -0.020293869078159332, 0.08434884250164032, 0.2394731044769287, 0.25118616223335266, -0.05058019608259201, 0.1921534389257431, 0.11636337637901306, 0.013332569971680641, 0.23355509340763092, -0.13842418789863586, 0.035421762615442276, -0.1840411126613617, 0.024526141583919525, 0.023211026564240456, 0.09557671844959259, -0.12756088376045227, -0.31958872079849243, -0.12848052382469177, -0.1838715821504593, 0.16795723140239716, -0.29963672161102295, -0.24417482316493988, 0.1643291413784027, -0.0545198954641819, -0.03208453953266144, 0.39378952980041504, -0.0001218078687088564, 0.19774697721004486, 0.34032559394836426, -0.17158105969429016, -0.5198479294776917, -0.07692272961139679, -0.3051050305366516, -0.3085200786590576, 0.05941668152809143, -0.309287965297699, 0.0069709718227386475, -0.25256574153900146, 0.20677407085895538, -0.22702455520629883, 0.4726438522338867, 0.08928938210010529, 0.14610987901687622, 0.005707211792469025, 0.0009384825825691223, 0.26594099402427673, 0.03785824775695801, 0.47385528683662415, -0.04954889416694641, 0.04280170425772667, -0.18786868453025818, 0.24820902943611145, -0.09282605350017548, 0.15272480249404907, 0.08712490648031235, -0.00805438868701458, -0.016361994668841362, 0.20589324831962585, 0.20241717994213104, -0.1180095225572586, 0.10727289319038391, -0.05603448301553726, 0.3830835819244385, -0.36889907717704773, -0.4593268036842346, -0.30965960025787354, -0.03681962192058563, -0.4328514337539673, 0.32440492510795593, 0.2548222243785858, -0.0003364458680152893, 0.03457079827785492, -0.21113935112953186, -0.09784790873527527, -0.018189646303653717, -0.0407535657286644, -0.42851364612579346, -0.08900092542171478, -0.05984817445278168, 0.006623944267630577, -0.19672420620918274, -0.19502106308937073, -0.25219568610191345, -0.3026195466518402, -0.1774444878101349, -0.013072261586785316, 0.01207483746111393, 0.08645853400230408, -0.38594385981559753, -0.17382048070430756, 0.24907076358795166, -0.21245458722114563, -0.02549496293067932, 0.044269971549510956, 0.07893548905849457, 0.03922950476408005, 0.5062429904937744, -0.12927505373954773, -0.03976383060216904, 0.2804526388645172, -0.14378151297569275, 0.2625155448913574, 0.11786860227584839, -0.1301410049200058, -0.09396785497665405, 0.04139737784862518, 0.008238278329372406, -0.33153077960014343, 0.3395339846611023, -0.20103085041046143, -0.26428651809692383, 0.3871088922023773, 0.014363810420036316, 0.15616726875305176, -0.2204391360282898, 0.05782905966043472, -0.05315091088414192, -0.09420032799243927, -0.04410804063081741, 0.47267287969589233, -0.16827616095542908, -0.15016549825668335, -0.1741468757390976, -0.030894160270690918, -0.23196938633918762, -0.18701446056365967, -0.2916504144668579, -0.11245979368686676, 0.10146734118461609, 0.33954858779907227, 0.26186174154281616, -0.0037779733538627625, -0.3535880744457245, -0.17566774785518646, 0.3936227262020111, 0.11428333818912506, -0.181613028049469, 0.07735942304134369, 0.22098040580749512, -0.5117228031158447, -0.022964052855968475, -0.11341151595115662, -0.5474387407302856, 0.2746683657169342, -0.2667553126811981, 0.011132691986858845, -0.08528672158718109, 0.044519055634737015, -0.7847863435745239, 0.2940651476383209, -0.1569625288248062, -0.06727255880832672, -0.0302228145301342, -0.12930867075920105, -0.15981081128120422, -0.05944700911641121, 0.340188592672348, 0.33771514892578125, -0.19652074575424194, -0.0005269423127174377, 0.211419016122818, 0.10521763563156128, 0.43732064962387085, 0.21744775772094727, 0.0002976544201374054, -0.2075202912092209, -0.19594281911849976, 0.2834984064102173, 0.2477104514837265, -0.3083104193210602, -0.3637264370918274, 0.20732124149799347, 0.05494142323732376, 0.5474240183830261, -0.1219802275300026, -0.33859020471572876, 0.706177294254303, 0.026742804795503616, -0.1680281013250351, 0.3964022994041443, -0.05914565175771713, 0.22435082495212555, -0.34280863404273987, -0.13862639665603638, 0.233963280916214, -0.0564732700586319, -0.15170186758041382, -0.03644343838095665, 0.2565060257911682, 0.131291002035141, 0.08944565802812576, -0.013808006420731544, 0.1822938770055771, 0.13118819892406464, 0.07572855055332184, 0.22033259272575378, 0.07828377932310104, 0.08855684101581573, -0.21446797251701355, 0.2078758329153061, 0.07565057277679443, -0.020138951018452644, -0.6611341238021851, -0.05346376821398735, -0.16341593861579895, 0.15432989597320557, -0.3454017639160156, -0.26112934947013855, 0.10302689671516418, -0.18398931622505188, -0.187301367521286, 0.3532286286354065, -0.043276917189359665, 0.4639715552330017, -0.07420756667852402, 0.09023401141166687, -0.0024136528372764587, 0.4434558153152466, 0.16038428246974945, -0.27561497688293457, 0.05932071805000305, 0.11286928504705429, 0.08718172460794449, -0.20341093838214874, -0.03168509528040886, 0.30247241258621216, 0.47361379861831665, 0.2217513471841812, 0.19026757776737213, -0.14624746143817902, 0.34467995166778564, -0.16282746195793152, 0.09265882521867752, 0.05102993920445442, 0.10109417140483856, 0.12053026258945465, -0.3240894675254822, 0.19300389289855957, 0.2009456604719162, 0.11035066843032837, -0.19701902568340302, 0.11846049875020981, 0.24099549651145935, 0.13371887803077698, 0.017451830208301544, -0.22268861532211304, -0.20250633358955383, -0.14895997941493988, 0.01594855636358261, -0.15677784383296967, -0.3826122283935547, -0.09111963212490082, 0.25387585163116455, 0.19720742106437683, -0.07561331987380981, 0.16839781403541565, -0.014281917363405228, -0.09961596876382828, 0.1962994486093521, 0.3102966547012329, -0.16031783819198608, 0.11406266689300537, -0.05157270282506943, -0.04516921192407608, -0.05097324773669243, 0.21072445809841156, 0.0645216554403305, 0.03468870744109154, 0.38239526748657227, 0.09176066517829895, 0.22126369178295135, 0.10599218308925629, -0.289608895778656, 0.3012440502643585, 0.06205640733242035, 0.08901318162679672, -0.130911722779274, 0.24661411345005035, -0.6420296430587769, -0.1346006691455841, -0.250227689743042, 0.5710702538490295, -0.682451605796814, -0.2674350440502167, -0.07291704416275024, -0.13285697996616364, -0.03968258202075958, 0.11197592318058014, -0.16302737593650818, -0.006094217300415039, -0.05273965001106262, -0.19894228875637054, -0.168374165892601, -0.23569059371948242, -0.23182329535484314, -0.027816852554678917, 0.3248855769634247, 0.21233808994293213, 0.38557004928588867, -0.02140980213880539, 0.03407187759876251, -0.518075704574585, -0.19129739701747894, 0.3227287530899048, -0.21198764443397522, 0.19274577498435974, 0.017438102513551712, 0.18571817874908447, -0.3791752755641937, -0.07872322201728821, 0.3171776533126831, 0.29951804876327515, -0.31969359517097473, 0.19377385079860687, 0.07341989874839783, -0.24825848639011383, -0.06052228808403015, 0.3777472674846649, -0.032671406865119934, -0.03471996262669563, 0.07491407543420792, 0.15761052072048187, 0.12044703960418701, 0.05838102102279663, 0.17136725783348083, -0.09452171623706818, 0.03701040893793106, -0.03860544413328171, -0.2712515592575073, -0.3488621711730957, 0.16746753454208374, -0.06116615608334541, -0.3941246271133423, -0.009151890873908997, -0.013774648308753967, 0.09752555936574936, 0.6122156381607056, -0.4919033348560333, -0.14909076690673828, -0.019757017493247986, 0.028535082936286926, 0.20034730434417725, -0.2247292846441269, -0.027866549789905548, -0.13298243284225464, 0.06330052763223648, -0.20220136642456055, -0.2573300898075104, 0.23993903398513794, 0.44075146317481995, 0.32058218121528625, 0.22766725718975067, 0.47231075167655945, 0.07370960712432861, 0.33951127529144287, 0.24130193889141083, -0.05962551757693291, 0.47799065709114075, -0.30464479327201843, 0.40736517310142517, -0.057125747203826904, 0.02726447582244873, 0.07030518352985382, 0.05161358416080475, -0.07665444910526276, 0.10197190940380096, -0.10778730362653732, -0.007601086050271988, 0.1210765466094017, 0.07934093475341797, -0.4577903747558594, -0.20341160893440247, -0.020402031019330025, -0.306393027305603, 0.22629229724407196, -0.05433841049671173, -0.06515920162200928, -0.04452984780073166, 0.001288682222366333, 0.1311672478914261, 0.08704619109630585, 0.2863551080226898, 0.15852703154087067, 0.1519756317138672, 0.20825409889221191, -0.3474852442741394, 0.0844966396689415, 0.08030015230178833, 0.41018542647361755, -0.08110155165195465, 0.14033301174640656, 0.263540118932724, -0.12458974123001099, 0.9913992285728455, -0.07324831932783127, 0.0463947169482708, 0.006614558398723602, -0.22308924794197083, -0.3880262076854706, -0.14035595953464508, -0.07921162247657776, 0.17726217210292816, -0.2802383005619049, 0.4486265480518341, -0.5790385007858276, -0.15004587173461914, -0.00007326342165470123, -0.03217074275016785, -0.2849447727203369, 0.2814604640007019, -0.273240864276886, -0.06345083564519882, -0.1931152641773224, 0.024621507152915, 0.3160390853881836, 0.2254040390253067, 0.29118281602859497, 0.20496916770935059, -0.3069373667240143, 0.3140944540500641, -0.09414389729499817, 0.16854235529899597, 0.7633002400398254, -0.0018072165548801422, 0.11994614452123642, 0.34088411927223206, 0.5542935729026794, 0.4060317575931549, 0.681222677230835, 0.1060827299952507, -0.5684740543365479, -0.026644669473171234, -0.2976146340370178, 0.2752879858016968, 0.3391740322113037, 0.19574227929115295, -0.1426192820072174, -0.2332392781972885, -0.12143495678901672, -0.5962797403335571, 0.0048218779265880585, 0.6384521126747131, -0.06977512687444687, -0.3294113576412201, -0.10974253714084625, 0.26602399349212646, 0.01982904225587845, 0.1059081107378006, -0.1032584011554718, 0.6814203858375549, -0.3524845540523529, 0.29314732551574707, 0.43852463364601135, 0.6986760497093201, -0.31745898723602295, 0.08485960960388184, 0.2611289918422699, -0.41698163747787476, 0.05339523032307625, -0.008640453219413757, -0.16793294250965118, -0.1286677122116089, 0.026765964925289154, -0.002383500337600708, 0.010570414364337921, 0.10287268459796906, 0.05427601933479309, -0.03950437903404236, -0.025233056396245956, -0.13475537300109863, -0.10187064111232758, -0.16843479871749878, 0.26752281188964844, 0.02645270712673664, -0.0855833888053894, -0.30577975511550903, 0.12090219557285309, -0.17668913304805756, -0.24624857306480408, 0.1322004199028015, -0.3132990896701813, -0.3896317481994629, 0.033578477799892426, -0.21205377578735352, 0.17872308194637299, 0.09609001874923706, 0.10728970170021057, 0.10292860865592957, -0.41311413049697876, 0.12592896819114685, 0.3106502294540405, 0.18212267756462097, -0.18301285803318024, -0.09230932593345642, 0.29682376980781555, -0.1273464411497116, 0.10368946194648743, 0.029159806668758392, 0.04628952592611313, 0.3173646926879883, -0.010158903896808624, 0.1919703185558319, -0.3208054304122925, -0.03930879384279251, 0.05043976008892059, -0.09223057329654694, -0.0019683297723531723, 0.29481789469718933, -0.0745924711227417, -0.08492542058229446, -0.20530332624912262, 0.15854820609092712, 0.05422896146774292, -0.0011428743600845337, -0.05587608739733696, 0.13133308291435242, -0.1556420922279358, 0.2875654995441437, -0.12445589900016785, 0.03552263230085373, 0.31148016452789307, -0.20124299824237823, -0.06983207166194916, 0.47928592562675476, -0.2162202000617981, -0.35114753246307373, 0.06262609362602234, -0.15597200393676758, 0.124468132853508, -0.35657575726509094, 0.22543083131313324, -0.3644396960735321, 0.10456603765487671, -0.3070925176143646, -0.08409903198480606, -0.007379754912108183, -0.4085598587989807, -0.09839437156915665, -0.04116646945476532, -0.038579411804676056, 0.3225950300693512, -0.30236488580703735, 0.1972884088754654, 0.06166757643222809, -0.07260958105325699, -0.1025754064321518, -0.16005875170230865, -0.1915740668773651, 0.24606581032276154, 0.07074514776468277, 0.3006419241428375, 0.3208974003791809, 0.03700247034430504, 0.11884783953428268, -0.39820000529289246, 0.08051833510398865, 0.09587366878986359, 0.06930314749479294, -0.021773288026452065, -0.3344597816467285, 0.1346713900566101, -0.028862766921520233, -0.03297141194343567, -0.009161468595266342, -0.08928275108337402, -0.11016947031021118, -0.3043563663959503, 0.06306718289852142, 0.209659144282341, -0.1419305056333542, -0.12058883905410767, 0.9170119762420654, 0.2859131097793579, 0.029125086963176727, -0.08836822211742401, 0.138609379529953, 0.33755743503570557, -0.06887565553188324, -0.02053120546042919, -0.21704143285751343, -0.000537477433681488, 0.06906968355178833, 0.2671671211719513, 0.01341732032597065, 0.05737423524260521, 0.4994564354419708, -0.3344879448413849, 0.21903619170188904, 0.27255484461784363, 0.400823712348938, 0.24880696833133698, -0.2676967978477478, -0.5458172559738159, 0.45789268612861633, 0.08216634392738342, -0.04859311506152153, 0.024749580770730972, 0.44291025400161743, -0.1257719099521637, -0.3181057572364807, 0.033412158489227295, 0.2590599060058594, 0.20852315425872803, -0.5375937819480896, -0.0032423213124275208, 0.42927515506744385, -0.2545764446258545, 0.10580794513225555, 0.08040713518857956, 0.05851776897907257, 0.23365382850170135, 0.026060422882437706, 0.17333675920963287, 0.06848163902759552, 0.3626081645488739, -0.08599037677049637, 0.1869955062866211, 0.3254638612270355, -0.09261880815029144, 0.08684144914150238, -0.11117130517959595, 0.1897805780172348, 0.08123205602169037, 0.04683030769228935, 0.5865591168403625, 0.3055868446826935, 0.10792411863803864, 0.32768091559410095, -0.495758056640625, -0.19348132610321045, 0.05727165937423706, -0.09897714853286743, 0.13845551013946533, 0.12484008073806763, -0.05365820229053497, -0.3922593593597412, 0.25666868686676025, -0.33554723858833313, -0.19774621725082397, -0.13969971239566803, 0.22027626633644104, -0.0032346993684768677, -0.060584839433431625, -0.39027321338653564, -0.15120570361614227, 0.47595852613449097, -0.2736614942550659, 0.2344486266374588, 0.05876272916793823, -0.2052232325077057, 0.23883210122585297, 0.33249086141586304, 0.4195669889450073, 0.07144515216350555, 0.08306039869785309, -0.1600944995880127, 0.281386137008667, 0.02718251198530197, 0.08298996090888977, 0.052955709397792816, -0.09173879772424698, -0.03044990822672844, 0.14321619272232056, 0.05522787570953369, 0.012671142816543579, -0.5502858757972717, 0.3455536663532257, 0.10991154611110687, 0.046859823167324066, -0.19337791204452515, -0.13313499093055725, 0.041244372725486755, -0.19122137129306793, -0.18751804530620575, -0.2555430233478546, -0.33245784044265747, -0.004474034532904625, 0.06573499739170074, 0.09889018535614014, 0.19960926473140717, 0.01873113214969635, -0.038432635366916656, 0.37142181396484375, 0.4363003373146057, -0.30787989497184753, -0.0035356003791093826, -0.12242960184812546, -0.5355163812637329, 0.29517385363578796, -0.269599586725235, -0.4630351662635803, 0.4378815293312073, 0.20798969268798828, 0.13077384233474731, 0.05380599573254585, 0.01805943250656128, 0.1585981696844101, -0.29508212208747864, 0.14028210937976837, -0.26408645510673523, -0.16466931998729706, 0.24281570315361023, -0.19256681203842163, -0.07076211273670197, 0.003395870327949524, 0.35976552963256836, -0.020562320947647095, -0.016280006617307663, 0.09018146991729736, 0.1677822768688202, -0.5286961793899536, -0.4443299174308777, -0.03129997104406357, 0.1747814267873764, 0.19653204083442688, -0.22732099890708923, -0.2542477250099182, -0.22993382811546326, -0.0498366542160511, -0.19927209615707397, 0.5373099446296692, -0.26691287755966187, 0.5406489372253418, 0.06785796582698822, -0.27915582060813904, -0.12024100124835968, 0.2953866720199585, 0.0641380324959755, -0.16347941756248474, -0.1523139327764511, 0.10899059474468231, 0.057386696338653564, -0.07962803542613983, -0.0009504631161689758, 0.26892566680908203, 0.1437426656484604, 0.16440999507904053, 0.061094820499420166, -0.24893951416015625, 0.2889636754989624, -0.3820137083530426, -0.21670272946357727, 0.1949497014284134, -0.07249452918767929, 0.1960967481136322, 0.06945039331912994, -0.42897215485572815, 0.030249804258346558, 0.12145823240280151, -0.22034421563148499, -0.026455849409103394, 0.2109253853559494, 0.1932188868522644, -0.07092390209436417, -0.004424840211868286, 0.07811242341995239, -0.169754296541214, -0.15706488490104675, 0.1803692877292633, -0.11369789391756058 ]
https://github.com/huggingface/datasets/issues/5869
I see ! I think it's a bug on our side - it should work without the metadata - let me investigate
Image Encoding Issue when submitting a Parquet Dataset
### Describe the bug Hello, I'd like to report an issue related to pushing a dataset represented as a Parquet file to a dataset repository using Dask. Here are the details: We attempted to load an example dataset in Parquet format from the Hugging Face (HF) filesystem using Dask with the following code snippet: ``` import dask.dataframe as dd df = dd.read_parquet("hf://datasets/lambdalabs/pokemon-blip-captions",index=False) ``` In this dataset, the "image" column is represented as a dictionary/struct with the format: ``` df = df.compute() df["image"].iloc[0].keys() -> dict_keys(['bytes', 'path']) ``` I think this is the format encoded by the [`Image`](https://huggingface.co/docs/datasets/v2.0.0/en/package_reference/main_classes#datasets.Image) feature extractor from datasets to format suitable for Arrow. The next step was to push the dataset to a repository that I created: ``` dd.to_parquet(dask_df, path = "hf://datasets/philippemo/dummy_dataset/data") ``` However, after pushing the dataset using Dask, the "image" column is now represented as the encoded dictionary `(['bytes', 'path'])`, and the images are not properly visualized. You can find the dataset here: [Link to the problematic dataset](https://huggingface.co/datasets/philippemo/dummy_dataset). It's worth noting that both the original dataset and the one submitted with Dask have the same schema with minor alterations related to metadata: **[ Schema of original dummy example.](https://huggingface.co/datasets/lambdalabs/pokemon-blip-captions/blob/main/data/train-00000-of-00001-566cc9b19d7203f8.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` **[ Schema of pushed dataset with dask](https://huggingface.co/datasets/philippemo/dummy_dataset/blob/main/data/part.0.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` This issue seems to be related to an encoding type that occurs when pushing a model to the hub. Normally, models should be represented as an HF dataset before pushing, but we are working with an example where we need to push large datasets using Dask. Could you please provide clarification on how to resolve this issue? Thank you! ### Reproduction To get the schema I downloaded the parquet files and used pyarrow.parquet to read the schema ``` import pyarrow.parquet pyarrow.parquet.read_schema(<path_to_parquet>, memory_map=True) ``` ### Logs _No response_ ### System info ```shell - huggingface_hub version: 0.14.1 - Platform: Linux-5.19.0-41-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /home/philippe/.cache/huggingface/token - Has saved token ?: True - Who am I ?: philippemo - Configured git credential helpers: cache - FastAI: N/A - Tensorflow: N/A - Torch: N/A - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.4.0 - hf_transfer: N/A - gradio: N/A - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /home/philippe/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /home/philippe/.cache/huggingface/assets - HF_TOKEN_PATH: /home/philippe/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
22
Image Encoding Issue when submitting a Parquet Dataset ### Describe the bug Hello, I'd like to report an issue related to pushing a dataset represented as a Parquet file to a dataset repository using Dask. Here are the details: We attempted to load an example dataset in Parquet format from the Hugging Face (HF) filesystem using Dask with the following code snippet: ``` import dask.dataframe as dd df = dd.read_parquet("hf://datasets/lambdalabs/pokemon-blip-captions",index=False) ``` In this dataset, the "image" column is represented as a dictionary/struct with the format: ``` df = df.compute() df["image"].iloc[0].keys() -> dict_keys(['bytes', 'path']) ``` I think this is the format encoded by the [`Image`](https://huggingface.co/docs/datasets/v2.0.0/en/package_reference/main_classes#datasets.Image) feature extractor from datasets to format suitable for Arrow. The next step was to push the dataset to a repository that I created: ``` dd.to_parquet(dask_df, path = "hf://datasets/philippemo/dummy_dataset/data") ``` However, after pushing the dataset using Dask, the "image" column is now represented as the encoded dictionary `(['bytes', 'path'])`, and the images are not properly visualized. You can find the dataset here: [Link to the problematic dataset](https://huggingface.co/datasets/philippemo/dummy_dataset). It's worth noting that both the original dataset and the one submitted with Dask have the same schema with minor alterations related to metadata: **[ Schema of original dummy example.](https://huggingface.co/datasets/lambdalabs/pokemon-blip-captions/blob/main/data/train-00000-of-00001-566cc9b19d7203f8.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` **[ Schema of pushed dataset with dask](https://huggingface.co/datasets/philippemo/dummy_dataset/blob/main/data/part.0.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` This issue seems to be related to an encoding type that occurs when pushing a model to the hub. Normally, models should be represented as an HF dataset before pushing, but we are working with an example where we need to push large datasets using Dask. Could you please provide clarification on how to resolve this issue? Thank you! ### Reproduction To get the schema I downloaded the parquet files and used pyarrow.parquet to read the schema ``` import pyarrow.parquet pyarrow.parquet.read_schema(<path_to_parquet>, memory_map=True) ``` ### Logs _No response_ ### System info ```shell - huggingface_hub version: 0.14.1 - Platform: Linux-5.19.0-41-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /home/philippe/.cache/huggingface/token - Has saved token ?: True - Who am I ?: philippemo - Configured git credential helpers: cache - FastAI: N/A - Tensorflow: N/A - Torch: N/A - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.4.0 - hf_transfer: N/A - gradio: N/A - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /home/philippe/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /home/philippe/.cache/huggingface/assets - HF_TOKEN_PATH: /home/philippe/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` I see ! I think it's a bug on our side - it should work without the metadata - let me investigate
[ -0.07916499674320221, -0.19343626499176025, 0.05645659565925598, 0.4631294906139374, 0.24050284922122955, -0.03627727925777435, -0.07235730439424515, 0.15203076601028442, -0.020293869078159332, 0.08434884250164032, 0.2394731044769287, 0.25118616223335266, -0.05058019608259201, 0.1921534389257431, 0.11636337637901306, 0.013332569971680641, 0.23355509340763092, -0.13842418789863586, 0.035421762615442276, -0.1840411126613617, 0.024526141583919525, 0.023211026564240456, 0.09557671844959259, -0.12756088376045227, -0.31958872079849243, -0.12848052382469177, -0.1838715821504593, 0.16795723140239716, -0.29963672161102295, -0.24417482316493988, 0.1643291413784027, -0.0545198954641819, -0.03208453953266144, 0.39378952980041504, -0.0001218078687088564, 0.19774697721004486, 0.34032559394836426, -0.17158105969429016, -0.5198479294776917, -0.07692272961139679, -0.3051050305366516, -0.3085200786590576, 0.05941668152809143, -0.309287965297699, 0.0069709718227386475, -0.25256574153900146, 0.20677407085895538, -0.22702455520629883, 0.4726438522338867, 0.08928938210010529, 0.14610987901687622, 0.005707211792469025, 0.0009384825825691223, 0.26594099402427673, 0.03785824775695801, 0.47385528683662415, -0.04954889416694641, 0.04280170425772667, -0.18786868453025818, 0.24820902943611145, -0.09282605350017548, 0.15272480249404907, 0.08712490648031235, -0.00805438868701458, -0.016361994668841362, 0.20589324831962585, 0.20241717994213104, -0.1180095225572586, 0.10727289319038391, -0.05603448301553726, 0.3830835819244385, -0.36889907717704773, -0.4593268036842346, -0.30965960025787354, -0.03681962192058563, -0.4328514337539673, 0.32440492510795593, 0.2548222243785858, -0.0003364458680152893, 0.03457079827785492, -0.21113935112953186, -0.09784790873527527, -0.018189646303653717, -0.0407535657286644, -0.42851364612579346, -0.08900092542171478, -0.05984817445278168, 0.006623944267630577, -0.19672420620918274, -0.19502106308937073, -0.25219568610191345, -0.3026195466518402, -0.1774444878101349, -0.013072261586785316, 0.01207483746111393, 0.08645853400230408, -0.38594385981559753, -0.17382048070430756, 0.24907076358795166, -0.21245458722114563, -0.02549496293067932, 0.044269971549510956, 0.07893548905849457, 0.03922950476408005, 0.5062429904937744, -0.12927505373954773, -0.03976383060216904, 0.2804526388645172, -0.14378151297569275, 0.2625155448913574, 0.11786860227584839, -0.1301410049200058, -0.09396785497665405, 0.04139737784862518, 0.008238278329372406, -0.33153077960014343, 0.3395339846611023, -0.20103085041046143, -0.26428651809692383, 0.3871088922023773, 0.014363810420036316, 0.15616726875305176, -0.2204391360282898, 0.05782905966043472, -0.05315091088414192, -0.09420032799243927, -0.04410804063081741, 0.47267287969589233, -0.16827616095542908, -0.15016549825668335, -0.1741468757390976, -0.030894160270690918, -0.23196938633918762, -0.18701446056365967, -0.2916504144668579, -0.11245979368686676, 0.10146734118461609, 0.33954858779907227, 0.26186174154281616, -0.0037779733538627625, -0.3535880744457245, -0.17566774785518646, 0.3936227262020111, 0.11428333818912506, -0.181613028049469, 0.07735942304134369, 0.22098040580749512, -0.5117228031158447, -0.022964052855968475, -0.11341151595115662, -0.5474387407302856, 0.2746683657169342, -0.2667553126811981, 0.011132691986858845, -0.08528672158718109, 0.044519055634737015, -0.7847863435745239, 0.2940651476383209, -0.1569625288248062, -0.06727255880832672, -0.0302228145301342, -0.12930867075920105, -0.15981081128120422, -0.05944700911641121, 0.340188592672348, 0.33771514892578125, -0.19652074575424194, -0.0005269423127174377, 0.211419016122818, 0.10521763563156128, 0.43732064962387085, 0.21744775772094727, 0.0002976544201374054, -0.2075202912092209, -0.19594281911849976, 0.2834984064102173, 0.2477104514837265, -0.3083104193210602, -0.3637264370918274, 0.20732124149799347, 0.05494142323732376, 0.5474240183830261, -0.1219802275300026, -0.33859020471572876, 0.706177294254303, 0.026742804795503616, -0.1680281013250351, 0.3964022994041443, -0.05914565175771713, 0.22435082495212555, -0.34280863404273987, -0.13862639665603638, 0.233963280916214, -0.0564732700586319, -0.15170186758041382, -0.03644343838095665, 0.2565060257911682, 0.131291002035141, 0.08944565802812576, -0.013808006420731544, 0.1822938770055771, 0.13118819892406464, 0.07572855055332184, 0.22033259272575378, 0.07828377932310104, 0.08855684101581573, -0.21446797251701355, 0.2078758329153061, 0.07565057277679443, -0.020138951018452644, -0.6611341238021851, -0.05346376821398735, -0.16341593861579895, 0.15432989597320557, -0.3454017639160156, -0.26112934947013855, 0.10302689671516418, -0.18398931622505188, -0.187301367521286, 0.3532286286354065, -0.043276917189359665, 0.4639715552330017, -0.07420756667852402, 0.09023401141166687, -0.0024136528372764587, 0.4434558153152466, 0.16038428246974945, -0.27561497688293457, 0.05932071805000305, 0.11286928504705429, 0.08718172460794449, -0.20341093838214874, -0.03168509528040886, 0.30247241258621216, 0.47361379861831665, 0.2217513471841812, 0.19026757776737213, -0.14624746143817902, 0.34467995166778564, -0.16282746195793152, 0.09265882521867752, 0.05102993920445442, 0.10109417140483856, 0.12053026258945465, -0.3240894675254822, 0.19300389289855957, 0.2009456604719162, 0.11035066843032837, -0.19701902568340302, 0.11846049875020981, 0.24099549651145935, 0.13371887803077698, 0.017451830208301544, -0.22268861532211304, -0.20250633358955383, -0.14895997941493988, 0.01594855636358261, -0.15677784383296967, -0.3826122283935547, -0.09111963212490082, 0.25387585163116455, 0.19720742106437683, -0.07561331987380981, 0.16839781403541565, -0.014281917363405228, -0.09961596876382828, 0.1962994486093521, 0.3102966547012329, -0.16031783819198608, 0.11406266689300537, -0.05157270282506943, -0.04516921192407608, -0.05097324773669243, 0.21072445809841156, 0.0645216554403305, 0.03468870744109154, 0.38239526748657227, 0.09176066517829895, 0.22126369178295135, 0.10599218308925629, -0.289608895778656, 0.3012440502643585, 0.06205640733242035, 0.08901318162679672, -0.130911722779274, 0.24661411345005035, -0.6420296430587769, -0.1346006691455841, -0.250227689743042, 0.5710702538490295, -0.682451605796814, -0.2674350440502167, -0.07291704416275024, -0.13285697996616364, -0.03968258202075958, 0.11197592318058014, -0.16302737593650818, -0.006094217300415039, -0.05273965001106262, -0.19894228875637054, -0.168374165892601, -0.23569059371948242, -0.23182329535484314, -0.027816852554678917, 0.3248855769634247, 0.21233808994293213, 0.38557004928588867, -0.02140980213880539, 0.03407187759876251, -0.518075704574585, -0.19129739701747894, 0.3227287530899048, -0.21198764443397522, 0.19274577498435974, 0.017438102513551712, 0.18571817874908447, -0.3791752755641937, -0.07872322201728821, 0.3171776533126831, 0.29951804876327515, -0.31969359517097473, 0.19377385079860687, 0.07341989874839783, -0.24825848639011383, -0.06052228808403015, 0.3777472674846649, -0.032671406865119934, -0.03471996262669563, 0.07491407543420792, 0.15761052072048187, 0.12044703960418701, 0.05838102102279663, 0.17136725783348083, -0.09452171623706818, 0.03701040893793106, -0.03860544413328171, -0.2712515592575073, -0.3488621711730957, 0.16746753454208374, -0.06116615608334541, -0.3941246271133423, -0.009151890873908997, -0.013774648308753967, 0.09752555936574936, 0.6122156381607056, -0.4919033348560333, -0.14909076690673828, -0.019757017493247986, 0.028535082936286926, 0.20034730434417725, -0.2247292846441269, -0.027866549789905548, -0.13298243284225464, 0.06330052763223648, -0.20220136642456055, -0.2573300898075104, 0.23993903398513794, 0.44075146317481995, 0.32058218121528625, 0.22766725718975067, 0.47231075167655945, 0.07370960712432861, 0.33951127529144287, 0.24130193889141083, -0.05962551757693291, 0.47799065709114075, -0.30464479327201843, 0.40736517310142517, -0.057125747203826904, 0.02726447582244873, 0.07030518352985382, 0.05161358416080475, -0.07665444910526276, 0.10197190940380096, -0.10778730362653732, -0.007601086050271988, 0.1210765466094017, 0.07934093475341797, -0.4577903747558594, -0.20341160893440247, -0.020402031019330025, -0.306393027305603, 0.22629229724407196, -0.05433841049671173, -0.06515920162200928, -0.04452984780073166, 0.001288682222366333, 0.1311672478914261, 0.08704619109630585, 0.2863551080226898, 0.15852703154087067, 0.1519756317138672, 0.20825409889221191, -0.3474852442741394, 0.0844966396689415, 0.08030015230178833, 0.41018542647361755, -0.08110155165195465, 0.14033301174640656, 0.263540118932724, -0.12458974123001099, 0.9913992285728455, -0.07324831932783127, 0.0463947169482708, 0.006614558398723602, -0.22308924794197083, -0.3880262076854706, -0.14035595953464508, -0.07921162247657776, 0.17726217210292816, -0.2802383005619049, 0.4486265480518341, -0.5790385007858276, -0.15004587173461914, -0.00007326342165470123, -0.03217074275016785, -0.2849447727203369, 0.2814604640007019, -0.273240864276886, -0.06345083564519882, -0.1931152641773224, 0.024621507152915, 0.3160390853881836, 0.2254040390253067, 0.29118281602859497, 0.20496916770935059, -0.3069373667240143, 0.3140944540500641, -0.09414389729499817, 0.16854235529899597, 0.7633002400398254, -0.0018072165548801422, 0.11994614452123642, 0.34088411927223206, 0.5542935729026794, 0.4060317575931549, 0.681222677230835, 0.1060827299952507, -0.5684740543365479, -0.026644669473171234, -0.2976146340370178, 0.2752879858016968, 0.3391740322113037, 0.19574227929115295, -0.1426192820072174, -0.2332392781972885, -0.12143495678901672, -0.5962797403335571, 0.0048218779265880585, 0.6384521126747131, -0.06977512687444687, -0.3294113576412201, -0.10974253714084625, 0.26602399349212646, 0.01982904225587845, 0.1059081107378006, -0.1032584011554718, 0.6814203858375549, -0.3524845540523529, 0.29314732551574707, 0.43852463364601135, 0.6986760497093201, -0.31745898723602295, 0.08485960960388184, 0.2611289918422699, -0.41698163747787476, 0.05339523032307625, -0.008640453219413757, -0.16793294250965118, -0.1286677122116089, 0.026765964925289154, -0.002383500337600708, 0.010570414364337921, 0.10287268459796906, 0.05427601933479309, -0.03950437903404236, -0.025233056396245956, -0.13475537300109863, -0.10187064111232758, -0.16843479871749878, 0.26752281188964844, 0.02645270712673664, -0.0855833888053894, -0.30577975511550903, 0.12090219557285309, -0.17668913304805756, -0.24624857306480408, 0.1322004199028015, -0.3132990896701813, -0.3896317481994629, 0.033578477799892426, -0.21205377578735352, 0.17872308194637299, 0.09609001874923706, 0.10728970170021057, 0.10292860865592957, -0.41311413049697876, 0.12592896819114685, 0.3106502294540405, 0.18212267756462097, -0.18301285803318024, -0.09230932593345642, 0.29682376980781555, -0.1273464411497116, 0.10368946194648743, 0.029159806668758392, 0.04628952592611313, 0.3173646926879883, -0.010158903896808624, 0.1919703185558319, -0.3208054304122925, -0.03930879384279251, 0.05043976008892059, -0.09223057329654694, -0.0019683297723531723, 0.29481789469718933, -0.0745924711227417, -0.08492542058229446, -0.20530332624912262, 0.15854820609092712, 0.05422896146774292, -0.0011428743600845337, -0.05587608739733696, 0.13133308291435242, -0.1556420922279358, 0.2875654995441437, -0.12445589900016785, 0.03552263230085373, 0.31148016452789307, -0.20124299824237823, -0.06983207166194916, 0.47928592562675476, -0.2162202000617981, -0.35114753246307373, 0.06262609362602234, -0.15597200393676758, 0.124468132853508, -0.35657575726509094, 0.22543083131313324, -0.3644396960735321, 0.10456603765487671, -0.3070925176143646, -0.08409903198480606, -0.007379754912108183, -0.4085598587989807, -0.09839437156915665, -0.04116646945476532, -0.038579411804676056, 0.3225950300693512, -0.30236488580703735, 0.1972884088754654, 0.06166757643222809, -0.07260958105325699, -0.1025754064321518, -0.16005875170230865, -0.1915740668773651, 0.24606581032276154, 0.07074514776468277, 0.3006419241428375, 0.3208974003791809, 0.03700247034430504, 0.11884783953428268, -0.39820000529289246, 0.08051833510398865, 0.09587366878986359, 0.06930314749479294, -0.021773288026452065, -0.3344597816467285, 0.1346713900566101, -0.028862766921520233, -0.03297141194343567, -0.009161468595266342, -0.08928275108337402, -0.11016947031021118, -0.3043563663959503, 0.06306718289852142, 0.209659144282341, -0.1419305056333542, -0.12058883905410767, 0.9170119762420654, 0.2859131097793579, 0.029125086963176727, -0.08836822211742401, 0.138609379529953, 0.33755743503570557, -0.06887565553188324, -0.02053120546042919, -0.21704143285751343, -0.000537477433681488, 0.06906968355178833, 0.2671671211719513, 0.01341732032597065, 0.05737423524260521, 0.4994564354419708, -0.3344879448413849, 0.21903619170188904, 0.27255484461784363, 0.400823712348938, 0.24880696833133698, -0.2676967978477478, -0.5458172559738159, 0.45789268612861633, 0.08216634392738342, -0.04859311506152153, 0.024749580770730972, 0.44291025400161743, -0.1257719099521637, -0.3181057572364807, 0.033412158489227295, 0.2590599060058594, 0.20852315425872803, -0.5375937819480896, -0.0032423213124275208, 0.42927515506744385, -0.2545764446258545, 0.10580794513225555, 0.08040713518857956, 0.05851776897907257, 0.23365382850170135, 0.026060422882437706, 0.17333675920963287, 0.06848163902759552, 0.3626081645488739, -0.08599037677049637, 0.1869955062866211, 0.3254638612270355, -0.09261880815029144, 0.08684144914150238, -0.11117130517959595, 0.1897805780172348, 0.08123205602169037, 0.04683030769228935, 0.5865591168403625, 0.3055868446826935, 0.10792411863803864, 0.32768091559410095, -0.495758056640625, -0.19348132610321045, 0.05727165937423706, -0.09897714853286743, 0.13845551013946533, 0.12484008073806763, -0.05365820229053497, -0.3922593593597412, 0.25666868686676025, -0.33554723858833313, -0.19774621725082397, -0.13969971239566803, 0.22027626633644104, -0.0032346993684768677, -0.060584839433431625, -0.39027321338653564, -0.15120570361614227, 0.47595852613449097, -0.2736614942550659, 0.2344486266374588, 0.05876272916793823, -0.2052232325077057, 0.23883210122585297, 0.33249086141586304, 0.4195669889450073, 0.07144515216350555, 0.08306039869785309, -0.1600944995880127, 0.281386137008667, 0.02718251198530197, 0.08298996090888977, 0.052955709397792816, -0.09173879772424698, -0.03044990822672844, 0.14321619272232056, 0.05522787570953369, 0.012671142816543579, -0.5502858757972717, 0.3455536663532257, 0.10991154611110687, 0.046859823167324066, -0.19337791204452515, -0.13313499093055725, 0.041244372725486755, -0.19122137129306793, -0.18751804530620575, -0.2555430233478546, -0.33245784044265747, -0.004474034532904625, 0.06573499739170074, 0.09889018535614014, 0.19960926473140717, 0.01873113214969635, -0.038432635366916656, 0.37142181396484375, 0.4363003373146057, -0.30787989497184753, -0.0035356003791093826, -0.12242960184812546, -0.5355163812637329, 0.29517385363578796, -0.269599586725235, -0.4630351662635803, 0.4378815293312073, 0.20798969268798828, 0.13077384233474731, 0.05380599573254585, 0.01805943250656128, 0.1585981696844101, -0.29508212208747864, 0.14028210937976837, -0.26408645510673523, -0.16466931998729706, 0.24281570315361023, -0.19256681203842163, -0.07076211273670197, 0.003395870327949524, 0.35976552963256836, -0.020562320947647095, -0.016280006617307663, 0.09018146991729736, 0.1677822768688202, -0.5286961793899536, -0.4443299174308777, -0.03129997104406357, 0.1747814267873764, 0.19653204083442688, -0.22732099890708923, -0.2542477250099182, -0.22993382811546326, -0.0498366542160511, -0.19927209615707397, 0.5373099446296692, -0.26691287755966187, 0.5406489372253418, 0.06785796582698822, -0.27915582060813904, -0.12024100124835968, 0.2953866720199585, 0.0641380324959755, -0.16347941756248474, -0.1523139327764511, 0.10899059474468231, 0.057386696338653564, -0.07962803542613983, -0.0009504631161689758, 0.26892566680908203, 0.1437426656484604, 0.16440999507904053, 0.061094820499420166, -0.24893951416015625, 0.2889636754989624, -0.3820137083530426, -0.21670272946357727, 0.1949497014284134, -0.07249452918767929, 0.1960967481136322, 0.06945039331912994, -0.42897215485572815, 0.030249804258346558, 0.12145823240280151, -0.22034421563148499, -0.026455849409103394, 0.2109253853559494, 0.1932188868522644, -0.07092390209436417, -0.004424840211868286, 0.07811242341995239, -0.169754296541214, -0.15706488490104675, 0.1803692877292633, -0.11369789391756058 ]
https://github.com/huggingface/datasets/issues/5869
Alright, it's fixed: https://huggingface.co/datasets/philippemo/dummy_dataset_without_schema It shows the image correctly now - even without the extra metadata :)
Image Encoding Issue when submitting a Parquet Dataset
### Describe the bug Hello, I'd like to report an issue related to pushing a dataset represented as a Parquet file to a dataset repository using Dask. Here are the details: We attempted to load an example dataset in Parquet format from the Hugging Face (HF) filesystem using Dask with the following code snippet: ``` import dask.dataframe as dd df = dd.read_parquet("hf://datasets/lambdalabs/pokemon-blip-captions",index=False) ``` In this dataset, the "image" column is represented as a dictionary/struct with the format: ``` df = df.compute() df["image"].iloc[0].keys() -> dict_keys(['bytes', 'path']) ``` I think this is the format encoded by the [`Image`](https://huggingface.co/docs/datasets/v2.0.0/en/package_reference/main_classes#datasets.Image) feature extractor from datasets to format suitable for Arrow. The next step was to push the dataset to a repository that I created: ``` dd.to_parquet(dask_df, path = "hf://datasets/philippemo/dummy_dataset/data") ``` However, after pushing the dataset using Dask, the "image" column is now represented as the encoded dictionary `(['bytes', 'path'])`, and the images are not properly visualized. You can find the dataset here: [Link to the problematic dataset](https://huggingface.co/datasets/philippemo/dummy_dataset). It's worth noting that both the original dataset and the one submitted with Dask have the same schema with minor alterations related to metadata: **[ Schema of original dummy example.](https://huggingface.co/datasets/lambdalabs/pokemon-blip-captions/blob/main/data/train-00000-of-00001-566cc9b19d7203f8.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` **[ Schema of pushed dataset with dask](https://huggingface.co/datasets/philippemo/dummy_dataset/blob/main/data/part.0.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` This issue seems to be related to an encoding type that occurs when pushing a model to the hub. Normally, models should be represented as an HF dataset before pushing, but we are working with an example where we need to push large datasets using Dask. Could you please provide clarification on how to resolve this issue? Thank you! ### Reproduction To get the schema I downloaded the parquet files and used pyarrow.parquet to read the schema ``` import pyarrow.parquet pyarrow.parquet.read_schema(<path_to_parquet>, memory_map=True) ``` ### Logs _No response_ ### System info ```shell - huggingface_hub version: 0.14.1 - Platform: Linux-5.19.0-41-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /home/philippe/.cache/huggingface/token - Has saved token ?: True - Who am I ?: philippemo - Configured git credential helpers: cache - FastAI: N/A - Tensorflow: N/A - Torch: N/A - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.4.0 - hf_transfer: N/A - gradio: N/A - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /home/philippe/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /home/philippe/.cache/huggingface/assets - HF_TOKEN_PATH: /home/philippe/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
17
Image Encoding Issue when submitting a Parquet Dataset ### Describe the bug Hello, I'd like to report an issue related to pushing a dataset represented as a Parquet file to a dataset repository using Dask. Here are the details: We attempted to load an example dataset in Parquet format from the Hugging Face (HF) filesystem using Dask with the following code snippet: ``` import dask.dataframe as dd df = dd.read_parquet("hf://datasets/lambdalabs/pokemon-blip-captions",index=False) ``` In this dataset, the "image" column is represented as a dictionary/struct with the format: ``` df = df.compute() df["image"].iloc[0].keys() -> dict_keys(['bytes', 'path']) ``` I think this is the format encoded by the [`Image`](https://huggingface.co/docs/datasets/v2.0.0/en/package_reference/main_classes#datasets.Image) feature extractor from datasets to format suitable for Arrow. The next step was to push the dataset to a repository that I created: ``` dd.to_parquet(dask_df, path = "hf://datasets/philippemo/dummy_dataset/data") ``` However, after pushing the dataset using Dask, the "image" column is now represented as the encoded dictionary `(['bytes', 'path'])`, and the images are not properly visualized. You can find the dataset here: [Link to the problematic dataset](https://huggingface.co/datasets/philippemo/dummy_dataset). It's worth noting that both the original dataset and the one submitted with Dask have the same schema with minor alterations related to metadata: **[ Schema of original dummy example.](https://huggingface.co/datasets/lambdalabs/pokemon-blip-captions/blob/main/data/train-00000-of-00001-566cc9b19d7203f8.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` **[ Schema of pushed dataset with dask](https://huggingface.co/datasets/philippemo/dummy_dataset/blob/main/data/part.0.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` This issue seems to be related to an encoding type that occurs when pushing a model to the hub. Normally, models should be represented as an HF dataset before pushing, but we are working with an example where we need to push large datasets using Dask. Could you please provide clarification on how to resolve this issue? Thank you! ### Reproduction To get the schema I downloaded the parquet files and used pyarrow.parquet to read the schema ``` import pyarrow.parquet pyarrow.parquet.read_schema(<path_to_parquet>, memory_map=True) ``` ### Logs _No response_ ### System info ```shell - huggingface_hub version: 0.14.1 - Platform: Linux-5.19.0-41-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /home/philippe/.cache/huggingface/token - Has saved token ?: True - Who am I ?: philippemo - Configured git credential helpers: cache - FastAI: N/A - Tensorflow: N/A - Torch: N/A - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.4.0 - hf_transfer: N/A - gradio: N/A - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /home/philippe/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /home/philippe/.cache/huggingface/assets - HF_TOKEN_PATH: /home/philippe/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` Alright, it's fixed: https://huggingface.co/datasets/philippemo/dummy_dataset_without_schema It shows the image correctly now - even without the extra metadata :)
[ -0.07916499674320221, -0.19343626499176025, 0.05645659565925598, 0.4631294906139374, 0.24050284922122955, -0.03627727925777435, -0.07235730439424515, 0.15203076601028442, -0.020293869078159332, 0.08434884250164032, 0.2394731044769287, 0.25118616223335266, -0.05058019608259201, 0.1921534389257431, 0.11636337637901306, 0.013332569971680641, 0.23355509340763092, -0.13842418789863586, 0.035421762615442276, -0.1840411126613617, 0.024526141583919525, 0.023211026564240456, 0.09557671844959259, -0.12756088376045227, -0.31958872079849243, -0.12848052382469177, -0.1838715821504593, 0.16795723140239716, -0.29963672161102295, -0.24417482316493988, 0.1643291413784027, -0.0545198954641819, -0.03208453953266144, 0.39378952980041504, -0.0001218078687088564, 0.19774697721004486, 0.34032559394836426, -0.17158105969429016, -0.5198479294776917, -0.07692272961139679, -0.3051050305366516, -0.3085200786590576, 0.05941668152809143, -0.309287965297699, 0.0069709718227386475, -0.25256574153900146, 0.20677407085895538, -0.22702455520629883, 0.4726438522338867, 0.08928938210010529, 0.14610987901687622, 0.005707211792469025, 0.0009384825825691223, 0.26594099402427673, 0.03785824775695801, 0.47385528683662415, -0.04954889416694641, 0.04280170425772667, -0.18786868453025818, 0.24820902943611145, -0.09282605350017548, 0.15272480249404907, 0.08712490648031235, -0.00805438868701458, -0.016361994668841362, 0.20589324831962585, 0.20241717994213104, -0.1180095225572586, 0.10727289319038391, -0.05603448301553726, 0.3830835819244385, -0.36889907717704773, -0.4593268036842346, -0.30965960025787354, -0.03681962192058563, -0.4328514337539673, 0.32440492510795593, 0.2548222243785858, -0.0003364458680152893, 0.03457079827785492, -0.21113935112953186, -0.09784790873527527, -0.018189646303653717, -0.0407535657286644, -0.42851364612579346, -0.08900092542171478, -0.05984817445278168, 0.006623944267630577, -0.19672420620918274, -0.19502106308937073, -0.25219568610191345, -0.3026195466518402, -0.1774444878101349, -0.013072261586785316, 0.01207483746111393, 0.08645853400230408, -0.38594385981559753, -0.17382048070430756, 0.24907076358795166, -0.21245458722114563, -0.02549496293067932, 0.044269971549510956, 0.07893548905849457, 0.03922950476408005, 0.5062429904937744, -0.12927505373954773, -0.03976383060216904, 0.2804526388645172, -0.14378151297569275, 0.2625155448913574, 0.11786860227584839, -0.1301410049200058, -0.09396785497665405, 0.04139737784862518, 0.008238278329372406, -0.33153077960014343, 0.3395339846611023, -0.20103085041046143, -0.26428651809692383, 0.3871088922023773, 0.014363810420036316, 0.15616726875305176, -0.2204391360282898, 0.05782905966043472, -0.05315091088414192, -0.09420032799243927, -0.04410804063081741, 0.47267287969589233, -0.16827616095542908, -0.15016549825668335, -0.1741468757390976, -0.030894160270690918, -0.23196938633918762, -0.18701446056365967, -0.2916504144668579, -0.11245979368686676, 0.10146734118461609, 0.33954858779907227, 0.26186174154281616, -0.0037779733538627625, -0.3535880744457245, -0.17566774785518646, 0.3936227262020111, 0.11428333818912506, -0.181613028049469, 0.07735942304134369, 0.22098040580749512, -0.5117228031158447, -0.022964052855968475, -0.11341151595115662, -0.5474387407302856, 0.2746683657169342, -0.2667553126811981, 0.011132691986858845, -0.08528672158718109, 0.044519055634737015, -0.7847863435745239, 0.2940651476383209, -0.1569625288248062, -0.06727255880832672, -0.0302228145301342, -0.12930867075920105, -0.15981081128120422, -0.05944700911641121, 0.340188592672348, 0.33771514892578125, -0.19652074575424194, -0.0005269423127174377, 0.211419016122818, 0.10521763563156128, 0.43732064962387085, 0.21744775772094727, 0.0002976544201374054, -0.2075202912092209, -0.19594281911849976, 0.2834984064102173, 0.2477104514837265, -0.3083104193210602, -0.3637264370918274, 0.20732124149799347, 0.05494142323732376, 0.5474240183830261, -0.1219802275300026, -0.33859020471572876, 0.706177294254303, 0.026742804795503616, -0.1680281013250351, 0.3964022994041443, -0.05914565175771713, 0.22435082495212555, -0.34280863404273987, -0.13862639665603638, 0.233963280916214, -0.0564732700586319, -0.15170186758041382, -0.03644343838095665, 0.2565060257911682, 0.131291002035141, 0.08944565802812576, -0.013808006420731544, 0.1822938770055771, 0.13118819892406464, 0.07572855055332184, 0.22033259272575378, 0.07828377932310104, 0.08855684101581573, -0.21446797251701355, 0.2078758329153061, 0.07565057277679443, -0.020138951018452644, -0.6611341238021851, -0.05346376821398735, -0.16341593861579895, 0.15432989597320557, -0.3454017639160156, -0.26112934947013855, 0.10302689671516418, -0.18398931622505188, -0.187301367521286, 0.3532286286354065, -0.043276917189359665, 0.4639715552330017, -0.07420756667852402, 0.09023401141166687, -0.0024136528372764587, 0.4434558153152466, 0.16038428246974945, -0.27561497688293457, 0.05932071805000305, 0.11286928504705429, 0.08718172460794449, -0.20341093838214874, -0.03168509528040886, 0.30247241258621216, 0.47361379861831665, 0.2217513471841812, 0.19026757776737213, -0.14624746143817902, 0.34467995166778564, -0.16282746195793152, 0.09265882521867752, 0.05102993920445442, 0.10109417140483856, 0.12053026258945465, -0.3240894675254822, 0.19300389289855957, 0.2009456604719162, 0.11035066843032837, -0.19701902568340302, 0.11846049875020981, 0.24099549651145935, 0.13371887803077698, 0.017451830208301544, -0.22268861532211304, -0.20250633358955383, -0.14895997941493988, 0.01594855636358261, -0.15677784383296967, -0.3826122283935547, -0.09111963212490082, 0.25387585163116455, 0.19720742106437683, -0.07561331987380981, 0.16839781403541565, -0.014281917363405228, -0.09961596876382828, 0.1962994486093521, 0.3102966547012329, -0.16031783819198608, 0.11406266689300537, -0.05157270282506943, -0.04516921192407608, -0.05097324773669243, 0.21072445809841156, 0.0645216554403305, 0.03468870744109154, 0.38239526748657227, 0.09176066517829895, 0.22126369178295135, 0.10599218308925629, -0.289608895778656, 0.3012440502643585, 0.06205640733242035, 0.08901318162679672, -0.130911722779274, 0.24661411345005035, -0.6420296430587769, -0.1346006691455841, -0.250227689743042, 0.5710702538490295, -0.682451605796814, -0.2674350440502167, -0.07291704416275024, -0.13285697996616364, -0.03968258202075958, 0.11197592318058014, -0.16302737593650818, -0.006094217300415039, -0.05273965001106262, -0.19894228875637054, -0.168374165892601, -0.23569059371948242, -0.23182329535484314, -0.027816852554678917, 0.3248855769634247, 0.21233808994293213, 0.38557004928588867, -0.02140980213880539, 0.03407187759876251, -0.518075704574585, -0.19129739701747894, 0.3227287530899048, -0.21198764443397522, 0.19274577498435974, 0.017438102513551712, 0.18571817874908447, -0.3791752755641937, -0.07872322201728821, 0.3171776533126831, 0.29951804876327515, -0.31969359517097473, 0.19377385079860687, 0.07341989874839783, -0.24825848639011383, -0.06052228808403015, 0.3777472674846649, -0.032671406865119934, -0.03471996262669563, 0.07491407543420792, 0.15761052072048187, 0.12044703960418701, 0.05838102102279663, 0.17136725783348083, -0.09452171623706818, 0.03701040893793106, -0.03860544413328171, -0.2712515592575073, -0.3488621711730957, 0.16746753454208374, -0.06116615608334541, -0.3941246271133423, -0.009151890873908997, -0.013774648308753967, 0.09752555936574936, 0.6122156381607056, -0.4919033348560333, -0.14909076690673828, -0.019757017493247986, 0.028535082936286926, 0.20034730434417725, -0.2247292846441269, -0.027866549789905548, -0.13298243284225464, 0.06330052763223648, -0.20220136642456055, -0.2573300898075104, 0.23993903398513794, 0.44075146317481995, 0.32058218121528625, 0.22766725718975067, 0.47231075167655945, 0.07370960712432861, 0.33951127529144287, 0.24130193889141083, -0.05962551757693291, 0.47799065709114075, -0.30464479327201843, 0.40736517310142517, -0.057125747203826904, 0.02726447582244873, 0.07030518352985382, 0.05161358416080475, -0.07665444910526276, 0.10197190940380096, -0.10778730362653732, -0.007601086050271988, 0.1210765466094017, 0.07934093475341797, -0.4577903747558594, -0.20341160893440247, -0.020402031019330025, -0.306393027305603, 0.22629229724407196, -0.05433841049671173, -0.06515920162200928, -0.04452984780073166, 0.001288682222366333, 0.1311672478914261, 0.08704619109630585, 0.2863551080226898, 0.15852703154087067, 0.1519756317138672, 0.20825409889221191, -0.3474852442741394, 0.0844966396689415, 0.08030015230178833, 0.41018542647361755, -0.08110155165195465, 0.14033301174640656, 0.263540118932724, -0.12458974123001099, 0.9913992285728455, -0.07324831932783127, 0.0463947169482708, 0.006614558398723602, -0.22308924794197083, -0.3880262076854706, -0.14035595953464508, -0.07921162247657776, 0.17726217210292816, -0.2802383005619049, 0.4486265480518341, -0.5790385007858276, -0.15004587173461914, -0.00007326342165470123, -0.03217074275016785, -0.2849447727203369, 0.2814604640007019, -0.273240864276886, -0.06345083564519882, -0.1931152641773224, 0.024621507152915, 0.3160390853881836, 0.2254040390253067, 0.29118281602859497, 0.20496916770935059, -0.3069373667240143, 0.3140944540500641, -0.09414389729499817, 0.16854235529899597, 0.7633002400398254, -0.0018072165548801422, 0.11994614452123642, 0.34088411927223206, 0.5542935729026794, 0.4060317575931549, 0.681222677230835, 0.1060827299952507, -0.5684740543365479, -0.026644669473171234, -0.2976146340370178, 0.2752879858016968, 0.3391740322113037, 0.19574227929115295, -0.1426192820072174, -0.2332392781972885, -0.12143495678901672, -0.5962797403335571, 0.0048218779265880585, 0.6384521126747131, -0.06977512687444687, -0.3294113576412201, -0.10974253714084625, 0.26602399349212646, 0.01982904225587845, 0.1059081107378006, -0.1032584011554718, 0.6814203858375549, -0.3524845540523529, 0.29314732551574707, 0.43852463364601135, 0.6986760497093201, -0.31745898723602295, 0.08485960960388184, 0.2611289918422699, -0.41698163747787476, 0.05339523032307625, -0.008640453219413757, -0.16793294250965118, -0.1286677122116089, 0.026765964925289154, -0.002383500337600708, 0.010570414364337921, 0.10287268459796906, 0.05427601933479309, -0.03950437903404236, -0.025233056396245956, -0.13475537300109863, -0.10187064111232758, -0.16843479871749878, 0.26752281188964844, 0.02645270712673664, -0.0855833888053894, -0.30577975511550903, 0.12090219557285309, -0.17668913304805756, -0.24624857306480408, 0.1322004199028015, -0.3132990896701813, -0.3896317481994629, 0.033578477799892426, -0.21205377578735352, 0.17872308194637299, 0.09609001874923706, 0.10728970170021057, 0.10292860865592957, -0.41311413049697876, 0.12592896819114685, 0.3106502294540405, 0.18212267756462097, -0.18301285803318024, -0.09230932593345642, 0.29682376980781555, -0.1273464411497116, 0.10368946194648743, 0.029159806668758392, 0.04628952592611313, 0.3173646926879883, -0.010158903896808624, 0.1919703185558319, -0.3208054304122925, -0.03930879384279251, 0.05043976008892059, -0.09223057329654694, -0.0019683297723531723, 0.29481789469718933, -0.0745924711227417, -0.08492542058229446, -0.20530332624912262, 0.15854820609092712, 0.05422896146774292, -0.0011428743600845337, -0.05587608739733696, 0.13133308291435242, -0.1556420922279358, 0.2875654995441437, -0.12445589900016785, 0.03552263230085373, 0.31148016452789307, -0.20124299824237823, -0.06983207166194916, 0.47928592562675476, -0.2162202000617981, -0.35114753246307373, 0.06262609362602234, -0.15597200393676758, 0.124468132853508, -0.35657575726509094, 0.22543083131313324, -0.3644396960735321, 0.10456603765487671, -0.3070925176143646, -0.08409903198480606, -0.007379754912108183, -0.4085598587989807, -0.09839437156915665, -0.04116646945476532, -0.038579411804676056, 0.3225950300693512, -0.30236488580703735, 0.1972884088754654, 0.06166757643222809, -0.07260958105325699, -0.1025754064321518, -0.16005875170230865, -0.1915740668773651, 0.24606581032276154, 0.07074514776468277, 0.3006419241428375, 0.3208974003791809, 0.03700247034430504, 0.11884783953428268, -0.39820000529289246, 0.08051833510398865, 0.09587366878986359, 0.06930314749479294, -0.021773288026452065, -0.3344597816467285, 0.1346713900566101, -0.028862766921520233, -0.03297141194343567, -0.009161468595266342, -0.08928275108337402, -0.11016947031021118, -0.3043563663959503, 0.06306718289852142, 0.209659144282341, -0.1419305056333542, -0.12058883905410767, 0.9170119762420654, 0.2859131097793579, 0.029125086963176727, -0.08836822211742401, 0.138609379529953, 0.33755743503570557, -0.06887565553188324, -0.02053120546042919, -0.21704143285751343, -0.000537477433681488, 0.06906968355178833, 0.2671671211719513, 0.01341732032597065, 0.05737423524260521, 0.4994564354419708, -0.3344879448413849, 0.21903619170188904, 0.27255484461784363, 0.400823712348938, 0.24880696833133698, -0.2676967978477478, -0.5458172559738159, 0.45789268612861633, 0.08216634392738342, -0.04859311506152153, 0.024749580770730972, 0.44291025400161743, -0.1257719099521637, -0.3181057572364807, 0.033412158489227295, 0.2590599060058594, 0.20852315425872803, -0.5375937819480896, -0.0032423213124275208, 0.42927515506744385, -0.2545764446258545, 0.10580794513225555, 0.08040713518857956, 0.05851776897907257, 0.23365382850170135, 0.026060422882437706, 0.17333675920963287, 0.06848163902759552, 0.3626081645488739, -0.08599037677049637, 0.1869955062866211, 0.3254638612270355, -0.09261880815029144, 0.08684144914150238, -0.11117130517959595, 0.1897805780172348, 0.08123205602169037, 0.04683030769228935, 0.5865591168403625, 0.3055868446826935, 0.10792411863803864, 0.32768091559410095, -0.495758056640625, -0.19348132610321045, 0.05727165937423706, -0.09897714853286743, 0.13845551013946533, 0.12484008073806763, -0.05365820229053497, -0.3922593593597412, 0.25666868686676025, -0.33554723858833313, -0.19774621725082397, -0.13969971239566803, 0.22027626633644104, -0.0032346993684768677, -0.060584839433431625, -0.39027321338653564, -0.15120570361614227, 0.47595852613449097, -0.2736614942550659, 0.2344486266374588, 0.05876272916793823, -0.2052232325077057, 0.23883210122585297, 0.33249086141586304, 0.4195669889450073, 0.07144515216350555, 0.08306039869785309, -0.1600944995880127, 0.281386137008667, 0.02718251198530197, 0.08298996090888977, 0.052955709397792816, -0.09173879772424698, -0.03044990822672844, 0.14321619272232056, 0.05522787570953369, 0.012671142816543579, -0.5502858757972717, 0.3455536663532257, 0.10991154611110687, 0.046859823167324066, -0.19337791204452515, -0.13313499093055725, 0.041244372725486755, -0.19122137129306793, -0.18751804530620575, -0.2555430233478546, -0.33245784044265747, -0.004474034532904625, 0.06573499739170074, 0.09889018535614014, 0.19960926473140717, 0.01873113214969635, -0.038432635366916656, 0.37142181396484375, 0.4363003373146057, -0.30787989497184753, -0.0035356003791093826, -0.12242960184812546, -0.5355163812637329, 0.29517385363578796, -0.269599586725235, -0.4630351662635803, 0.4378815293312073, 0.20798969268798828, 0.13077384233474731, 0.05380599573254585, 0.01805943250656128, 0.1585981696844101, -0.29508212208747864, 0.14028210937976837, -0.26408645510673523, -0.16466931998729706, 0.24281570315361023, -0.19256681203842163, -0.07076211273670197, 0.003395870327949524, 0.35976552963256836, -0.020562320947647095, -0.016280006617307663, 0.09018146991729736, 0.1677822768688202, -0.5286961793899536, -0.4443299174308777, -0.03129997104406357, 0.1747814267873764, 0.19653204083442688, -0.22732099890708923, -0.2542477250099182, -0.22993382811546326, -0.0498366542160511, -0.19927209615707397, 0.5373099446296692, -0.26691287755966187, 0.5406489372253418, 0.06785796582698822, -0.27915582060813904, -0.12024100124835968, 0.2953866720199585, 0.0641380324959755, -0.16347941756248474, -0.1523139327764511, 0.10899059474468231, 0.057386696338653564, -0.07962803542613983, -0.0009504631161689758, 0.26892566680908203, 0.1437426656484604, 0.16440999507904053, 0.061094820499420166, -0.24893951416015625, 0.2889636754989624, -0.3820137083530426, -0.21670272946357727, 0.1949497014284134, -0.07249452918767929, 0.1960967481136322, 0.06945039331912994, -0.42897215485572815, 0.030249804258346558, 0.12145823240280151, -0.22034421563148499, -0.026455849409103394, 0.2109253853559494, 0.1932188868522644, -0.07092390209436417, -0.004424840211868286, 0.07811242341995239, -0.169754296541214, -0.15706488490104675, 0.1803692877292633, -0.11369789391756058 ]
https://github.com/huggingface/datasets/issues/5869
Thanks @lhoestq! I tested pushing a dataset again without the metadata and it works perfectly! I appreciate the help
Image Encoding Issue when submitting a Parquet Dataset
### Describe the bug Hello, I'd like to report an issue related to pushing a dataset represented as a Parquet file to a dataset repository using Dask. Here are the details: We attempted to load an example dataset in Parquet format from the Hugging Face (HF) filesystem using Dask with the following code snippet: ``` import dask.dataframe as dd df = dd.read_parquet("hf://datasets/lambdalabs/pokemon-blip-captions",index=False) ``` In this dataset, the "image" column is represented as a dictionary/struct with the format: ``` df = df.compute() df["image"].iloc[0].keys() -> dict_keys(['bytes', 'path']) ``` I think this is the format encoded by the [`Image`](https://huggingface.co/docs/datasets/v2.0.0/en/package_reference/main_classes#datasets.Image) feature extractor from datasets to format suitable for Arrow. The next step was to push the dataset to a repository that I created: ``` dd.to_parquet(dask_df, path = "hf://datasets/philippemo/dummy_dataset/data") ``` However, after pushing the dataset using Dask, the "image" column is now represented as the encoded dictionary `(['bytes', 'path'])`, and the images are not properly visualized. You can find the dataset here: [Link to the problematic dataset](https://huggingface.co/datasets/philippemo/dummy_dataset). It's worth noting that both the original dataset and the one submitted with Dask have the same schema with minor alterations related to metadata: **[ Schema of original dummy example.](https://huggingface.co/datasets/lambdalabs/pokemon-blip-captions/blob/main/data/train-00000-of-00001-566cc9b19d7203f8.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` **[ Schema of pushed dataset with dask](https://huggingface.co/datasets/philippemo/dummy_dataset/blob/main/data/part.0.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` This issue seems to be related to an encoding type that occurs when pushing a model to the hub. Normally, models should be represented as an HF dataset before pushing, but we are working with an example where we need to push large datasets using Dask. Could you please provide clarification on how to resolve this issue? Thank you! ### Reproduction To get the schema I downloaded the parquet files and used pyarrow.parquet to read the schema ``` import pyarrow.parquet pyarrow.parquet.read_schema(<path_to_parquet>, memory_map=True) ``` ### Logs _No response_ ### System info ```shell - huggingface_hub version: 0.14.1 - Platform: Linux-5.19.0-41-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /home/philippe/.cache/huggingface/token - Has saved token ?: True - Who am I ?: philippemo - Configured git credential helpers: cache - FastAI: N/A - Tensorflow: N/A - Torch: N/A - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.4.0 - hf_transfer: N/A - gradio: N/A - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /home/philippe/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /home/philippe/.cache/huggingface/assets - HF_TOKEN_PATH: /home/philippe/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
19
Image Encoding Issue when submitting a Parquet Dataset ### Describe the bug Hello, I'd like to report an issue related to pushing a dataset represented as a Parquet file to a dataset repository using Dask. Here are the details: We attempted to load an example dataset in Parquet format from the Hugging Face (HF) filesystem using Dask with the following code snippet: ``` import dask.dataframe as dd df = dd.read_parquet("hf://datasets/lambdalabs/pokemon-blip-captions",index=False) ``` In this dataset, the "image" column is represented as a dictionary/struct with the format: ``` df = df.compute() df["image"].iloc[0].keys() -> dict_keys(['bytes', 'path']) ``` I think this is the format encoded by the [`Image`](https://huggingface.co/docs/datasets/v2.0.0/en/package_reference/main_classes#datasets.Image) feature extractor from datasets to format suitable for Arrow. The next step was to push the dataset to a repository that I created: ``` dd.to_parquet(dask_df, path = "hf://datasets/philippemo/dummy_dataset/data") ``` However, after pushing the dataset using Dask, the "image" column is now represented as the encoded dictionary `(['bytes', 'path'])`, and the images are not properly visualized. You can find the dataset here: [Link to the problematic dataset](https://huggingface.co/datasets/philippemo/dummy_dataset). It's worth noting that both the original dataset and the one submitted with Dask have the same schema with minor alterations related to metadata: **[ Schema of original dummy example.](https://huggingface.co/datasets/lambdalabs/pokemon-blip-captions/blob/main/data/train-00000-of-00001-566cc9b19d7203f8.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` **[ Schema of pushed dataset with dask](https://huggingface.co/datasets/philippemo/dummy_dataset/blob/main/data/part.0.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` This issue seems to be related to an encoding type that occurs when pushing a model to the hub. Normally, models should be represented as an HF dataset before pushing, but we are working with an example where we need to push large datasets using Dask. Could you please provide clarification on how to resolve this issue? Thank you! ### Reproduction To get the schema I downloaded the parquet files and used pyarrow.parquet to read the schema ``` import pyarrow.parquet pyarrow.parquet.read_schema(<path_to_parquet>, memory_map=True) ``` ### Logs _No response_ ### System info ```shell - huggingface_hub version: 0.14.1 - Platform: Linux-5.19.0-41-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /home/philippe/.cache/huggingface/token - Has saved token ?: True - Who am I ?: philippemo - Configured git credential helpers: cache - FastAI: N/A - Tensorflow: N/A - Torch: N/A - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.4.0 - hf_transfer: N/A - gradio: N/A - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /home/philippe/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /home/philippe/.cache/huggingface/assets - HF_TOKEN_PATH: /home/philippe/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` Thanks @lhoestq! I tested pushing a dataset again without the metadata and it works perfectly! I appreciate the help
[ -0.07916499674320221, -0.19343626499176025, 0.05645659565925598, 0.4631294906139374, 0.24050284922122955, -0.03627727925777435, -0.07235730439424515, 0.15203076601028442, -0.020293869078159332, 0.08434884250164032, 0.2394731044769287, 0.25118616223335266, -0.05058019608259201, 0.1921534389257431, 0.11636337637901306, 0.013332569971680641, 0.23355509340763092, -0.13842418789863586, 0.035421762615442276, -0.1840411126613617, 0.024526141583919525, 0.023211026564240456, 0.09557671844959259, -0.12756088376045227, -0.31958872079849243, -0.12848052382469177, -0.1838715821504593, 0.16795723140239716, -0.29963672161102295, -0.24417482316493988, 0.1643291413784027, -0.0545198954641819, -0.03208453953266144, 0.39378952980041504, -0.0001218078687088564, 0.19774697721004486, 0.34032559394836426, -0.17158105969429016, -0.5198479294776917, -0.07692272961139679, -0.3051050305366516, -0.3085200786590576, 0.05941668152809143, -0.309287965297699, 0.0069709718227386475, -0.25256574153900146, 0.20677407085895538, -0.22702455520629883, 0.4726438522338867, 0.08928938210010529, 0.14610987901687622, 0.005707211792469025, 0.0009384825825691223, 0.26594099402427673, 0.03785824775695801, 0.47385528683662415, -0.04954889416694641, 0.04280170425772667, -0.18786868453025818, 0.24820902943611145, -0.09282605350017548, 0.15272480249404907, 0.08712490648031235, -0.00805438868701458, -0.016361994668841362, 0.20589324831962585, 0.20241717994213104, -0.1180095225572586, 0.10727289319038391, -0.05603448301553726, 0.3830835819244385, -0.36889907717704773, -0.4593268036842346, -0.30965960025787354, -0.03681962192058563, -0.4328514337539673, 0.32440492510795593, 0.2548222243785858, -0.0003364458680152893, 0.03457079827785492, -0.21113935112953186, -0.09784790873527527, -0.018189646303653717, -0.0407535657286644, -0.42851364612579346, -0.08900092542171478, -0.05984817445278168, 0.006623944267630577, -0.19672420620918274, -0.19502106308937073, -0.25219568610191345, -0.3026195466518402, -0.1774444878101349, -0.013072261586785316, 0.01207483746111393, 0.08645853400230408, -0.38594385981559753, -0.17382048070430756, 0.24907076358795166, -0.21245458722114563, -0.02549496293067932, 0.044269971549510956, 0.07893548905849457, 0.03922950476408005, 0.5062429904937744, -0.12927505373954773, -0.03976383060216904, 0.2804526388645172, -0.14378151297569275, 0.2625155448913574, 0.11786860227584839, -0.1301410049200058, -0.09396785497665405, 0.04139737784862518, 0.008238278329372406, -0.33153077960014343, 0.3395339846611023, -0.20103085041046143, -0.26428651809692383, 0.3871088922023773, 0.014363810420036316, 0.15616726875305176, -0.2204391360282898, 0.05782905966043472, -0.05315091088414192, -0.09420032799243927, -0.04410804063081741, 0.47267287969589233, -0.16827616095542908, -0.15016549825668335, -0.1741468757390976, -0.030894160270690918, -0.23196938633918762, -0.18701446056365967, -0.2916504144668579, -0.11245979368686676, 0.10146734118461609, 0.33954858779907227, 0.26186174154281616, -0.0037779733538627625, -0.3535880744457245, -0.17566774785518646, 0.3936227262020111, 0.11428333818912506, -0.181613028049469, 0.07735942304134369, 0.22098040580749512, -0.5117228031158447, -0.022964052855968475, -0.11341151595115662, -0.5474387407302856, 0.2746683657169342, -0.2667553126811981, 0.011132691986858845, -0.08528672158718109, 0.044519055634737015, -0.7847863435745239, 0.2940651476383209, -0.1569625288248062, -0.06727255880832672, -0.0302228145301342, -0.12930867075920105, -0.15981081128120422, -0.05944700911641121, 0.340188592672348, 0.33771514892578125, -0.19652074575424194, -0.0005269423127174377, 0.211419016122818, 0.10521763563156128, 0.43732064962387085, 0.21744775772094727, 0.0002976544201374054, -0.2075202912092209, -0.19594281911849976, 0.2834984064102173, 0.2477104514837265, -0.3083104193210602, -0.3637264370918274, 0.20732124149799347, 0.05494142323732376, 0.5474240183830261, -0.1219802275300026, -0.33859020471572876, 0.706177294254303, 0.026742804795503616, -0.1680281013250351, 0.3964022994041443, -0.05914565175771713, 0.22435082495212555, -0.34280863404273987, -0.13862639665603638, 0.233963280916214, -0.0564732700586319, -0.15170186758041382, -0.03644343838095665, 0.2565060257911682, 0.131291002035141, 0.08944565802812576, -0.013808006420731544, 0.1822938770055771, 0.13118819892406464, 0.07572855055332184, 0.22033259272575378, 0.07828377932310104, 0.08855684101581573, -0.21446797251701355, 0.2078758329153061, 0.07565057277679443, -0.020138951018452644, -0.6611341238021851, -0.05346376821398735, -0.16341593861579895, 0.15432989597320557, -0.3454017639160156, -0.26112934947013855, 0.10302689671516418, -0.18398931622505188, -0.187301367521286, 0.3532286286354065, -0.043276917189359665, 0.4639715552330017, -0.07420756667852402, 0.09023401141166687, -0.0024136528372764587, 0.4434558153152466, 0.16038428246974945, -0.27561497688293457, 0.05932071805000305, 0.11286928504705429, 0.08718172460794449, -0.20341093838214874, -0.03168509528040886, 0.30247241258621216, 0.47361379861831665, 0.2217513471841812, 0.19026757776737213, -0.14624746143817902, 0.34467995166778564, -0.16282746195793152, 0.09265882521867752, 0.05102993920445442, 0.10109417140483856, 0.12053026258945465, -0.3240894675254822, 0.19300389289855957, 0.2009456604719162, 0.11035066843032837, -0.19701902568340302, 0.11846049875020981, 0.24099549651145935, 0.13371887803077698, 0.017451830208301544, -0.22268861532211304, -0.20250633358955383, -0.14895997941493988, 0.01594855636358261, -0.15677784383296967, -0.3826122283935547, -0.09111963212490082, 0.25387585163116455, 0.19720742106437683, -0.07561331987380981, 0.16839781403541565, -0.014281917363405228, -0.09961596876382828, 0.1962994486093521, 0.3102966547012329, -0.16031783819198608, 0.11406266689300537, -0.05157270282506943, -0.04516921192407608, -0.05097324773669243, 0.21072445809841156, 0.0645216554403305, 0.03468870744109154, 0.38239526748657227, 0.09176066517829895, 0.22126369178295135, 0.10599218308925629, -0.289608895778656, 0.3012440502643585, 0.06205640733242035, 0.08901318162679672, -0.130911722779274, 0.24661411345005035, -0.6420296430587769, -0.1346006691455841, -0.250227689743042, 0.5710702538490295, -0.682451605796814, -0.2674350440502167, -0.07291704416275024, -0.13285697996616364, -0.03968258202075958, 0.11197592318058014, -0.16302737593650818, -0.006094217300415039, -0.05273965001106262, -0.19894228875637054, -0.168374165892601, -0.23569059371948242, -0.23182329535484314, -0.027816852554678917, 0.3248855769634247, 0.21233808994293213, 0.38557004928588867, -0.02140980213880539, 0.03407187759876251, -0.518075704574585, -0.19129739701747894, 0.3227287530899048, -0.21198764443397522, 0.19274577498435974, 0.017438102513551712, 0.18571817874908447, -0.3791752755641937, -0.07872322201728821, 0.3171776533126831, 0.29951804876327515, -0.31969359517097473, 0.19377385079860687, 0.07341989874839783, -0.24825848639011383, -0.06052228808403015, 0.3777472674846649, -0.032671406865119934, -0.03471996262669563, 0.07491407543420792, 0.15761052072048187, 0.12044703960418701, 0.05838102102279663, 0.17136725783348083, -0.09452171623706818, 0.03701040893793106, -0.03860544413328171, -0.2712515592575073, -0.3488621711730957, 0.16746753454208374, -0.06116615608334541, -0.3941246271133423, -0.009151890873908997, -0.013774648308753967, 0.09752555936574936, 0.6122156381607056, -0.4919033348560333, -0.14909076690673828, -0.019757017493247986, 0.028535082936286926, 0.20034730434417725, -0.2247292846441269, -0.027866549789905548, -0.13298243284225464, 0.06330052763223648, -0.20220136642456055, -0.2573300898075104, 0.23993903398513794, 0.44075146317481995, 0.32058218121528625, 0.22766725718975067, 0.47231075167655945, 0.07370960712432861, 0.33951127529144287, 0.24130193889141083, -0.05962551757693291, 0.47799065709114075, -0.30464479327201843, 0.40736517310142517, -0.057125747203826904, 0.02726447582244873, 0.07030518352985382, 0.05161358416080475, -0.07665444910526276, 0.10197190940380096, -0.10778730362653732, -0.007601086050271988, 0.1210765466094017, 0.07934093475341797, -0.4577903747558594, -0.20341160893440247, -0.020402031019330025, -0.306393027305603, 0.22629229724407196, -0.05433841049671173, -0.06515920162200928, -0.04452984780073166, 0.001288682222366333, 0.1311672478914261, 0.08704619109630585, 0.2863551080226898, 0.15852703154087067, 0.1519756317138672, 0.20825409889221191, -0.3474852442741394, 0.0844966396689415, 0.08030015230178833, 0.41018542647361755, -0.08110155165195465, 0.14033301174640656, 0.263540118932724, -0.12458974123001099, 0.9913992285728455, -0.07324831932783127, 0.0463947169482708, 0.006614558398723602, -0.22308924794197083, -0.3880262076854706, -0.14035595953464508, -0.07921162247657776, 0.17726217210292816, -0.2802383005619049, 0.4486265480518341, -0.5790385007858276, -0.15004587173461914, -0.00007326342165470123, -0.03217074275016785, -0.2849447727203369, 0.2814604640007019, -0.273240864276886, -0.06345083564519882, -0.1931152641773224, 0.024621507152915, 0.3160390853881836, 0.2254040390253067, 0.29118281602859497, 0.20496916770935059, -0.3069373667240143, 0.3140944540500641, -0.09414389729499817, 0.16854235529899597, 0.7633002400398254, -0.0018072165548801422, 0.11994614452123642, 0.34088411927223206, 0.5542935729026794, 0.4060317575931549, 0.681222677230835, 0.1060827299952507, -0.5684740543365479, -0.026644669473171234, -0.2976146340370178, 0.2752879858016968, 0.3391740322113037, 0.19574227929115295, -0.1426192820072174, -0.2332392781972885, -0.12143495678901672, -0.5962797403335571, 0.0048218779265880585, 0.6384521126747131, -0.06977512687444687, -0.3294113576412201, -0.10974253714084625, 0.26602399349212646, 0.01982904225587845, 0.1059081107378006, -0.1032584011554718, 0.6814203858375549, -0.3524845540523529, 0.29314732551574707, 0.43852463364601135, 0.6986760497093201, -0.31745898723602295, 0.08485960960388184, 0.2611289918422699, -0.41698163747787476, 0.05339523032307625, -0.008640453219413757, -0.16793294250965118, -0.1286677122116089, 0.026765964925289154, -0.002383500337600708, 0.010570414364337921, 0.10287268459796906, 0.05427601933479309, -0.03950437903404236, -0.025233056396245956, -0.13475537300109863, -0.10187064111232758, -0.16843479871749878, 0.26752281188964844, 0.02645270712673664, -0.0855833888053894, -0.30577975511550903, 0.12090219557285309, -0.17668913304805756, -0.24624857306480408, 0.1322004199028015, -0.3132990896701813, -0.3896317481994629, 0.033578477799892426, -0.21205377578735352, 0.17872308194637299, 0.09609001874923706, 0.10728970170021057, 0.10292860865592957, -0.41311413049697876, 0.12592896819114685, 0.3106502294540405, 0.18212267756462097, -0.18301285803318024, -0.09230932593345642, 0.29682376980781555, -0.1273464411497116, 0.10368946194648743, 0.029159806668758392, 0.04628952592611313, 0.3173646926879883, -0.010158903896808624, 0.1919703185558319, -0.3208054304122925, -0.03930879384279251, 0.05043976008892059, -0.09223057329654694, -0.0019683297723531723, 0.29481789469718933, -0.0745924711227417, -0.08492542058229446, -0.20530332624912262, 0.15854820609092712, 0.05422896146774292, -0.0011428743600845337, -0.05587608739733696, 0.13133308291435242, -0.1556420922279358, 0.2875654995441437, -0.12445589900016785, 0.03552263230085373, 0.31148016452789307, -0.20124299824237823, -0.06983207166194916, 0.47928592562675476, -0.2162202000617981, -0.35114753246307373, 0.06262609362602234, -0.15597200393676758, 0.124468132853508, -0.35657575726509094, 0.22543083131313324, -0.3644396960735321, 0.10456603765487671, -0.3070925176143646, -0.08409903198480606, -0.007379754912108183, -0.4085598587989807, -0.09839437156915665, -0.04116646945476532, -0.038579411804676056, 0.3225950300693512, -0.30236488580703735, 0.1972884088754654, 0.06166757643222809, -0.07260958105325699, -0.1025754064321518, -0.16005875170230865, -0.1915740668773651, 0.24606581032276154, 0.07074514776468277, 0.3006419241428375, 0.3208974003791809, 0.03700247034430504, 0.11884783953428268, -0.39820000529289246, 0.08051833510398865, 0.09587366878986359, 0.06930314749479294, -0.021773288026452065, -0.3344597816467285, 0.1346713900566101, -0.028862766921520233, -0.03297141194343567, -0.009161468595266342, -0.08928275108337402, -0.11016947031021118, -0.3043563663959503, 0.06306718289852142, 0.209659144282341, -0.1419305056333542, -0.12058883905410767, 0.9170119762420654, 0.2859131097793579, 0.029125086963176727, -0.08836822211742401, 0.138609379529953, 0.33755743503570557, -0.06887565553188324, -0.02053120546042919, -0.21704143285751343, -0.000537477433681488, 0.06906968355178833, 0.2671671211719513, 0.01341732032597065, 0.05737423524260521, 0.4994564354419708, -0.3344879448413849, 0.21903619170188904, 0.27255484461784363, 0.400823712348938, 0.24880696833133698, -0.2676967978477478, -0.5458172559738159, 0.45789268612861633, 0.08216634392738342, -0.04859311506152153, 0.024749580770730972, 0.44291025400161743, -0.1257719099521637, -0.3181057572364807, 0.033412158489227295, 0.2590599060058594, 0.20852315425872803, -0.5375937819480896, -0.0032423213124275208, 0.42927515506744385, -0.2545764446258545, 0.10580794513225555, 0.08040713518857956, 0.05851776897907257, 0.23365382850170135, 0.026060422882437706, 0.17333675920963287, 0.06848163902759552, 0.3626081645488739, -0.08599037677049637, 0.1869955062866211, 0.3254638612270355, -0.09261880815029144, 0.08684144914150238, -0.11117130517959595, 0.1897805780172348, 0.08123205602169037, 0.04683030769228935, 0.5865591168403625, 0.3055868446826935, 0.10792411863803864, 0.32768091559410095, -0.495758056640625, -0.19348132610321045, 0.05727165937423706, -0.09897714853286743, 0.13845551013946533, 0.12484008073806763, -0.05365820229053497, -0.3922593593597412, 0.25666868686676025, -0.33554723858833313, -0.19774621725082397, -0.13969971239566803, 0.22027626633644104, -0.0032346993684768677, -0.060584839433431625, -0.39027321338653564, -0.15120570361614227, 0.47595852613449097, -0.2736614942550659, 0.2344486266374588, 0.05876272916793823, -0.2052232325077057, 0.23883210122585297, 0.33249086141586304, 0.4195669889450073, 0.07144515216350555, 0.08306039869785309, -0.1600944995880127, 0.281386137008667, 0.02718251198530197, 0.08298996090888977, 0.052955709397792816, -0.09173879772424698, -0.03044990822672844, 0.14321619272232056, 0.05522787570953369, 0.012671142816543579, -0.5502858757972717, 0.3455536663532257, 0.10991154611110687, 0.046859823167324066, -0.19337791204452515, -0.13313499093055725, 0.041244372725486755, -0.19122137129306793, -0.18751804530620575, -0.2555430233478546, -0.33245784044265747, -0.004474034532904625, 0.06573499739170074, 0.09889018535614014, 0.19960926473140717, 0.01873113214969635, -0.038432635366916656, 0.37142181396484375, 0.4363003373146057, -0.30787989497184753, -0.0035356003791093826, -0.12242960184812546, -0.5355163812637329, 0.29517385363578796, -0.269599586725235, -0.4630351662635803, 0.4378815293312073, 0.20798969268798828, 0.13077384233474731, 0.05380599573254585, 0.01805943250656128, 0.1585981696844101, -0.29508212208747864, 0.14028210937976837, -0.26408645510673523, -0.16466931998729706, 0.24281570315361023, -0.19256681203842163, -0.07076211273670197, 0.003395870327949524, 0.35976552963256836, -0.020562320947647095, -0.016280006617307663, 0.09018146991729736, 0.1677822768688202, -0.5286961793899536, -0.4443299174308777, -0.03129997104406357, 0.1747814267873764, 0.19653204083442688, -0.22732099890708923, -0.2542477250099182, -0.22993382811546326, -0.0498366542160511, -0.19927209615707397, 0.5373099446296692, -0.26691287755966187, 0.5406489372253418, 0.06785796582698822, -0.27915582060813904, -0.12024100124835968, 0.2953866720199585, 0.0641380324959755, -0.16347941756248474, -0.1523139327764511, 0.10899059474468231, 0.057386696338653564, -0.07962803542613983, -0.0009504631161689758, 0.26892566680908203, 0.1437426656484604, 0.16440999507904053, 0.061094820499420166, -0.24893951416015625, 0.2889636754989624, -0.3820137083530426, -0.21670272946357727, 0.1949497014284134, -0.07249452918767929, 0.1960967481136322, 0.06945039331912994, -0.42897215485572815, 0.030249804258346558, 0.12145823240280151, -0.22034421563148499, -0.026455849409103394, 0.2109253853559494, 0.1932188868522644, -0.07092390209436417, -0.004424840211868286, 0.07811242341995239, -0.169754296541214, -0.15706488490104675, 0.1803692877292633, -0.11369789391756058 ]
https://github.com/huggingface/datasets/issues/5869
Hi @lhoestq, I'v tried pushing another dataset again and I think the issue reappeared again: ``` df = dd.read_parquet(f"hf://datasets/lambdalabs/pokemon-blip-captions") features = datasets.Features({"image": datasets.Image(), "text": datasets.Value("string")}) schema = features.arrow_schema dd.to_parquet(df, path = "hf://datasets/philippemo/dummy_dataset_without_schema_12_06/data", schema=schema) ``` Here is the dataset: https://huggingface.co/datasets/philippemo/dummy_dataset_without_schema_12_06 The one that was working 2 weeks ago still seems to be intact though, it might be that It rendered properly when it was initially submitted and after this something was reverted from your side: https://huggingface.co/datasets/philippemo/dummy_dataset_without_schema It's weird because nothing really changed from the implementation, might be another issue in the hub backend. Do you have any pointers on how to resolve this?
Image Encoding Issue when submitting a Parquet Dataset
### Describe the bug Hello, I'd like to report an issue related to pushing a dataset represented as a Parquet file to a dataset repository using Dask. Here are the details: We attempted to load an example dataset in Parquet format from the Hugging Face (HF) filesystem using Dask with the following code snippet: ``` import dask.dataframe as dd df = dd.read_parquet("hf://datasets/lambdalabs/pokemon-blip-captions",index=False) ``` In this dataset, the "image" column is represented as a dictionary/struct with the format: ``` df = df.compute() df["image"].iloc[0].keys() -> dict_keys(['bytes', 'path']) ``` I think this is the format encoded by the [`Image`](https://huggingface.co/docs/datasets/v2.0.0/en/package_reference/main_classes#datasets.Image) feature extractor from datasets to format suitable for Arrow. The next step was to push the dataset to a repository that I created: ``` dd.to_parquet(dask_df, path = "hf://datasets/philippemo/dummy_dataset/data") ``` However, after pushing the dataset using Dask, the "image" column is now represented as the encoded dictionary `(['bytes', 'path'])`, and the images are not properly visualized. You can find the dataset here: [Link to the problematic dataset](https://huggingface.co/datasets/philippemo/dummy_dataset). It's worth noting that both the original dataset and the one submitted with Dask have the same schema with minor alterations related to metadata: **[ Schema of original dummy example.](https://huggingface.co/datasets/lambdalabs/pokemon-blip-captions/blob/main/data/train-00000-of-00001-566cc9b19d7203f8.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` **[ Schema of pushed dataset with dask](https://huggingface.co/datasets/philippemo/dummy_dataset/blob/main/data/part.0.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` This issue seems to be related to an encoding type that occurs when pushing a model to the hub. Normally, models should be represented as an HF dataset before pushing, but we are working with an example where we need to push large datasets using Dask. Could you please provide clarification on how to resolve this issue? Thank you! ### Reproduction To get the schema I downloaded the parquet files and used pyarrow.parquet to read the schema ``` import pyarrow.parquet pyarrow.parquet.read_schema(<path_to_parquet>, memory_map=True) ``` ### Logs _No response_ ### System info ```shell - huggingface_hub version: 0.14.1 - Platform: Linux-5.19.0-41-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /home/philippe/.cache/huggingface/token - Has saved token ?: True - Who am I ?: philippemo - Configured git credential helpers: cache - FastAI: N/A - Tensorflow: N/A - Torch: N/A - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.4.0 - hf_transfer: N/A - gradio: N/A - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /home/philippe/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /home/philippe/.cache/huggingface/assets - HF_TOKEN_PATH: /home/philippe/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
102
Image Encoding Issue when submitting a Parquet Dataset ### Describe the bug Hello, I'd like to report an issue related to pushing a dataset represented as a Parquet file to a dataset repository using Dask. Here are the details: We attempted to load an example dataset in Parquet format from the Hugging Face (HF) filesystem using Dask with the following code snippet: ``` import dask.dataframe as dd df = dd.read_parquet("hf://datasets/lambdalabs/pokemon-blip-captions",index=False) ``` In this dataset, the "image" column is represented as a dictionary/struct with the format: ``` df = df.compute() df["image"].iloc[0].keys() -> dict_keys(['bytes', 'path']) ``` I think this is the format encoded by the [`Image`](https://huggingface.co/docs/datasets/v2.0.0/en/package_reference/main_classes#datasets.Image) feature extractor from datasets to format suitable for Arrow. The next step was to push the dataset to a repository that I created: ``` dd.to_parquet(dask_df, path = "hf://datasets/philippemo/dummy_dataset/data") ``` However, after pushing the dataset using Dask, the "image" column is now represented as the encoded dictionary `(['bytes', 'path'])`, and the images are not properly visualized. You can find the dataset here: [Link to the problematic dataset](https://huggingface.co/datasets/philippemo/dummy_dataset). It's worth noting that both the original dataset and the one submitted with Dask have the same schema with minor alterations related to metadata: **[ Schema of original dummy example.](https://huggingface.co/datasets/lambdalabs/pokemon-blip-captions/blob/main/data/train-00000-of-00001-566cc9b19d7203f8.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` **[ Schema of pushed dataset with dask](https://huggingface.co/datasets/philippemo/dummy_dataset/blob/main/data/part.0.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` This issue seems to be related to an encoding type that occurs when pushing a model to the hub. Normally, models should be represented as an HF dataset before pushing, but we are working with an example where we need to push large datasets using Dask. Could you please provide clarification on how to resolve this issue? Thank you! ### Reproduction To get the schema I downloaded the parquet files and used pyarrow.parquet to read the schema ``` import pyarrow.parquet pyarrow.parquet.read_schema(<path_to_parquet>, memory_map=True) ``` ### Logs _No response_ ### System info ```shell - huggingface_hub version: 0.14.1 - Platform: Linux-5.19.0-41-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /home/philippe/.cache/huggingface/token - Has saved token ?: True - Who am I ?: philippemo - Configured git credential helpers: cache - FastAI: N/A - Tensorflow: N/A - Torch: N/A - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.4.0 - hf_transfer: N/A - gradio: N/A - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /home/philippe/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /home/philippe/.cache/huggingface/assets - HF_TOKEN_PATH: /home/philippe/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` Hi @lhoestq, I'v tried pushing another dataset again and I think the issue reappeared again: ``` df = dd.read_parquet(f"hf://datasets/lambdalabs/pokemon-blip-captions") features = datasets.Features({"image": datasets.Image(), "text": datasets.Value("string")}) schema = features.arrow_schema dd.to_parquet(df, path = "hf://datasets/philippemo/dummy_dataset_without_schema_12_06/data", schema=schema) ``` Here is the dataset: https://huggingface.co/datasets/philippemo/dummy_dataset_without_schema_12_06 The one that was working 2 weeks ago still seems to be intact though, it might be that It rendered properly when it was initially submitted and after this something was reverted from your side: https://huggingface.co/datasets/philippemo/dummy_dataset_without_schema It's weird because nothing really changed from the implementation, might be another issue in the hub backend. Do you have any pointers on how to resolve this?
[ -0.07916499674320221, -0.19343626499176025, 0.05645659565925598, 0.4631294906139374, 0.24050284922122955, -0.03627727925777435, -0.07235730439424515, 0.15203076601028442, -0.020293869078159332, 0.08434884250164032, 0.2394731044769287, 0.25118616223335266, -0.05058019608259201, 0.1921534389257431, 0.11636337637901306, 0.013332569971680641, 0.23355509340763092, -0.13842418789863586, 0.035421762615442276, -0.1840411126613617, 0.024526141583919525, 0.023211026564240456, 0.09557671844959259, -0.12756088376045227, -0.31958872079849243, -0.12848052382469177, -0.1838715821504593, 0.16795723140239716, -0.29963672161102295, -0.24417482316493988, 0.1643291413784027, -0.0545198954641819, -0.03208453953266144, 0.39378952980041504, -0.0001218078687088564, 0.19774697721004486, 0.34032559394836426, -0.17158105969429016, -0.5198479294776917, -0.07692272961139679, -0.3051050305366516, -0.3085200786590576, 0.05941668152809143, -0.309287965297699, 0.0069709718227386475, -0.25256574153900146, 0.20677407085895538, -0.22702455520629883, 0.4726438522338867, 0.08928938210010529, 0.14610987901687622, 0.005707211792469025, 0.0009384825825691223, 0.26594099402427673, 0.03785824775695801, 0.47385528683662415, -0.04954889416694641, 0.04280170425772667, -0.18786868453025818, 0.24820902943611145, -0.09282605350017548, 0.15272480249404907, 0.08712490648031235, -0.00805438868701458, -0.016361994668841362, 0.20589324831962585, 0.20241717994213104, -0.1180095225572586, 0.10727289319038391, -0.05603448301553726, 0.3830835819244385, -0.36889907717704773, -0.4593268036842346, -0.30965960025787354, -0.03681962192058563, -0.4328514337539673, 0.32440492510795593, 0.2548222243785858, -0.0003364458680152893, 0.03457079827785492, -0.21113935112953186, -0.09784790873527527, -0.018189646303653717, -0.0407535657286644, -0.42851364612579346, -0.08900092542171478, -0.05984817445278168, 0.006623944267630577, -0.19672420620918274, -0.19502106308937073, -0.25219568610191345, -0.3026195466518402, -0.1774444878101349, -0.013072261586785316, 0.01207483746111393, 0.08645853400230408, -0.38594385981559753, -0.17382048070430756, 0.24907076358795166, -0.21245458722114563, -0.02549496293067932, 0.044269971549510956, 0.07893548905849457, 0.03922950476408005, 0.5062429904937744, -0.12927505373954773, -0.03976383060216904, 0.2804526388645172, -0.14378151297569275, 0.2625155448913574, 0.11786860227584839, -0.1301410049200058, -0.09396785497665405, 0.04139737784862518, 0.008238278329372406, -0.33153077960014343, 0.3395339846611023, -0.20103085041046143, -0.26428651809692383, 0.3871088922023773, 0.014363810420036316, 0.15616726875305176, -0.2204391360282898, 0.05782905966043472, -0.05315091088414192, -0.09420032799243927, -0.04410804063081741, 0.47267287969589233, -0.16827616095542908, -0.15016549825668335, -0.1741468757390976, -0.030894160270690918, -0.23196938633918762, -0.18701446056365967, -0.2916504144668579, -0.11245979368686676, 0.10146734118461609, 0.33954858779907227, 0.26186174154281616, -0.0037779733538627625, -0.3535880744457245, -0.17566774785518646, 0.3936227262020111, 0.11428333818912506, -0.181613028049469, 0.07735942304134369, 0.22098040580749512, -0.5117228031158447, -0.022964052855968475, -0.11341151595115662, -0.5474387407302856, 0.2746683657169342, -0.2667553126811981, 0.011132691986858845, -0.08528672158718109, 0.044519055634737015, -0.7847863435745239, 0.2940651476383209, -0.1569625288248062, -0.06727255880832672, -0.0302228145301342, -0.12930867075920105, -0.15981081128120422, -0.05944700911641121, 0.340188592672348, 0.33771514892578125, -0.19652074575424194, -0.0005269423127174377, 0.211419016122818, 0.10521763563156128, 0.43732064962387085, 0.21744775772094727, 0.0002976544201374054, -0.2075202912092209, -0.19594281911849976, 0.2834984064102173, 0.2477104514837265, -0.3083104193210602, -0.3637264370918274, 0.20732124149799347, 0.05494142323732376, 0.5474240183830261, -0.1219802275300026, -0.33859020471572876, 0.706177294254303, 0.026742804795503616, -0.1680281013250351, 0.3964022994041443, -0.05914565175771713, 0.22435082495212555, -0.34280863404273987, -0.13862639665603638, 0.233963280916214, -0.0564732700586319, -0.15170186758041382, -0.03644343838095665, 0.2565060257911682, 0.131291002035141, 0.08944565802812576, -0.013808006420731544, 0.1822938770055771, 0.13118819892406464, 0.07572855055332184, 0.22033259272575378, 0.07828377932310104, 0.08855684101581573, -0.21446797251701355, 0.2078758329153061, 0.07565057277679443, -0.020138951018452644, -0.6611341238021851, -0.05346376821398735, -0.16341593861579895, 0.15432989597320557, -0.3454017639160156, -0.26112934947013855, 0.10302689671516418, -0.18398931622505188, -0.187301367521286, 0.3532286286354065, -0.043276917189359665, 0.4639715552330017, -0.07420756667852402, 0.09023401141166687, -0.0024136528372764587, 0.4434558153152466, 0.16038428246974945, -0.27561497688293457, 0.05932071805000305, 0.11286928504705429, 0.08718172460794449, -0.20341093838214874, -0.03168509528040886, 0.30247241258621216, 0.47361379861831665, 0.2217513471841812, 0.19026757776737213, -0.14624746143817902, 0.34467995166778564, -0.16282746195793152, 0.09265882521867752, 0.05102993920445442, 0.10109417140483856, 0.12053026258945465, -0.3240894675254822, 0.19300389289855957, 0.2009456604719162, 0.11035066843032837, -0.19701902568340302, 0.11846049875020981, 0.24099549651145935, 0.13371887803077698, 0.017451830208301544, -0.22268861532211304, -0.20250633358955383, -0.14895997941493988, 0.01594855636358261, -0.15677784383296967, -0.3826122283935547, -0.09111963212490082, 0.25387585163116455, 0.19720742106437683, -0.07561331987380981, 0.16839781403541565, -0.014281917363405228, -0.09961596876382828, 0.1962994486093521, 0.3102966547012329, -0.16031783819198608, 0.11406266689300537, -0.05157270282506943, -0.04516921192407608, -0.05097324773669243, 0.21072445809841156, 0.0645216554403305, 0.03468870744109154, 0.38239526748657227, 0.09176066517829895, 0.22126369178295135, 0.10599218308925629, -0.289608895778656, 0.3012440502643585, 0.06205640733242035, 0.08901318162679672, -0.130911722779274, 0.24661411345005035, -0.6420296430587769, -0.1346006691455841, -0.250227689743042, 0.5710702538490295, -0.682451605796814, -0.2674350440502167, -0.07291704416275024, -0.13285697996616364, -0.03968258202075958, 0.11197592318058014, -0.16302737593650818, -0.006094217300415039, -0.05273965001106262, -0.19894228875637054, -0.168374165892601, -0.23569059371948242, -0.23182329535484314, -0.027816852554678917, 0.3248855769634247, 0.21233808994293213, 0.38557004928588867, -0.02140980213880539, 0.03407187759876251, -0.518075704574585, -0.19129739701747894, 0.3227287530899048, -0.21198764443397522, 0.19274577498435974, 0.017438102513551712, 0.18571817874908447, -0.3791752755641937, -0.07872322201728821, 0.3171776533126831, 0.29951804876327515, -0.31969359517097473, 0.19377385079860687, 0.07341989874839783, -0.24825848639011383, -0.06052228808403015, 0.3777472674846649, -0.032671406865119934, -0.03471996262669563, 0.07491407543420792, 0.15761052072048187, 0.12044703960418701, 0.05838102102279663, 0.17136725783348083, -0.09452171623706818, 0.03701040893793106, -0.03860544413328171, -0.2712515592575073, -0.3488621711730957, 0.16746753454208374, -0.06116615608334541, -0.3941246271133423, -0.009151890873908997, -0.013774648308753967, 0.09752555936574936, 0.6122156381607056, -0.4919033348560333, -0.14909076690673828, -0.019757017493247986, 0.028535082936286926, 0.20034730434417725, -0.2247292846441269, -0.027866549789905548, -0.13298243284225464, 0.06330052763223648, -0.20220136642456055, -0.2573300898075104, 0.23993903398513794, 0.44075146317481995, 0.32058218121528625, 0.22766725718975067, 0.47231075167655945, 0.07370960712432861, 0.33951127529144287, 0.24130193889141083, -0.05962551757693291, 0.47799065709114075, -0.30464479327201843, 0.40736517310142517, -0.057125747203826904, 0.02726447582244873, 0.07030518352985382, 0.05161358416080475, -0.07665444910526276, 0.10197190940380096, -0.10778730362653732, -0.007601086050271988, 0.1210765466094017, 0.07934093475341797, -0.4577903747558594, -0.20341160893440247, -0.020402031019330025, -0.306393027305603, 0.22629229724407196, -0.05433841049671173, -0.06515920162200928, -0.04452984780073166, 0.001288682222366333, 0.1311672478914261, 0.08704619109630585, 0.2863551080226898, 0.15852703154087067, 0.1519756317138672, 0.20825409889221191, -0.3474852442741394, 0.0844966396689415, 0.08030015230178833, 0.41018542647361755, -0.08110155165195465, 0.14033301174640656, 0.263540118932724, -0.12458974123001099, 0.9913992285728455, -0.07324831932783127, 0.0463947169482708, 0.006614558398723602, -0.22308924794197083, -0.3880262076854706, -0.14035595953464508, -0.07921162247657776, 0.17726217210292816, -0.2802383005619049, 0.4486265480518341, -0.5790385007858276, -0.15004587173461914, -0.00007326342165470123, -0.03217074275016785, -0.2849447727203369, 0.2814604640007019, -0.273240864276886, -0.06345083564519882, -0.1931152641773224, 0.024621507152915, 0.3160390853881836, 0.2254040390253067, 0.29118281602859497, 0.20496916770935059, -0.3069373667240143, 0.3140944540500641, -0.09414389729499817, 0.16854235529899597, 0.7633002400398254, -0.0018072165548801422, 0.11994614452123642, 0.34088411927223206, 0.5542935729026794, 0.4060317575931549, 0.681222677230835, 0.1060827299952507, -0.5684740543365479, -0.026644669473171234, -0.2976146340370178, 0.2752879858016968, 0.3391740322113037, 0.19574227929115295, -0.1426192820072174, -0.2332392781972885, -0.12143495678901672, -0.5962797403335571, 0.0048218779265880585, 0.6384521126747131, -0.06977512687444687, -0.3294113576412201, -0.10974253714084625, 0.26602399349212646, 0.01982904225587845, 0.1059081107378006, -0.1032584011554718, 0.6814203858375549, -0.3524845540523529, 0.29314732551574707, 0.43852463364601135, 0.6986760497093201, -0.31745898723602295, 0.08485960960388184, 0.2611289918422699, -0.41698163747787476, 0.05339523032307625, -0.008640453219413757, -0.16793294250965118, -0.1286677122116089, 0.026765964925289154, -0.002383500337600708, 0.010570414364337921, 0.10287268459796906, 0.05427601933479309, -0.03950437903404236, -0.025233056396245956, -0.13475537300109863, -0.10187064111232758, -0.16843479871749878, 0.26752281188964844, 0.02645270712673664, -0.0855833888053894, -0.30577975511550903, 0.12090219557285309, -0.17668913304805756, -0.24624857306480408, 0.1322004199028015, -0.3132990896701813, -0.3896317481994629, 0.033578477799892426, -0.21205377578735352, 0.17872308194637299, 0.09609001874923706, 0.10728970170021057, 0.10292860865592957, -0.41311413049697876, 0.12592896819114685, 0.3106502294540405, 0.18212267756462097, -0.18301285803318024, -0.09230932593345642, 0.29682376980781555, -0.1273464411497116, 0.10368946194648743, 0.029159806668758392, 0.04628952592611313, 0.3173646926879883, -0.010158903896808624, 0.1919703185558319, -0.3208054304122925, -0.03930879384279251, 0.05043976008892059, -0.09223057329654694, -0.0019683297723531723, 0.29481789469718933, -0.0745924711227417, -0.08492542058229446, -0.20530332624912262, 0.15854820609092712, 0.05422896146774292, -0.0011428743600845337, -0.05587608739733696, 0.13133308291435242, -0.1556420922279358, 0.2875654995441437, -0.12445589900016785, 0.03552263230085373, 0.31148016452789307, -0.20124299824237823, -0.06983207166194916, 0.47928592562675476, -0.2162202000617981, -0.35114753246307373, 0.06262609362602234, -0.15597200393676758, 0.124468132853508, -0.35657575726509094, 0.22543083131313324, -0.3644396960735321, 0.10456603765487671, -0.3070925176143646, -0.08409903198480606, -0.007379754912108183, -0.4085598587989807, -0.09839437156915665, -0.04116646945476532, -0.038579411804676056, 0.3225950300693512, -0.30236488580703735, 0.1972884088754654, 0.06166757643222809, -0.07260958105325699, -0.1025754064321518, -0.16005875170230865, -0.1915740668773651, 0.24606581032276154, 0.07074514776468277, 0.3006419241428375, 0.3208974003791809, 0.03700247034430504, 0.11884783953428268, -0.39820000529289246, 0.08051833510398865, 0.09587366878986359, 0.06930314749479294, -0.021773288026452065, -0.3344597816467285, 0.1346713900566101, -0.028862766921520233, -0.03297141194343567, -0.009161468595266342, -0.08928275108337402, -0.11016947031021118, -0.3043563663959503, 0.06306718289852142, 0.209659144282341, -0.1419305056333542, -0.12058883905410767, 0.9170119762420654, 0.2859131097793579, 0.029125086963176727, -0.08836822211742401, 0.138609379529953, 0.33755743503570557, -0.06887565553188324, -0.02053120546042919, -0.21704143285751343, -0.000537477433681488, 0.06906968355178833, 0.2671671211719513, 0.01341732032597065, 0.05737423524260521, 0.4994564354419708, -0.3344879448413849, 0.21903619170188904, 0.27255484461784363, 0.400823712348938, 0.24880696833133698, -0.2676967978477478, -0.5458172559738159, 0.45789268612861633, 0.08216634392738342, -0.04859311506152153, 0.024749580770730972, 0.44291025400161743, -0.1257719099521637, -0.3181057572364807, 0.033412158489227295, 0.2590599060058594, 0.20852315425872803, -0.5375937819480896, -0.0032423213124275208, 0.42927515506744385, -0.2545764446258545, 0.10580794513225555, 0.08040713518857956, 0.05851776897907257, 0.23365382850170135, 0.026060422882437706, 0.17333675920963287, 0.06848163902759552, 0.3626081645488739, -0.08599037677049637, 0.1869955062866211, 0.3254638612270355, -0.09261880815029144, 0.08684144914150238, -0.11117130517959595, 0.1897805780172348, 0.08123205602169037, 0.04683030769228935, 0.5865591168403625, 0.3055868446826935, 0.10792411863803864, 0.32768091559410095, -0.495758056640625, -0.19348132610321045, 0.05727165937423706, -0.09897714853286743, 0.13845551013946533, 0.12484008073806763, -0.05365820229053497, -0.3922593593597412, 0.25666868686676025, -0.33554723858833313, -0.19774621725082397, -0.13969971239566803, 0.22027626633644104, -0.0032346993684768677, -0.060584839433431625, -0.39027321338653564, -0.15120570361614227, 0.47595852613449097, -0.2736614942550659, 0.2344486266374588, 0.05876272916793823, -0.2052232325077057, 0.23883210122585297, 0.33249086141586304, 0.4195669889450073, 0.07144515216350555, 0.08306039869785309, -0.1600944995880127, 0.281386137008667, 0.02718251198530197, 0.08298996090888977, 0.052955709397792816, -0.09173879772424698, -0.03044990822672844, 0.14321619272232056, 0.05522787570953369, 0.012671142816543579, -0.5502858757972717, 0.3455536663532257, 0.10991154611110687, 0.046859823167324066, -0.19337791204452515, -0.13313499093055725, 0.041244372725486755, -0.19122137129306793, -0.18751804530620575, -0.2555430233478546, -0.33245784044265747, -0.004474034532904625, 0.06573499739170074, 0.09889018535614014, 0.19960926473140717, 0.01873113214969635, -0.038432635366916656, 0.37142181396484375, 0.4363003373146057, -0.30787989497184753, -0.0035356003791093826, -0.12242960184812546, -0.5355163812637329, 0.29517385363578796, -0.269599586725235, -0.4630351662635803, 0.4378815293312073, 0.20798969268798828, 0.13077384233474731, 0.05380599573254585, 0.01805943250656128, 0.1585981696844101, -0.29508212208747864, 0.14028210937976837, -0.26408645510673523, -0.16466931998729706, 0.24281570315361023, -0.19256681203842163, -0.07076211273670197, 0.003395870327949524, 0.35976552963256836, -0.020562320947647095, -0.016280006617307663, 0.09018146991729736, 0.1677822768688202, -0.5286961793899536, -0.4443299174308777, -0.03129997104406357, 0.1747814267873764, 0.19653204083442688, -0.22732099890708923, -0.2542477250099182, -0.22993382811546326, -0.0498366542160511, -0.19927209615707397, 0.5373099446296692, -0.26691287755966187, 0.5406489372253418, 0.06785796582698822, -0.27915582060813904, -0.12024100124835968, 0.2953866720199585, 0.0641380324959755, -0.16347941756248474, -0.1523139327764511, 0.10899059474468231, 0.057386696338653564, -0.07962803542613983, -0.0009504631161689758, 0.26892566680908203, 0.1437426656484604, 0.16440999507904053, 0.061094820499420166, -0.24893951416015625, 0.2889636754989624, -0.3820137083530426, -0.21670272946357727, 0.1949497014284134, -0.07249452918767929, 0.1960967481136322, 0.06945039331912994, -0.42897215485572815, 0.030249804258346558, 0.12145823240280151, -0.22034421563148499, -0.026455849409103394, 0.2109253853559494, 0.1932188868522644, -0.07092390209436417, -0.004424840211868286, 0.07811242341995239, -0.169754296541214, -0.15706488490104675, 0.1803692877292633, -0.11369789391756058 ]
https://github.com/huggingface/datasets/issues/5869
We're doing some changes in the way we're handling image parquet datasets right now. We'll include the fix from https://github.com/huggingface/datasets/pull/5921 in the new datasets-server version in the coming days
Image Encoding Issue when submitting a Parquet Dataset
### Describe the bug Hello, I'd like to report an issue related to pushing a dataset represented as a Parquet file to a dataset repository using Dask. Here are the details: We attempted to load an example dataset in Parquet format from the Hugging Face (HF) filesystem using Dask with the following code snippet: ``` import dask.dataframe as dd df = dd.read_parquet("hf://datasets/lambdalabs/pokemon-blip-captions",index=False) ``` In this dataset, the "image" column is represented as a dictionary/struct with the format: ``` df = df.compute() df["image"].iloc[0].keys() -> dict_keys(['bytes', 'path']) ``` I think this is the format encoded by the [`Image`](https://huggingface.co/docs/datasets/v2.0.0/en/package_reference/main_classes#datasets.Image) feature extractor from datasets to format suitable for Arrow. The next step was to push the dataset to a repository that I created: ``` dd.to_parquet(dask_df, path = "hf://datasets/philippemo/dummy_dataset/data") ``` However, after pushing the dataset using Dask, the "image" column is now represented as the encoded dictionary `(['bytes', 'path'])`, and the images are not properly visualized. You can find the dataset here: [Link to the problematic dataset](https://huggingface.co/datasets/philippemo/dummy_dataset). It's worth noting that both the original dataset and the one submitted with Dask have the same schema with minor alterations related to metadata: **[ Schema of original dummy example.](https://huggingface.co/datasets/lambdalabs/pokemon-blip-captions/blob/main/data/train-00000-of-00001-566cc9b19d7203f8.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` **[ Schema of pushed dataset with dask](https://huggingface.co/datasets/philippemo/dummy_dataset/blob/main/data/part.0.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` This issue seems to be related to an encoding type that occurs when pushing a model to the hub. Normally, models should be represented as an HF dataset before pushing, but we are working with an example where we need to push large datasets using Dask. Could you please provide clarification on how to resolve this issue? Thank you! ### Reproduction To get the schema I downloaded the parquet files and used pyarrow.parquet to read the schema ``` import pyarrow.parquet pyarrow.parquet.read_schema(<path_to_parquet>, memory_map=True) ``` ### Logs _No response_ ### System info ```shell - huggingface_hub version: 0.14.1 - Platform: Linux-5.19.0-41-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /home/philippe/.cache/huggingface/token - Has saved token ?: True - Who am I ?: philippemo - Configured git credential helpers: cache - FastAI: N/A - Tensorflow: N/A - Torch: N/A - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.4.0 - hf_transfer: N/A - gradio: N/A - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /home/philippe/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /home/philippe/.cache/huggingface/assets - HF_TOKEN_PATH: /home/philippe/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
29
Image Encoding Issue when submitting a Parquet Dataset ### Describe the bug Hello, I'd like to report an issue related to pushing a dataset represented as a Parquet file to a dataset repository using Dask. Here are the details: We attempted to load an example dataset in Parquet format from the Hugging Face (HF) filesystem using Dask with the following code snippet: ``` import dask.dataframe as dd df = dd.read_parquet("hf://datasets/lambdalabs/pokemon-blip-captions",index=False) ``` In this dataset, the "image" column is represented as a dictionary/struct with the format: ``` df = df.compute() df["image"].iloc[0].keys() -> dict_keys(['bytes', 'path']) ``` I think this is the format encoded by the [`Image`](https://huggingface.co/docs/datasets/v2.0.0/en/package_reference/main_classes#datasets.Image) feature extractor from datasets to format suitable for Arrow. The next step was to push the dataset to a repository that I created: ``` dd.to_parquet(dask_df, path = "hf://datasets/philippemo/dummy_dataset/data") ``` However, after pushing the dataset using Dask, the "image" column is now represented as the encoded dictionary `(['bytes', 'path'])`, and the images are not properly visualized. You can find the dataset here: [Link to the problematic dataset](https://huggingface.co/datasets/philippemo/dummy_dataset). It's worth noting that both the original dataset and the one submitted with Dask have the same schema with minor alterations related to metadata: **[ Schema of original dummy example.](https://huggingface.co/datasets/lambdalabs/pokemon-blip-captions/blob/main/data/train-00000-of-00001-566cc9b19d7203f8.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` **[ Schema of pushed dataset with dask](https://huggingface.co/datasets/philippemo/dummy_dataset/blob/main/data/part.0.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` This issue seems to be related to an encoding type that occurs when pushing a model to the hub. Normally, models should be represented as an HF dataset before pushing, but we are working with an example where we need to push large datasets using Dask. Could you please provide clarification on how to resolve this issue? Thank you! ### Reproduction To get the schema I downloaded the parquet files and used pyarrow.parquet to read the schema ``` import pyarrow.parquet pyarrow.parquet.read_schema(<path_to_parquet>, memory_map=True) ``` ### Logs _No response_ ### System info ```shell - huggingface_hub version: 0.14.1 - Platform: Linux-5.19.0-41-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /home/philippe/.cache/huggingface/token - Has saved token ?: True - Who am I ?: philippemo - Configured git credential helpers: cache - FastAI: N/A - Tensorflow: N/A - Torch: N/A - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.4.0 - hf_transfer: N/A - gradio: N/A - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /home/philippe/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /home/philippe/.cache/huggingface/assets - HF_TOKEN_PATH: /home/philippe/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` We're doing some changes in the way we're handling image parquet datasets right now. We'll include the fix from https://github.com/huggingface/datasets/pull/5921 in the new datasets-server version in the coming days
[ -0.07916499674320221, -0.19343626499176025, 0.05645659565925598, 0.4631294906139374, 0.24050284922122955, -0.03627727925777435, -0.07235730439424515, 0.15203076601028442, -0.020293869078159332, 0.08434884250164032, 0.2394731044769287, 0.25118616223335266, -0.05058019608259201, 0.1921534389257431, 0.11636337637901306, 0.013332569971680641, 0.23355509340763092, -0.13842418789863586, 0.035421762615442276, -0.1840411126613617, 0.024526141583919525, 0.023211026564240456, 0.09557671844959259, -0.12756088376045227, -0.31958872079849243, -0.12848052382469177, -0.1838715821504593, 0.16795723140239716, -0.29963672161102295, -0.24417482316493988, 0.1643291413784027, -0.0545198954641819, -0.03208453953266144, 0.39378952980041504, -0.0001218078687088564, 0.19774697721004486, 0.34032559394836426, -0.17158105969429016, -0.5198479294776917, -0.07692272961139679, -0.3051050305366516, -0.3085200786590576, 0.05941668152809143, -0.309287965297699, 0.0069709718227386475, -0.25256574153900146, 0.20677407085895538, -0.22702455520629883, 0.4726438522338867, 0.08928938210010529, 0.14610987901687622, 0.005707211792469025, 0.0009384825825691223, 0.26594099402427673, 0.03785824775695801, 0.47385528683662415, -0.04954889416694641, 0.04280170425772667, -0.18786868453025818, 0.24820902943611145, -0.09282605350017548, 0.15272480249404907, 0.08712490648031235, -0.00805438868701458, -0.016361994668841362, 0.20589324831962585, 0.20241717994213104, -0.1180095225572586, 0.10727289319038391, -0.05603448301553726, 0.3830835819244385, -0.36889907717704773, -0.4593268036842346, -0.30965960025787354, -0.03681962192058563, -0.4328514337539673, 0.32440492510795593, 0.2548222243785858, -0.0003364458680152893, 0.03457079827785492, -0.21113935112953186, -0.09784790873527527, -0.018189646303653717, -0.0407535657286644, -0.42851364612579346, -0.08900092542171478, -0.05984817445278168, 0.006623944267630577, -0.19672420620918274, -0.19502106308937073, -0.25219568610191345, -0.3026195466518402, -0.1774444878101349, -0.013072261586785316, 0.01207483746111393, 0.08645853400230408, -0.38594385981559753, -0.17382048070430756, 0.24907076358795166, -0.21245458722114563, -0.02549496293067932, 0.044269971549510956, 0.07893548905849457, 0.03922950476408005, 0.5062429904937744, -0.12927505373954773, -0.03976383060216904, 0.2804526388645172, -0.14378151297569275, 0.2625155448913574, 0.11786860227584839, -0.1301410049200058, -0.09396785497665405, 0.04139737784862518, 0.008238278329372406, -0.33153077960014343, 0.3395339846611023, -0.20103085041046143, -0.26428651809692383, 0.3871088922023773, 0.014363810420036316, 0.15616726875305176, -0.2204391360282898, 0.05782905966043472, -0.05315091088414192, -0.09420032799243927, -0.04410804063081741, 0.47267287969589233, -0.16827616095542908, -0.15016549825668335, -0.1741468757390976, -0.030894160270690918, -0.23196938633918762, -0.18701446056365967, -0.2916504144668579, -0.11245979368686676, 0.10146734118461609, 0.33954858779907227, 0.26186174154281616, -0.0037779733538627625, -0.3535880744457245, -0.17566774785518646, 0.3936227262020111, 0.11428333818912506, -0.181613028049469, 0.07735942304134369, 0.22098040580749512, -0.5117228031158447, -0.022964052855968475, -0.11341151595115662, -0.5474387407302856, 0.2746683657169342, -0.2667553126811981, 0.011132691986858845, -0.08528672158718109, 0.044519055634737015, -0.7847863435745239, 0.2940651476383209, -0.1569625288248062, -0.06727255880832672, -0.0302228145301342, -0.12930867075920105, -0.15981081128120422, -0.05944700911641121, 0.340188592672348, 0.33771514892578125, -0.19652074575424194, -0.0005269423127174377, 0.211419016122818, 0.10521763563156128, 0.43732064962387085, 0.21744775772094727, 0.0002976544201374054, -0.2075202912092209, -0.19594281911849976, 0.2834984064102173, 0.2477104514837265, -0.3083104193210602, -0.3637264370918274, 0.20732124149799347, 0.05494142323732376, 0.5474240183830261, -0.1219802275300026, -0.33859020471572876, 0.706177294254303, 0.026742804795503616, -0.1680281013250351, 0.3964022994041443, -0.05914565175771713, 0.22435082495212555, -0.34280863404273987, -0.13862639665603638, 0.233963280916214, -0.0564732700586319, -0.15170186758041382, -0.03644343838095665, 0.2565060257911682, 0.131291002035141, 0.08944565802812576, -0.013808006420731544, 0.1822938770055771, 0.13118819892406464, 0.07572855055332184, 0.22033259272575378, 0.07828377932310104, 0.08855684101581573, -0.21446797251701355, 0.2078758329153061, 0.07565057277679443, -0.020138951018452644, -0.6611341238021851, -0.05346376821398735, -0.16341593861579895, 0.15432989597320557, -0.3454017639160156, -0.26112934947013855, 0.10302689671516418, -0.18398931622505188, -0.187301367521286, 0.3532286286354065, -0.043276917189359665, 0.4639715552330017, -0.07420756667852402, 0.09023401141166687, -0.0024136528372764587, 0.4434558153152466, 0.16038428246974945, -0.27561497688293457, 0.05932071805000305, 0.11286928504705429, 0.08718172460794449, -0.20341093838214874, -0.03168509528040886, 0.30247241258621216, 0.47361379861831665, 0.2217513471841812, 0.19026757776737213, -0.14624746143817902, 0.34467995166778564, -0.16282746195793152, 0.09265882521867752, 0.05102993920445442, 0.10109417140483856, 0.12053026258945465, -0.3240894675254822, 0.19300389289855957, 0.2009456604719162, 0.11035066843032837, -0.19701902568340302, 0.11846049875020981, 0.24099549651145935, 0.13371887803077698, 0.017451830208301544, -0.22268861532211304, -0.20250633358955383, -0.14895997941493988, 0.01594855636358261, -0.15677784383296967, -0.3826122283935547, -0.09111963212490082, 0.25387585163116455, 0.19720742106437683, -0.07561331987380981, 0.16839781403541565, -0.014281917363405228, -0.09961596876382828, 0.1962994486093521, 0.3102966547012329, -0.16031783819198608, 0.11406266689300537, -0.05157270282506943, -0.04516921192407608, -0.05097324773669243, 0.21072445809841156, 0.0645216554403305, 0.03468870744109154, 0.38239526748657227, 0.09176066517829895, 0.22126369178295135, 0.10599218308925629, -0.289608895778656, 0.3012440502643585, 0.06205640733242035, 0.08901318162679672, -0.130911722779274, 0.24661411345005035, -0.6420296430587769, -0.1346006691455841, -0.250227689743042, 0.5710702538490295, -0.682451605796814, -0.2674350440502167, -0.07291704416275024, -0.13285697996616364, -0.03968258202075958, 0.11197592318058014, -0.16302737593650818, -0.006094217300415039, -0.05273965001106262, -0.19894228875637054, -0.168374165892601, -0.23569059371948242, -0.23182329535484314, -0.027816852554678917, 0.3248855769634247, 0.21233808994293213, 0.38557004928588867, -0.02140980213880539, 0.03407187759876251, -0.518075704574585, -0.19129739701747894, 0.3227287530899048, -0.21198764443397522, 0.19274577498435974, 0.017438102513551712, 0.18571817874908447, -0.3791752755641937, -0.07872322201728821, 0.3171776533126831, 0.29951804876327515, -0.31969359517097473, 0.19377385079860687, 0.07341989874839783, -0.24825848639011383, -0.06052228808403015, 0.3777472674846649, -0.032671406865119934, -0.03471996262669563, 0.07491407543420792, 0.15761052072048187, 0.12044703960418701, 0.05838102102279663, 0.17136725783348083, -0.09452171623706818, 0.03701040893793106, -0.03860544413328171, -0.2712515592575073, -0.3488621711730957, 0.16746753454208374, -0.06116615608334541, -0.3941246271133423, -0.009151890873908997, -0.013774648308753967, 0.09752555936574936, 0.6122156381607056, -0.4919033348560333, -0.14909076690673828, -0.019757017493247986, 0.028535082936286926, 0.20034730434417725, -0.2247292846441269, -0.027866549789905548, -0.13298243284225464, 0.06330052763223648, -0.20220136642456055, -0.2573300898075104, 0.23993903398513794, 0.44075146317481995, 0.32058218121528625, 0.22766725718975067, 0.47231075167655945, 0.07370960712432861, 0.33951127529144287, 0.24130193889141083, -0.05962551757693291, 0.47799065709114075, -0.30464479327201843, 0.40736517310142517, -0.057125747203826904, 0.02726447582244873, 0.07030518352985382, 0.05161358416080475, -0.07665444910526276, 0.10197190940380096, -0.10778730362653732, -0.007601086050271988, 0.1210765466094017, 0.07934093475341797, -0.4577903747558594, -0.20341160893440247, -0.020402031019330025, -0.306393027305603, 0.22629229724407196, -0.05433841049671173, -0.06515920162200928, -0.04452984780073166, 0.001288682222366333, 0.1311672478914261, 0.08704619109630585, 0.2863551080226898, 0.15852703154087067, 0.1519756317138672, 0.20825409889221191, -0.3474852442741394, 0.0844966396689415, 0.08030015230178833, 0.41018542647361755, -0.08110155165195465, 0.14033301174640656, 0.263540118932724, -0.12458974123001099, 0.9913992285728455, -0.07324831932783127, 0.0463947169482708, 0.006614558398723602, -0.22308924794197083, -0.3880262076854706, -0.14035595953464508, -0.07921162247657776, 0.17726217210292816, -0.2802383005619049, 0.4486265480518341, -0.5790385007858276, -0.15004587173461914, -0.00007326342165470123, -0.03217074275016785, -0.2849447727203369, 0.2814604640007019, -0.273240864276886, -0.06345083564519882, -0.1931152641773224, 0.024621507152915, 0.3160390853881836, 0.2254040390253067, 0.29118281602859497, 0.20496916770935059, -0.3069373667240143, 0.3140944540500641, -0.09414389729499817, 0.16854235529899597, 0.7633002400398254, -0.0018072165548801422, 0.11994614452123642, 0.34088411927223206, 0.5542935729026794, 0.4060317575931549, 0.681222677230835, 0.1060827299952507, -0.5684740543365479, -0.026644669473171234, -0.2976146340370178, 0.2752879858016968, 0.3391740322113037, 0.19574227929115295, -0.1426192820072174, -0.2332392781972885, -0.12143495678901672, -0.5962797403335571, 0.0048218779265880585, 0.6384521126747131, -0.06977512687444687, -0.3294113576412201, -0.10974253714084625, 0.26602399349212646, 0.01982904225587845, 0.1059081107378006, -0.1032584011554718, 0.6814203858375549, -0.3524845540523529, 0.29314732551574707, 0.43852463364601135, 0.6986760497093201, -0.31745898723602295, 0.08485960960388184, 0.2611289918422699, -0.41698163747787476, 0.05339523032307625, -0.008640453219413757, -0.16793294250965118, -0.1286677122116089, 0.026765964925289154, -0.002383500337600708, 0.010570414364337921, 0.10287268459796906, 0.05427601933479309, -0.03950437903404236, -0.025233056396245956, -0.13475537300109863, -0.10187064111232758, -0.16843479871749878, 0.26752281188964844, 0.02645270712673664, -0.0855833888053894, -0.30577975511550903, 0.12090219557285309, -0.17668913304805756, -0.24624857306480408, 0.1322004199028015, -0.3132990896701813, -0.3896317481994629, 0.033578477799892426, -0.21205377578735352, 0.17872308194637299, 0.09609001874923706, 0.10728970170021057, 0.10292860865592957, -0.41311413049697876, 0.12592896819114685, 0.3106502294540405, 0.18212267756462097, -0.18301285803318024, -0.09230932593345642, 0.29682376980781555, -0.1273464411497116, 0.10368946194648743, 0.029159806668758392, 0.04628952592611313, 0.3173646926879883, -0.010158903896808624, 0.1919703185558319, -0.3208054304122925, -0.03930879384279251, 0.05043976008892059, -0.09223057329654694, -0.0019683297723531723, 0.29481789469718933, -0.0745924711227417, -0.08492542058229446, -0.20530332624912262, 0.15854820609092712, 0.05422896146774292, -0.0011428743600845337, -0.05587608739733696, 0.13133308291435242, -0.1556420922279358, 0.2875654995441437, -0.12445589900016785, 0.03552263230085373, 0.31148016452789307, -0.20124299824237823, -0.06983207166194916, 0.47928592562675476, -0.2162202000617981, -0.35114753246307373, 0.06262609362602234, -0.15597200393676758, 0.124468132853508, -0.35657575726509094, 0.22543083131313324, -0.3644396960735321, 0.10456603765487671, -0.3070925176143646, -0.08409903198480606, -0.007379754912108183, -0.4085598587989807, -0.09839437156915665, -0.04116646945476532, -0.038579411804676056, 0.3225950300693512, -0.30236488580703735, 0.1972884088754654, 0.06166757643222809, -0.07260958105325699, -0.1025754064321518, -0.16005875170230865, -0.1915740668773651, 0.24606581032276154, 0.07074514776468277, 0.3006419241428375, 0.3208974003791809, 0.03700247034430504, 0.11884783953428268, -0.39820000529289246, 0.08051833510398865, 0.09587366878986359, 0.06930314749479294, -0.021773288026452065, -0.3344597816467285, 0.1346713900566101, -0.028862766921520233, -0.03297141194343567, -0.009161468595266342, -0.08928275108337402, -0.11016947031021118, -0.3043563663959503, 0.06306718289852142, 0.209659144282341, -0.1419305056333542, -0.12058883905410767, 0.9170119762420654, 0.2859131097793579, 0.029125086963176727, -0.08836822211742401, 0.138609379529953, 0.33755743503570557, -0.06887565553188324, -0.02053120546042919, -0.21704143285751343, -0.000537477433681488, 0.06906968355178833, 0.2671671211719513, 0.01341732032597065, 0.05737423524260521, 0.4994564354419708, -0.3344879448413849, 0.21903619170188904, 0.27255484461784363, 0.400823712348938, 0.24880696833133698, -0.2676967978477478, -0.5458172559738159, 0.45789268612861633, 0.08216634392738342, -0.04859311506152153, 0.024749580770730972, 0.44291025400161743, -0.1257719099521637, -0.3181057572364807, 0.033412158489227295, 0.2590599060058594, 0.20852315425872803, -0.5375937819480896, -0.0032423213124275208, 0.42927515506744385, -0.2545764446258545, 0.10580794513225555, 0.08040713518857956, 0.05851776897907257, 0.23365382850170135, 0.026060422882437706, 0.17333675920963287, 0.06848163902759552, 0.3626081645488739, -0.08599037677049637, 0.1869955062866211, 0.3254638612270355, -0.09261880815029144, 0.08684144914150238, -0.11117130517959595, 0.1897805780172348, 0.08123205602169037, 0.04683030769228935, 0.5865591168403625, 0.3055868446826935, 0.10792411863803864, 0.32768091559410095, -0.495758056640625, -0.19348132610321045, 0.05727165937423706, -0.09897714853286743, 0.13845551013946533, 0.12484008073806763, -0.05365820229053497, -0.3922593593597412, 0.25666868686676025, -0.33554723858833313, -0.19774621725082397, -0.13969971239566803, 0.22027626633644104, -0.0032346993684768677, -0.060584839433431625, -0.39027321338653564, -0.15120570361614227, 0.47595852613449097, -0.2736614942550659, 0.2344486266374588, 0.05876272916793823, -0.2052232325077057, 0.23883210122585297, 0.33249086141586304, 0.4195669889450073, 0.07144515216350555, 0.08306039869785309, -0.1600944995880127, 0.281386137008667, 0.02718251198530197, 0.08298996090888977, 0.052955709397792816, -0.09173879772424698, -0.03044990822672844, 0.14321619272232056, 0.05522787570953369, 0.012671142816543579, -0.5502858757972717, 0.3455536663532257, 0.10991154611110687, 0.046859823167324066, -0.19337791204452515, -0.13313499093055725, 0.041244372725486755, -0.19122137129306793, -0.18751804530620575, -0.2555430233478546, -0.33245784044265747, -0.004474034532904625, 0.06573499739170074, 0.09889018535614014, 0.19960926473140717, 0.01873113214969635, -0.038432635366916656, 0.37142181396484375, 0.4363003373146057, -0.30787989497184753, -0.0035356003791093826, -0.12242960184812546, -0.5355163812637329, 0.29517385363578796, -0.269599586725235, -0.4630351662635803, 0.4378815293312073, 0.20798969268798828, 0.13077384233474731, 0.05380599573254585, 0.01805943250656128, 0.1585981696844101, -0.29508212208747864, 0.14028210937976837, -0.26408645510673523, -0.16466931998729706, 0.24281570315361023, -0.19256681203842163, -0.07076211273670197, 0.003395870327949524, 0.35976552963256836, -0.020562320947647095, -0.016280006617307663, 0.09018146991729736, 0.1677822768688202, -0.5286961793899536, -0.4443299174308777, -0.03129997104406357, 0.1747814267873764, 0.19653204083442688, -0.22732099890708923, -0.2542477250099182, -0.22993382811546326, -0.0498366542160511, -0.19927209615707397, 0.5373099446296692, -0.26691287755966187, 0.5406489372253418, 0.06785796582698822, -0.27915582060813904, -0.12024100124835968, 0.2953866720199585, 0.0641380324959755, -0.16347941756248474, -0.1523139327764511, 0.10899059474468231, 0.057386696338653564, -0.07962803542613983, -0.0009504631161689758, 0.26892566680908203, 0.1437426656484604, 0.16440999507904053, 0.061094820499420166, -0.24893951416015625, 0.2889636754989624, -0.3820137083530426, -0.21670272946357727, 0.1949497014284134, -0.07249452918767929, 0.1960967481136322, 0.06945039331912994, -0.42897215485572815, 0.030249804258346558, 0.12145823240280151, -0.22034421563148499, -0.026455849409103394, 0.2109253853559494, 0.1932188868522644, -0.07092390209436417, -0.004424840211868286, 0.07811242341995239, -0.169754296541214, -0.15706488490104675, 0.1803692877292633, -0.11369789391756058 ]
https://github.com/huggingface/datasets/issues/5869
alright thanks for the update :), would that be part of the new release of datasets or is it something separate? if so, where can I track it?
Image Encoding Issue when submitting a Parquet Dataset
### Describe the bug Hello, I'd like to report an issue related to pushing a dataset represented as a Parquet file to a dataset repository using Dask. Here are the details: We attempted to load an example dataset in Parquet format from the Hugging Face (HF) filesystem using Dask with the following code snippet: ``` import dask.dataframe as dd df = dd.read_parquet("hf://datasets/lambdalabs/pokemon-blip-captions",index=False) ``` In this dataset, the "image" column is represented as a dictionary/struct with the format: ``` df = df.compute() df["image"].iloc[0].keys() -> dict_keys(['bytes', 'path']) ``` I think this is the format encoded by the [`Image`](https://huggingface.co/docs/datasets/v2.0.0/en/package_reference/main_classes#datasets.Image) feature extractor from datasets to format suitable for Arrow. The next step was to push the dataset to a repository that I created: ``` dd.to_parquet(dask_df, path = "hf://datasets/philippemo/dummy_dataset/data") ``` However, after pushing the dataset using Dask, the "image" column is now represented as the encoded dictionary `(['bytes', 'path'])`, and the images are not properly visualized. You can find the dataset here: [Link to the problematic dataset](https://huggingface.co/datasets/philippemo/dummy_dataset). It's worth noting that both the original dataset and the one submitted with Dask have the same schema with minor alterations related to metadata: **[ Schema of original dummy example.](https://huggingface.co/datasets/lambdalabs/pokemon-blip-captions/blob/main/data/train-00000-of-00001-566cc9b19d7203f8.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` **[ Schema of pushed dataset with dask](https://huggingface.co/datasets/philippemo/dummy_dataset/blob/main/data/part.0.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` This issue seems to be related to an encoding type that occurs when pushing a model to the hub. Normally, models should be represented as an HF dataset before pushing, but we are working with an example where we need to push large datasets using Dask. Could you please provide clarification on how to resolve this issue? Thank you! ### Reproduction To get the schema I downloaded the parquet files and used pyarrow.parquet to read the schema ``` import pyarrow.parquet pyarrow.parquet.read_schema(<path_to_parquet>, memory_map=True) ``` ### Logs _No response_ ### System info ```shell - huggingface_hub version: 0.14.1 - Platform: Linux-5.19.0-41-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /home/philippe/.cache/huggingface/token - Has saved token ?: True - Who am I ?: philippemo - Configured git credential helpers: cache - FastAI: N/A - Tensorflow: N/A - Torch: N/A - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.4.0 - hf_transfer: N/A - gradio: N/A - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /home/philippe/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /home/philippe/.cache/huggingface/assets - HF_TOKEN_PATH: /home/philippe/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
28
Image Encoding Issue when submitting a Parquet Dataset ### Describe the bug Hello, I'd like to report an issue related to pushing a dataset represented as a Parquet file to a dataset repository using Dask. Here are the details: We attempted to load an example dataset in Parquet format from the Hugging Face (HF) filesystem using Dask with the following code snippet: ``` import dask.dataframe as dd df = dd.read_parquet("hf://datasets/lambdalabs/pokemon-blip-captions",index=False) ``` In this dataset, the "image" column is represented as a dictionary/struct with the format: ``` df = df.compute() df["image"].iloc[0].keys() -> dict_keys(['bytes', 'path']) ``` I think this is the format encoded by the [`Image`](https://huggingface.co/docs/datasets/v2.0.0/en/package_reference/main_classes#datasets.Image) feature extractor from datasets to format suitable for Arrow. The next step was to push the dataset to a repository that I created: ``` dd.to_parquet(dask_df, path = "hf://datasets/philippemo/dummy_dataset/data") ``` However, after pushing the dataset using Dask, the "image" column is now represented as the encoded dictionary `(['bytes', 'path'])`, and the images are not properly visualized. You can find the dataset here: [Link to the problematic dataset](https://huggingface.co/datasets/philippemo/dummy_dataset). It's worth noting that both the original dataset and the one submitted with Dask have the same schema with minor alterations related to metadata: **[ Schema of original dummy example.](https://huggingface.co/datasets/lambdalabs/pokemon-blip-captions/blob/main/data/train-00000-of-00001-566cc9b19d7203f8.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` **[ Schema of pushed dataset with dask](https://huggingface.co/datasets/philippemo/dummy_dataset/blob/main/data/part.0.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` This issue seems to be related to an encoding type that occurs when pushing a model to the hub. Normally, models should be represented as an HF dataset before pushing, but we are working with an example where we need to push large datasets using Dask. Could you please provide clarification on how to resolve this issue? Thank you! ### Reproduction To get the schema I downloaded the parquet files and used pyarrow.parquet to read the schema ``` import pyarrow.parquet pyarrow.parquet.read_schema(<path_to_parquet>, memory_map=True) ``` ### Logs _No response_ ### System info ```shell - huggingface_hub version: 0.14.1 - Platform: Linux-5.19.0-41-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /home/philippe/.cache/huggingface/token - Has saved token ?: True - Who am I ?: philippemo - Configured git credential helpers: cache - FastAI: N/A - Tensorflow: N/A - Torch: N/A - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.4.0 - hf_transfer: N/A - gradio: N/A - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /home/philippe/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /home/philippe/.cache/huggingface/assets - HF_TOKEN_PATH: /home/philippe/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` alright thanks for the update :), would that be part of the new release of datasets or is it something separate? if so, where can I track it?
[ -0.07916499674320221, -0.19343626499176025, 0.05645659565925598, 0.4631294906139374, 0.24050284922122955, -0.03627727925777435, -0.07235730439424515, 0.15203076601028442, -0.020293869078159332, 0.08434884250164032, 0.2394731044769287, 0.25118616223335266, -0.05058019608259201, 0.1921534389257431, 0.11636337637901306, 0.013332569971680641, 0.23355509340763092, -0.13842418789863586, 0.035421762615442276, -0.1840411126613617, 0.024526141583919525, 0.023211026564240456, 0.09557671844959259, -0.12756088376045227, -0.31958872079849243, -0.12848052382469177, -0.1838715821504593, 0.16795723140239716, -0.29963672161102295, -0.24417482316493988, 0.1643291413784027, -0.0545198954641819, -0.03208453953266144, 0.39378952980041504, -0.0001218078687088564, 0.19774697721004486, 0.34032559394836426, -0.17158105969429016, -0.5198479294776917, -0.07692272961139679, -0.3051050305366516, -0.3085200786590576, 0.05941668152809143, -0.309287965297699, 0.0069709718227386475, -0.25256574153900146, 0.20677407085895538, -0.22702455520629883, 0.4726438522338867, 0.08928938210010529, 0.14610987901687622, 0.005707211792469025, 0.0009384825825691223, 0.26594099402427673, 0.03785824775695801, 0.47385528683662415, -0.04954889416694641, 0.04280170425772667, -0.18786868453025818, 0.24820902943611145, -0.09282605350017548, 0.15272480249404907, 0.08712490648031235, -0.00805438868701458, -0.016361994668841362, 0.20589324831962585, 0.20241717994213104, -0.1180095225572586, 0.10727289319038391, -0.05603448301553726, 0.3830835819244385, -0.36889907717704773, -0.4593268036842346, -0.30965960025787354, -0.03681962192058563, -0.4328514337539673, 0.32440492510795593, 0.2548222243785858, -0.0003364458680152893, 0.03457079827785492, -0.21113935112953186, -0.09784790873527527, -0.018189646303653717, -0.0407535657286644, -0.42851364612579346, -0.08900092542171478, -0.05984817445278168, 0.006623944267630577, -0.19672420620918274, -0.19502106308937073, -0.25219568610191345, -0.3026195466518402, -0.1774444878101349, -0.013072261586785316, 0.01207483746111393, 0.08645853400230408, -0.38594385981559753, -0.17382048070430756, 0.24907076358795166, -0.21245458722114563, -0.02549496293067932, 0.044269971549510956, 0.07893548905849457, 0.03922950476408005, 0.5062429904937744, -0.12927505373954773, -0.03976383060216904, 0.2804526388645172, -0.14378151297569275, 0.2625155448913574, 0.11786860227584839, -0.1301410049200058, -0.09396785497665405, 0.04139737784862518, 0.008238278329372406, -0.33153077960014343, 0.3395339846611023, -0.20103085041046143, -0.26428651809692383, 0.3871088922023773, 0.014363810420036316, 0.15616726875305176, -0.2204391360282898, 0.05782905966043472, -0.05315091088414192, -0.09420032799243927, -0.04410804063081741, 0.47267287969589233, -0.16827616095542908, -0.15016549825668335, -0.1741468757390976, -0.030894160270690918, -0.23196938633918762, -0.18701446056365967, -0.2916504144668579, -0.11245979368686676, 0.10146734118461609, 0.33954858779907227, 0.26186174154281616, -0.0037779733538627625, -0.3535880744457245, -0.17566774785518646, 0.3936227262020111, 0.11428333818912506, -0.181613028049469, 0.07735942304134369, 0.22098040580749512, -0.5117228031158447, -0.022964052855968475, -0.11341151595115662, -0.5474387407302856, 0.2746683657169342, -0.2667553126811981, 0.011132691986858845, -0.08528672158718109, 0.044519055634737015, -0.7847863435745239, 0.2940651476383209, -0.1569625288248062, -0.06727255880832672, -0.0302228145301342, -0.12930867075920105, -0.15981081128120422, -0.05944700911641121, 0.340188592672348, 0.33771514892578125, -0.19652074575424194, -0.0005269423127174377, 0.211419016122818, 0.10521763563156128, 0.43732064962387085, 0.21744775772094727, 0.0002976544201374054, -0.2075202912092209, -0.19594281911849976, 0.2834984064102173, 0.2477104514837265, -0.3083104193210602, -0.3637264370918274, 0.20732124149799347, 0.05494142323732376, 0.5474240183830261, -0.1219802275300026, -0.33859020471572876, 0.706177294254303, 0.026742804795503616, -0.1680281013250351, 0.3964022994041443, -0.05914565175771713, 0.22435082495212555, -0.34280863404273987, -0.13862639665603638, 0.233963280916214, -0.0564732700586319, -0.15170186758041382, -0.03644343838095665, 0.2565060257911682, 0.131291002035141, 0.08944565802812576, -0.013808006420731544, 0.1822938770055771, 0.13118819892406464, 0.07572855055332184, 0.22033259272575378, 0.07828377932310104, 0.08855684101581573, -0.21446797251701355, 0.2078758329153061, 0.07565057277679443, -0.020138951018452644, -0.6611341238021851, -0.05346376821398735, -0.16341593861579895, 0.15432989597320557, -0.3454017639160156, -0.26112934947013855, 0.10302689671516418, -0.18398931622505188, -0.187301367521286, 0.3532286286354065, -0.043276917189359665, 0.4639715552330017, -0.07420756667852402, 0.09023401141166687, -0.0024136528372764587, 0.4434558153152466, 0.16038428246974945, -0.27561497688293457, 0.05932071805000305, 0.11286928504705429, 0.08718172460794449, -0.20341093838214874, -0.03168509528040886, 0.30247241258621216, 0.47361379861831665, 0.2217513471841812, 0.19026757776737213, -0.14624746143817902, 0.34467995166778564, -0.16282746195793152, 0.09265882521867752, 0.05102993920445442, 0.10109417140483856, 0.12053026258945465, -0.3240894675254822, 0.19300389289855957, 0.2009456604719162, 0.11035066843032837, -0.19701902568340302, 0.11846049875020981, 0.24099549651145935, 0.13371887803077698, 0.017451830208301544, -0.22268861532211304, -0.20250633358955383, -0.14895997941493988, 0.01594855636358261, -0.15677784383296967, -0.3826122283935547, -0.09111963212490082, 0.25387585163116455, 0.19720742106437683, -0.07561331987380981, 0.16839781403541565, -0.014281917363405228, -0.09961596876382828, 0.1962994486093521, 0.3102966547012329, -0.16031783819198608, 0.11406266689300537, -0.05157270282506943, -0.04516921192407608, -0.05097324773669243, 0.21072445809841156, 0.0645216554403305, 0.03468870744109154, 0.38239526748657227, 0.09176066517829895, 0.22126369178295135, 0.10599218308925629, -0.289608895778656, 0.3012440502643585, 0.06205640733242035, 0.08901318162679672, -0.130911722779274, 0.24661411345005035, -0.6420296430587769, -0.1346006691455841, -0.250227689743042, 0.5710702538490295, -0.682451605796814, -0.2674350440502167, -0.07291704416275024, -0.13285697996616364, -0.03968258202075958, 0.11197592318058014, -0.16302737593650818, -0.006094217300415039, -0.05273965001106262, -0.19894228875637054, -0.168374165892601, -0.23569059371948242, -0.23182329535484314, -0.027816852554678917, 0.3248855769634247, 0.21233808994293213, 0.38557004928588867, -0.02140980213880539, 0.03407187759876251, -0.518075704574585, -0.19129739701747894, 0.3227287530899048, -0.21198764443397522, 0.19274577498435974, 0.017438102513551712, 0.18571817874908447, -0.3791752755641937, -0.07872322201728821, 0.3171776533126831, 0.29951804876327515, -0.31969359517097473, 0.19377385079860687, 0.07341989874839783, -0.24825848639011383, -0.06052228808403015, 0.3777472674846649, -0.032671406865119934, -0.03471996262669563, 0.07491407543420792, 0.15761052072048187, 0.12044703960418701, 0.05838102102279663, 0.17136725783348083, -0.09452171623706818, 0.03701040893793106, -0.03860544413328171, -0.2712515592575073, -0.3488621711730957, 0.16746753454208374, -0.06116615608334541, -0.3941246271133423, -0.009151890873908997, -0.013774648308753967, 0.09752555936574936, 0.6122156381607056, -0.4919033348560333, -0.14909076690673828, -0.019757017493247986, 0.028535082936286926, 0.20034730434417725, -0.2247292846441269, -0.027866549789905548, -0.13298243284225464, 0.06330052763223648, -0.20220136642456055, -0.2573300898075104, 0.23993903398513794, 0.44075146317481995, 0.32058218121528625, 0.22766725718975067, 0.47231075167655945, 0.07370960712432861, 0.33951127529144287, 0.24130193889141083, -0.05962551757693291, 0.47799065709114075, -0.30464479327201843, 0.40736517310142517, -0.057125747203826904, 0.02726447582244873, 0.07030518352985382, 0.05161358416080475, -0.07665444910526276, 0.10197190940380096, -0.10778730362653732, -0.007601086050271988, 0.1210765466094017, 0.07934093475341797, -0.4577903747558594, -0.20341160893440247, -0.020402031019330025, -0.306393027305603, 0.22629229724407196, -0.05433841049671173, -0.06515920162200928, -0.04452984780073166, 0.001288682222366333, 0.1311672478914261, 0.08704619109630585, 0.2863551080226898, 0.15852703154087067, 0.1519756317138672, 0.20825409889221191, -0.3474852442741394, 0.0844966396689415, 0.08030015230178833, 0.41018542647361755, -0.08110155165195465, 0.14033301174640656, 0.263540118932724, -0.12458974123001099, 0.9913992285728455, -0.07324831932783127, 0.0463947169482708, 0.006614558398723602, -0.22308924794197083, -0.3880262076854706, -0.14035595953464508, -0.07921162247657776, 0.17726217210292816, -0.2802383005619049, 0.4486265480518341, -0.5790385007858276, -0.15004587173461914, -0.00007326342165470123, -0.03217074275016785, -0.2849447727203369, 0.2814604640007019, -0.273240864276886, -0.06345083564519882, -0.1931152641773224, 0.024621507152915, 0.3160390853881836, 0.2254040390253067, 0.29118281602859497, 0.20496916770935059, -0.3069373667240143, 0.3140944540500641, -0.09414389729499817, 0.16854235529899597, 0.7633002400398254, -0.0018072165548801422, 0.11994614452123642, 0.34088411927223206, 0.5542935729026794, 0.4060317575931549, 0.681222677230835, 0.1060827299952507, -0.5684740543365479, -0.026644669473171234, -0.2976146340370178, 0.2752879858016968, 0.3391740322113037, 0.19574227929115295, -0.1426192820072174, -0.2332392781972885, -0.12143495678901672, -0.5962797403335571, 0.0048218779265880585, 0.6384521126747131, -0.06977512687444687, -0.3294113576412201, -0.10974253714084625, 0.26602399349212646, 0.01982904225587845, 0.1059081107378006, -0.1032584011554718, 0.6814203858375549, -0.3524845540523529, 0.29314732551574707, 0.43852463364601135, 0.6986760497093201, -0.31745898723602295, 0.08485960960388184, 0.2611289918422699, -0.41698163747787476, 0.05339523032307625, -0.008640453219413757, -0.16793294250965118, -0.1286677122116089, 0.026765964925289154, -0.002383500337600708, 0.010570414364337921, 0.10287268459796906, 0.05427601933479309, -0.03950437903404236, -0.025233056396245956, -0.13475537300109863, -0.10187064111232758, -0.16843479871749878, 0.26752281188964844, 0.02645270712673664, -0.0855833888053894, -0.30577975511550903, 0.12090219557285309, -0.17668913304805756, -0.24624857306480408, 0.1322004199028015, -0.3132990896701813, -0.3896317481994629, 0.033578477799892426, -0.21205377578735352, 0.17872308194637299, 0.09609001874923706, 0.10728970170021057, 0.10292860865592957, -0.41311413049697876, 0.12592896819114685, 0.3106502294540405, 0.18212267756462097, -0.18301285803318024, -0.09230932593345642, 0.29682376980781555, -0.1273464411497116, 0.10368946194648743, 0.029159806668758392, 0.04628952592611313, 0.3173646926879883, -0.010158903896808624, 0.1919703185558319, -0.3208054304122925, -0.03930879384279251, 0.05043976008892059, -0.09223057329654694, -0.0019683297723531723, 0.29481789469718933, -0.0745924711227417, -0.08492542058229446, -0.20530332624912262, 0.15854820609092712, 0.05422896146774292, -0.0011428743600845337, -0.05587608739733696, 0.13133308291435242, -0.1556420922279358, 0.2875654995441437, -0.12445589900016785, 0.03552263230085373, 0.31148016452789307, -0.20124299824237823, -0.06983207166194916, 0.47928592562675476, -0.2162202000617981, -0.35114753246307373, 0.06262609362602234, -0.15597200393676758, 0.124468132853508, -0.35657575726509094, 0.22543083131313324, -0.3644396960735321, 0.10456603765487671, -0.3070925176143646, -0.08409903198480606, -0.007379754912108183, -0.4085598587989807, -0.09839437156915665, -0.04116646945476532, -0.038579411804676056, 0.3225950300693512, -0.30236488580703735, 0.1972884088754654, 0.06166757643222809, -0.07260958105325699, -0.1025754064321518, -0.16005875170230865, -0.1915740668773651, 0.24606581032276154, 0.07074514776468277, 0.3006419241428375, 0.3208974003791809, 0.03700247034430504, 0.11884783953428268, -0.39820000529289246, 0.08051833510398865, 0.09587366878986359, 0.06930314749479294, -0.021773288026452065, -0.3344597816467285, 0.1346713900566101, -0.028862766921520233, -0.03297141194343567, -0.009161468595266342, -0.08928275108337402, -0.11016947031021118, -0.3043563663959503, 0.06306718289852142, 0.209659144282341, -0.1419305056333542, -0.12058883905410767, 0.9170119762420654, 0.2859131097793579, 0.029125086963176727, -0.08836822211742401, 0.138609379529953, 0.33755743503570557, -0.06887565553188324, -0.02053120546042919, -0.21704143285751343, -0.000537477433681488, 0.06906968355178833, 0.2671671211719513, 0.01341732032597065, 0.05737423524260521, 0.4994564354419708, -0.3344879448413849, 0.21903619170188904, 0.27255484461784363, 0.400823712348938, 0.24880696833133698, -0.2676967978477478, -0.5458172559738159, 0.45789268612861633, 0.08216634392738342, -0.04859311506152153, 0.024749580770730972, 0.44291025400161743, -0.1257719099521637, -0.3181057572364807, 0.033412158489227295, 0.2590599060058594, 0.20852315425872803, -0.5375937819480896, -0.0032423213124275208, 0.42927515506744385, -0.2545764446258545, 0.10580794513225555, 0.08040713518857956, 0.05851776897907257, 0.23365382850170135, 0.026060422882437706, 0.17333675920963287, 0.06848163902759552, 0.3626081645488739, -0.08599037677049637, 0.1869955062866211, 0.3254638612270355, -0.09261880815029144, 0.08684144914150238, -0.11117130517959595, 0.1897805780172348, 0.08123205602169037, 0.04683030769228935, 0.5865591168403625, 0.3055868446826935, 0.10792411863803864, 0.32768091559410095, -0.495758056640625, -0.19348132610321045, 0.05727165937423706, -0.09897714853286743, 0.13845551013946533, 0.12484008073806763, -0.05365820229053497, -0.3922593593597412, 0.25666868686676025, -0.33554723858833313, -0.19774621725082397, -0.13969971239566803, 0.22027626633644104, -0.0032346993684768677, -0.060584839433431625, -0.39027321338653564, -0.15120570361614227, 0.47595852613449097, -0.2736614942550659, 0.2344486266374588, 0.05876272916793823, -0.2052232325077057, 0.23883210122585297, 0.33249086141586304, 0.4195669889450073, 0.07144515216350555, 0.08306039869785309, -0.1600944995880127, 0.281386137008667, 0.02718251198530197, 0.08298996090888977, 0.052955709397792816, -0.09173879772424698, -0.03044990822672844, 0.14321619272232056, 0.05522787570953369, 0.012671142816543579, -0.5502858757972717, 0.3455536663532257, 0.10991154611110687, 0.046859823167324066, -0.19337791204452515, -0.13313499093055725, 0.041244372725486755, -0.19122137129306793, -0.18751804530620575, -0.2555430233478546, -0.33245784044265747, -0.004474034532904625, 0.06573499739170074, 0.09889018535614014, 0.19960926473140717, 0.01873113214969635, -0.038432635366916656, 0.37142181396484375, 0.4363003373146057, -0.30787989497184753, -0.0035356003791093826, -0.12242960184812546, -0.5355163812637329, 0.29517385363578796, -0.269599586725235, -0.4630351662635803, 0.4378815293312073, 0.20798969268798828, 0.13077384233474731, 0.05380599573254585, 0.01805943250656128, 0.1585981696844101, -0.29508212208747864, 0.14028210937976837, -0.26408645510673523, -0.16466931998729706, 0.24281570315361023, -0.19256681203842163, -0.07076211273670197, 0.003395870327949524, 0.35976552963256836, -0.020562320947647095, -0.016280006617307663, 0.09018146991729736, 0.1677822768688202, -0.5286961793899536, -0.4443299174308777, -0.03129997104406357, 0.1747814267873764, 0.19653204083442688, -0.22732099890708923, -0.2542477250099182, -0.22993382811546326, -0.0498366542160511, -0.19927209615707397, 0.5373099446296692, -0.26691287755966187, 0.5406489372253418, 0.06785796582698822, -0.27915582060813904, -0.12024100124835968, 0.2953866720199585, 0.0641380324959755, -0.16347941756248474, -0.1523139327764511, 0.10899059474468231, 0.057386696338653564, -0.07962803542613983, -0.0009504631161689758, 0.26892566680908203, 0.1437426656484604, 0.16440999507904053, 0.061094820499420166, -0.24893951416015625, 0.2889636754989624, -0.3820137083530426, -0.21670272946357727, 0.1949497014284134, -0.07249452918767929, 0.1960967481136322, 0.06945039331912994, -0.42897215485572815, 0.030249804258346558, 0.12145823240280151, -0.22034421563148499, -0.026455849409103394, 0.2109253853559494, 0.1932188868522644, -0.07092390209436417, -0.004424840211868286, 0.07811242341995239, -0.169754296541214, -0.15706488490104675, 0.1803692877292633, -0.11369789391756058 ]
https://github.com/huggingface/datasets/issues/5869
Once the new version of `datasets` is released (tomorrow probably) we'll open an issue on https://github.com/huggingface/datasets-server to update to this version :)
Image Encoding Issue when submitting a Parquet Dataset
### Describe the bug Hello, I'd like to report an issue related to pushing a dataset represented as a Parquet file to a dataset repository using Dask. Here are the details: We attempted to load an example dataset in Parquet format from the Hugging Face (HF) filesystem using Dask with the following code snippet: ``` import dask.dataframe as dd df = dd.read_parquet("hf://datasets/lambdalabs/pokemon-blip-captions",index=False) ``` In this dataset, the "image" column is represented as a dictionary/struct with the format: ``` df = df.compute() df["image"].iloc[0].keys() -> dict_keys(['bytes', 'path']) ``` I think this is the format encoded by the [`Image`](https://huggingface.co/docs/datasets/v2.0.0/en/package_reference/main_classes#datasets.Image) feature extractor from datasets to format suitable for Arrow. The next step was to push the dataset to a repository that I created: ``` dd.to_parquet(dask_df, path = "hf://datasets/philippemo/dummy_dataset/data") ``` However, after pushing the dataset using Dask, the "image" column is now represented as the encoded dictionary `(['bytes', 'path'])`, and the images are not properly visualized. You can find the dataset here: [Link to the problematic dataset](https://huggingface.co/datasets/philippemo/dummy_dataset). It's worth noting that both the original dataset and the one submitted with Dask have the same schema with minor alterations related to metadata: **[ Schema of original dummy example.](https://huggingface.co/datasets/lambdalabs/pokemon-blip-captions/blob/main/data/train-00000-of-00001-566cc9b19d7203f8.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` **[ Schema of pushed dataset with dask](https://huggingface.co/datasets/philippemo/dummy_dataset/blob/main/data/part.0.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` This issue seems to be related to an encoding type that occurs when pushing a model to the hub. Normally, models should be represented as an HF dataset before pushing, but we are working with an example where we need to push large datasets using Dask. Could you please provide clarification on how to resolve this issue? Thank you! ### Reproduction To get the schema I downloaded the parquet files and used pyarrow.parquet to read the schema ``` import pyarrow.parquet pyarrow.parquet.read_schema(<path_to_parquet>, memory_map=True) ``` ### Logs _No response_ ### System info ```shell - huggingface_hub version: 0.14.1 - Platform: Linux-5.19.0-41-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /home/philippe/.cache/huggingface/token - Has saved token ?: True - Who am I ?: philippemo - Configured git credential helpers: cache - FastAI: N/A - Tensorflow: N/A - Torch: N/A - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.4.0 - hf_transfer: N/A - gradio: N/A - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /home/philippe/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /home/philippe/.cache/huggingface/assets - HF_TOKEN_PATH: /home/philippe/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ```
22
Image Encoding Issue when submitting a Parquet Dataset ### Describe the bug Hello, I'd like to report an issue related to pushing a dataset represented as a Parquet file to a dataset repository using Dask. Here are the details: We attempted to load an example dataset in Parquet format from the Hugging Face (HF) filesystem using Dask with the following code snippet: ``` import dask.dataframe as dd df = dd.read_parquet("hf://datasets/lambdalabs/pokemon-blip-captions",index=False) ``` In this dataset, the "image" column is represented as a dictionary/struct with the format: ``` df = df.compute() df["image"].iloc[0].keys() -> dict_keys(['bytes', 'path']) ``` I think this is the format encoded by the [`Image`](https://huggingface.co/docs/datasets/v2.0.0/en/package_reference/main_classes#datasets.Image) feature extractor from datasets to format suitable for Arrow. The next step was to push the dataset to a repository that I created: ``` dd.to_parquet(dask_df, path = "hf://datasets/philippemo/dummy_dataset/data") ``` However, after pushing the dataset using Dask, the "image" column is now represented as the encoded dictionary `(['bytes', 'path'])`, and the images are not properly visualized. You can find the dataset here: [Link to the problematic dataset](https://huggingface.co/datasets/philippemo/dummy_dataset). It's worth noting that both the original dataset and the one submitted with Dask have the same schema with minor alterations related to metadata: **[ Schema of original dummy example.](https://huggingface.co/datasets/lambdalabs/pokemon-blip-captions/blob/main/data/train-00000-of-00001-566cc9b19d7203f8.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` **[ Schema of pushed dataset with dask](https://huggingface.co/datasets/philippemo/dummy_dataset/blob/main/data/part.0.parquet)** ``` image: struct<bytes: binary, path: null> child 0, bytes: binary child 1, path: null text: string ``` This issue seems to be related to an encoding type that occurs when pushing a model to the hub. Normally, models should be represented as an HF dataset before pushing, but we are working with an example where we need to push large datasets using Dask. Could you please provide clarification on how to resolve this issue? Thank you! ### Reproduction To get the schema I downloaded the parquet files and used pyarrow.parquet to read the schema ``` import pyarrow.parquet pyarrow.parquet.read_schema(<path_to_parquet>, memory_map=True) ``` ### Logs _No response_ ### System info ```shell - huggingface_hub version: 0.14.1 - Platform: Linux-5.19.0-41-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Running in iPython ?: No - Running in notebook ?: No - Running in Google Colab ?: No - Token path ?: /home/philippe/.cache/huggingface/token - Has saved token ?: True - Who am I ?: philippemo - Configured git credential helpers: cache - FastAI: N/A - Tensorflow: N/A - Torch: N/A - Jinja2: 3.1.2 - Graphviz: N/A - Pydot: N/A - Pillow: 9.4.0 - hf_transfer: N/A - gradio: N/A - ENDPOINT: https://huggingface.co - HUGGINGFACE_HUB_CACHE: /home/philippe/.cache/huggingface/hub - HUGGINGFACE_ASSETS_CACHE: /home/philippe/.cache/huggingface/assets - HF_TOKEN_PATH: /home/philippe/.cache/huggingface/token - HF_HUB_OFFLINE: False - HF_HUB_DISABLE_TELEMETRY: False - HF_HUB_DISABLE_PROGRESS_BARS: None - HF_HUB_DISABLE_SYMLINKS_WARNING: False - HF_HUB_DISABLE_EXPERIMENTAL_WARNING: False - HF_HUB_DISABLE_IMPLICIT_TOKEN: False - HF_HUB_ENABLE_HF_TRANSFER: False ``` Once the new version of `datasets` is released (tomorrow probably) we'll open an issue on https://github.com/huggingface/datasets-server to update to this version :)
[ -0.07916499674320221, -0.19343626499176025, 0.05645659565925598, 0.4631294906139374, 0.24050284922122955, -0.03627727925777435, -0.07235730439424515, 0.15203076601028442, -0.020293869078159332, 0.08434884250164032, 0.2394731044769287, 0.25118616223335266, -0.05058019608259201, 0.1921534389257431, 0.11636337637901306, 0.013332569971680641, 0.23355509340763092, -0.13842418789863586, 0.035421762615442276, -0.1840411126613617, 0.024526141583919525, 0.023211026564240456, 0.09557671844959259, -0.12756088376045227, -0.31958872079849243, -0.12848052382469177, -0.1838715821504593, 0.16795723140239716, -0.29963672161102295, -0.24417482316493988, 0.1643291413784027, -0.0545198954641819, -0.03208453953266144, 0.39378952980041504, -0.0001218078687088564, 0.19774697721004486, 0.34032559394836426, -0.17158105969429016, -0.5198479294776917, -0.07692272961139679, -0.3051050305366516, -0.3085200786590576, 0.05941668152809143, -0.309287965297699, 0.0069709718227386475, -0.25256574153900146, 0.20677407085895538, -0.22702455520629883, 0.4726438522338867, 0.08928938210010529, 0.14610987901687622, 0.005707211792469025, 0.0009384825825691223, 0.26594099402427673, 0.03785824775695801, 0.47385528683662415, -0.04954889416694641, 0.04280170425772667, -0.18786868453025818, 0.24820902943611145, -0.09282605350017548, 0.15272480249404907, 0.08712490648031235, -0.00805438868701458, -0.016361994668841362, 0.20589324831962585, 0.20241717994213104, -0.1180095225572586, 0.10727289319038391, -0.05603448301553726, 0.3830835819244385, -0.36889907717704773, -0.4593268036842346, -0.30965960025787354, -0.03681962192058563, -0.4328514337539673, 0.32440492510795593, 0.2548222243785858, -0.0003364458680152893, 0.03457079827785492, -0.21113935112953186, -0.09784790873527527, -0.018189646303653717, -0.0407535657286644, -0.42851364612579346, -0.08900092542171478, -0.05984817445278168, 0.006623944267630577, -0.19672420620918274, -0.19502106308937073, -0.25219568610191345, -0.3026195466518402, -0.1774444878101349, -0.013072261586785316, 0.01207483746111393, 0.08645853400230408, -0.38594385981559753, -0.17382048070430756, 0.24907076358795166, -0.21245458722114563, -0.02549496293067932, 0.044269971549510956, 0.07893548905849457, 0.03922950476408005, 0.5062429904937744, -0.12927505373954773, -0.03976383060216904, 0.2804526388645172, -0.14378151297569275, 0.2625155448913574, 0.11786860227584839, -0.1301410049200058, -0.09396785497665405, 0.04139737784862518, 0.008238278329372406, -0.33153077960014343, 0.3395339846611023, -0.20103085041046143, -0.26428651809692383, 0.3871088922023773, 0.014363810420036316, 0.15616726875305176, -0.2204391360282898, 0.05782905966043472, -0.05315091088414192, -0.09420032799243927, -0.04410804063081741, 0.47267287969589233, -0.16827616095542908, -0.15016549825668335, -0.1741468757390976, -0.030894160270690918, -0.23196938633918762, -0.18701446056365967, -0.2916504144668579, -0.11245979368686676, 0.10146734118461609, 0.33954858779907227, 0.26186174154281616, -0.0037779733538627625, -0.3535880744457245, -0.17566774785518646, 0.3936227262020111, 0.11428333818912506, -0.181613028049469, 0.07735942304134369, 0.22098040580749512, -0.5117228031158447, -0.022964052855968475, -0.11341151595115662, -0.5474387407302856, 0.2746683657169342, -0.2667553126811981, 0.011132691986858845, -0.08528672158718109, 0.044519055634737015, -0.7847863435745239, 0.2940651476383209, -0.1569625288248062, -0.06727255880832672, -0.0302228145301342, -0.12930867075920105, -0.15981081128120422, -0.05944700911641121, 0.340188592672348, 0.33771514892578125, -0.19652074575424194, -0.0005269423127174377, 0.211419016122818, 0.10521763563156128, 0.43732064962387085, 0.21744775772094727, 0.0002976544201374054, -0.2075202912092209, -0.19594281911849976, 0.2834984064102173, 0.2477104514837265, -0.3083104193210602, -0.3637264370918274, 0.20732124149799347, 0.05494142323732376, 0.5474240183830261, -0.1219802275300026, -0.33859020471572876, 0.706177294254303, 0.026742804795503616, -0.1680281013250351, 0.3964022994041443, -0.05914565175771713, 0.22435082495212555, -0.34280863404273987, -0.13862639665603638, 0.233963280916214, -0.0564732700586319, -0.15170186758041382, -0.03644343838095665, 0.2565060257911682, 0.131291002035141, 0.08944565802812576, -0.013808006420731544, 0.1822938770055771, 0.13118819892406464, 0.07572855055332184, 0.22033259272575378, 0.07828377932310104, 0.08855684101581573, -0.21446797251701355, 0.2078758329153061, 0.07565057277679443, -0.020138951018452644, -0.6611341238021851, -0.05346376821398735, -0.16341593861579895, 0.15432989597320557, -0.3454017639160156, -0.26112934947013855, 0.10302689671516418, -0.18398931622505188, -0.187301367521286, 0.3532286286354065, -0.043276917189359665, 0.4639715552330017, -0.07420756667852402, 0.09023401141166687, -0.0024136528372764587, 0.4434558153152466, 0.16038428246974945, -0.27561497688293457, 0.05932071805000305, 0.11286928504705429, 0.08718172460794449, -0.20341093838214874, -0.03168509528040886, 0.30247241258621216, 0.47361379861831665, 0.2217513471841812, 0.19026757776737213, -0.14624746143817902, 0.34467995166778564, -0.16282746195793152, 0.09265882521867752, 0.05102993920445442, 0.10109417140483856, 0.12053026258945465, -0.3240894675254822, 0.19300389289855957, 0.2009456604719162, 0.11035066843032837, -0.19701902568340302, 0.11846049875020981, 0.24099549651145935, 0.13371887803077698, 0.017451830208301544, -0.22268861532211304, -0.20250633358955383, -0.14895997941493988, 0.01594855636358261, -0.15677784383296967, -0.3826122283935547, -0.09111963212490082, 0.25387585163116455, 0.19720742106437683, -0.07561331987380981, 0.16839781403541565, -0.014281917363405228, -0.09961596876382828, 0.1962994486093521, 0.3102966547012329, -0.16031783819198608, 0.11406266689300537, -0.05157270282506943, -0.04516921192407608, -0.05097324773669243, 0.21072445809841156, 0.0645216554403305, 0.03468870744109154, 0.38239526748657227, 0.09176066517829895, 0.22126369178295135, 0.10599218308925629, -0.289608895778656, 0.3012440502643585, 0.06205640733242035, 0.08901318162679672, -0.130911722779274, 0.24661411345005035, -0.6420296430587769, -0.1346006691455841, -0.250227689743042, 0.5710702538490295, -0.682451605796814, -0.2674350440502167, -0.07291704416275024, -0.13285697996616364, -0.03968258202075958, 0.11197592318058014, -0.16302737593650818, -0.006094217300415039, -0.05273965001106262, -0.19894228875637054, -0.168374165892601, -0.23569059371948242, -0.23182329535484314, -0.027816852554678917, 0.3248855769634247, 0.21233808994293213, 0.38557004928588867, -0.02140980213880539, 0.03407187759876251, -0.518075704574585, -0.19129739701747894, 0.3227287530899048, -0.21198764443397522, 0.19274577498435974, 0.017438102513551712, 0.18571817874908447, -0.3791752755641937, -0.07872322201728821, 0.3171776533126831, 0.29951804876327515, -0.31969359517097473, 0.19377385079860687, 0.07341989874839783, -0.24825848639011383, -0.06052228808403015, 0.3777472674846649, -0.032671406865119934, -0.03471996262669563, 0.07491407543420792, 0.15761052072048187, 0.12044703960418701, 0.05838102102279663, 0.17136725783348083, -0.09452171623706818, 0.03701040893793106, -0.03860544413328171, -0.2712515592575073, -0.3488621711730957, 0.16746753454208374, -0.06116615608334541, -0.3941246271133423, -0.009151890873908997, -0.013774648308753967, 0.09752555936574936, 0.6122156381607056, -0.4919033348560333, -0.14909076690673828, -0.019757017493247986, 0.028535082936286926, 0.20034730434417725, -0.2247292846441269, -0.027866549789905548, -0.13298243284225464, 0.06330052763223648, -0.20220136642456055, -0.2573300898075104, 0.23993903398513794, 0.44075146317481995, 0.32058218121528625, 0.22766725718975067, 0.47231075167655945, 0.07370960712432861, 0.33951127529144287, 0.24130193889141083, -0.05962551757693291, 0.47799065709114075, -0.30464479327201843, 0.40736517310142517, -0.057125747203826904, 0.02726447582244873, 0.07030518352985382, 0.05161358416080475, -0.07665444910526276, 0.10197190940380096, -0.10778730362653732, -0.007601086050271988, 0.1210765466094017, 0.07934093475341797, -0.4577903747558594, -0.20341160893440247, -0.020402031019330025, -0.306393027305603, 0.22629229724407196, -0.05433841049671173, -0.06515920162200928, -0.04452984780073166, 0.001288682222366333, 0.1311672478914261, 0.08704619109630585, 0.2863551080226898, 0.15852703154087067, 0.1519756317138672, 0.20825409889221191, -0.3474852442741394, 0.0844966396689415, 0.08030015230178833, 0.41018542647361755, -0.08110155165195465, 0.14033301174640656, 0.263540118932724, -0.12458974123001099, 0.9913992285728455, -0.07324831932783127, 0.0463947169482708, 0.006614558398723602, -0.22308924794197083, -0.3880262076854706, -0.14035595953464508, -0.07921162247657776, 0.17726217210292816, -0.2802383005619049, 0.4486265480518341, -0.5790385007858276, -0.15004587173461914, -0.00007326342165470123, -0.03217074275016785, -0.2849447727203369, 0.2814604640007019, -0.273240864276886, -0.06345083564519882, -0.1931152641773224, 0.024621507152915, 0.3160390853881836, 0.2254040390253067, 0.29118281602859497, 0.20496916770935059, -0.3069373667240143, 0.3140944540500641, -0.09414389729499817, 0.16854235529899597, 0.7633002400398254, -0.0018072165548801422, 0.11994614452123642, 0.34088411927223206, 0.5542935729026794, 0.4060317575931549, 0.681222677230835, 0.1060827299952507, -0.5684740543365479, -0.026644669473171234, -0.2976146340370178, 0.2752879858016968, 0.3391740322113037, 0.19574227929115295, -0.1426192820072174, -0.2332392781972885, -0.12143495678901672, -0.5962797403335571, 0.0048218779265880585, 0.6384521126747131, -0.06977512687444687, -0.3294113576412201, -0.10974253714084625, 0.26602399349212646, 0.01982904225587845, 0.1059081107378006, -0.1032584011554718, 0.6814203858375549, -0.3524845540523529, 0.29314732551574707, 0.43852463364601135, 0.6986760497093201, -0.31745898723602295, 0.08485960960388184, 0.2611289918422699, -0.41698163747787476, 0.05339523032307625, -0.008640453219413757, -0.16793294250965118, -0.1286677122116089, 0.026765964925289154, -0.002383500337600708, 0.010570414364337921, 0.10287268459796906, 0.05427601933479309, -0.03950437903404236, -0.025233056396245956, -0.13475537300109863, -0.10187064111232758, -0.16843479871749878, 0.26752281188964844, 0.02645270712673664, -0.0855833888053894, -0.30577975511550903, 0.12090219557285309, -0.17668913304805756, -0.24624857306480408, 0.1322004199028015, -0.3132990896701813, -0.3896317481994629, 0.033578477799892426, -0.21205377578735352, 0.17872308194637299, 0.09609001874923706, 0.10728970170021057, 0.10292860865592957, -0.41311413049697876, 0.12592896819114685, 0.3106502294540405, 0.18212267756462097, -0.18301285803318024, -0.09230932593345642, 0.29682376980781555, -0.1273464411497116, 0.10368946194648743, 0.029159806668758392, 0.04628952592611313, 0.3173646926879883, -0.010158903896808624, 0.1919703185558319, -0.3208054304122925, -0.03930879384279251, 0.05043976008892059, -0.09223057329654694, -0.0019683297723531723, 0.29481789469718933, -0.0745924711227417, -0.08492542058229446, -0.20530332624912262, 0.15854820609092712, 0.05422896146774292, -0.0011428743600845337, -0.05587608739733696, 0.13133308291435242, -0.1556420922279358, 0.2875654995441437, -0.12445589900016785, 0.03552263230085373, 0.31148016452789307, -0.20124299824237823, -0.06983207166194916, 0.47928592562675476, -0.2162202000617981, -0.35114753246307373, 0.06262609362602234, -0.15597200393676758, 0.124468132853508, -0.35657575726509094, 0.22543083131313324, -0.3644396960735321, 0.10456603765487671, -0.3070925176143646, -0.08409903198480606, -0.007379754912108183, -0.4085598587989807, -0.09839437156915665, -0.04116646945476532, -0.038579411804676056, 0.3225950300693512, -0.30236488580703735, 0.1972884088754654, 0.06166757643222809, -0.07260958105325699, -0.1025754064321518, -0.16005875170230865, -0.1915740668773651, 0.24606581032276154, 0.07074514776468277, 0.3006419241428375, 0.3208974003791809, 0.03700247034430504, 0.11884783953428268, -0.39820000529289246, 0.08051833510398865, 0.09587366878986359, 0.06930314749479294, -0.021773288026452065, -0.3344597816467285, 0.1346713900566101, -0.028862766921520233, -0.03297141194343567, -0.009161468595266342, -0.08928275108337402, -0.11016947031021118, -0.3043563663959503, 0.06306718289852142, 0.209659144282341, -0.1419305056333542, -0.12058883905410767, 0.9170119762420654, 0.2859131097793579, 0.029125086963176727, -0.08836822211742401, 0.138609379529953, 0.33755743503570557, -0.06887565553188324, -0.02053120546042919, -0.21704143285751343, -0.000537477433681488, 0.06906968355178833, 0.2671671211719513, 0.01341732032597065, 0.05737423524260521, 0.4994564354419708, -0.3344879448413849, 0.21903619170188904, 0.27255484461784363, 0.400823712348938, 0.24880696833133698, -0.2676967978477478, -0.5458172559738159, 0.45789268612861633, 0.08216634392738342, -0.04859311506152153, 0.024749580770730972, 0.44291025400161743, -0.1257719099521637, -0.3181057572364807, 0.033412158489227295, 0.2590599060058594, 0.20852315425872803, -0.5375937819480896, -0.0032423213124275208, 0.42927515506744385, -0.2545764446258545, 0.10580794513225555, 0.08040713518857956, 0.05851776897907257, 0.23365382850170135, 0.026060422882437706, 0.17333675920963287, 0.06848163902759552, 0.3626081645488739, -0.08599037677049637, 0.1869955062866211, 0.3254638612270355, -0.09261880815029144, 0.08684144914150238, -0.11117130517959595, 0.1897805780172348, 0.08123205602169037, 0.04683030769228935, 0.5865591168403625, 0.3055868446826935, 0.10792411863803864, 0.32768091559410095, -0.495758056640625, -0.19348132610321045, 0.05727165937423706, -0.09897714853286743, 0.13845551013946533, 0.12484008073806763, -0.05365820229053497, -0.3922593593597412, 0.25666868686676025, -0.33554723858833313, -0.19774621725082397, -0.13969971239566803, 0.22027626633644104, -0.0032346993684768677, -0.060584839433431625, -0.39027321338653564, -0.15120570361614227, 0.47595852613449097, -0.2736614942550659, 0.2344486266374588, 0.05876272916793823, -0.2052232325077057, 0.23883210122585297, 0.33249086141586304, 0.4195669889450073, 0.07144515216350555, 0.08306039869785309, -0.1600944995880127, 0.281386137008667, 0.02718251198530197, 0.08298996090888977, 0.052955709397792816, -0.09173879772424698, -0.03044990822672844, 0.14321619272232056, 0.05522787570953369, 0.012671142816543579, -0.5502858757972717, 0.3455536663532257, 0.10991154611110687, 0.046859823167324066, -0.19337791204452515, -0.13313499093055725, 0.041244372725486755, -0.19122137129306793, -0.18751804530620575, -0.2555430233478546, -0.33245784044265747, -0.004474034532904625, 0.06573499739170074, 0.09889018535614014, 0.19960926473140717, 0.01873113214969635, -0.038432635366916656, 0.37142181396484375, 0.4363003373146057, -0.30787989497184753, -0.0035356003791093826, -0.12242960184812546, -0.5355163812637329, 0.29517385363578796, -0.269599586725235, -0.4630351662635803, 0.4378815293312073, 0.20798969268798828, 0.13077384233474731, 0.05380599573254585, 0.01805943250656128, 0.1585981696844101, -0.29508212208747864, 0.14028210937976837, -0.26408645510673523, -0.16466931998729706, 0.24281570315361023, -0.19256681203842163, -0.07076211273670197, 0.003395870327949524, 0.35976552963256836, -0.020562320947647095, -0.016280006617307663, 0.09018146991729736, 0.1677822768688202, -0.5286961793899536, -0.4443299174308777, -0.03129997104406357, 0.1747814267873764, 0.19653204083442688, -0.22732099890708923, -0.2542477250099182, -0.22993382811546326, -0.0498366542160511, -0.19927209615707397, 0.5373099446296692, -0.26691287755966187, 0.5406489372253418, 0.06785796582698822, -0.27915582060813904, -0.12024100124835968, 0.2953866720199585, 0.0641380324959755, -0.16347941756248474, -0.1523139327764511, 0.10899059474468231, 0.057386696338653564, -0.07962803542613983, -0.0009504631161689758, 0.26892566680908203, 0.1437426656484604, 0.16440999507904053, 0.061094820499420166, -0.24893951416015625, 0.2889636754989624, -0.3820137083530426, -0.21670272946357727, 0.1949497014284134, -0.07249452918767929, 0.1960967481136322, 0.06945039331912994, -0.42897215485572815, 0.030249804258346558, 0.12145823240280151, -0.22034421563148499, -0.026455849409103394, 0.2109253853559494, 0.1932188868522644, -0.07092390209436417, -0.004424840211868286, 0.07811242341995239, -0.169754296541214, -0.15706488490104675, 0.1803692877292633, -0.11369789391756058 ]
https://github.com/huggingface/datasets/issues/5868
Arrow files/primitives (tables and arrays) are immutable, so re-generating them is the only option, I'm afraid.
Is it possible to change a cached file and 're-cache' it instead of re-generating?
### Feature request Hi, I have a huge cached file using `map`(over 500GB), and I want to change an attribution of each element, is there possible to do it using some method instead of re-generating, because `map` takes over 24 hours ### Motivation For large datasets, I think it is very important because we always face the problem which is changing something in the original cache without re-generating it. ### Your contribution For now, I can't help, sorry.
16
Is it possible to change a cached file and 're-cache' it instead of re-generating? ### Feature request Hi, I have a huge cached file using `map`(over 500GB), and I want to change an attribution of each element, is there possible to do it using some method instead of re-generating, because `map` takes over 24 hours ### Motivation For large datasets, I think it is very important because we always face the problem which is changing something in the original cache without re-generating it. ### Your contribution For now, I can't help, sorry. Arrow files/primitives (tables and arrays) are immutable, so re-generating them is the only option, I'm afraid.
[ -0.09704175591468811, -0.11337361484766006, -0.12200784683227539, 0.3231933116912842, -0.00935971736907959, -0.008812941610813141, -0.03176719322800636, 0.19218578934669495, 0.27105098962783813, 0.01684783771634102, -0.1376347541809082, 0.3374762535095215, 0.12592363357543945, -0.3247944116592407, 0.200367271900177, 0.3492264449596405, 0.05296348035335541, 0.3240123391151428, 0.1525478959083557, 0.11897191405296326, -0.024993062019348145, -0.35788604617118835, 0.22659875452518463, -0.19569505751132965, -0.2063097357749939, 0.13931207358837128, -0.058013368397951126, -0.3048628568649292, -0.009172633290290833, -0.3396424353122711, 0.08913467079401016, 0.32565975189208984, -0.1028708815574646, 0.24811825156211853, -0.00012465554755181074, -0.15924642980098724, 0.06577770411968231, -0.17918868362903595, -0.13667380809783936, 0.3749183416366577, -0.2382824867963791, 0.02638871967792511, -0.3890031576156616, -0.2928304076194763, 0.18592098355293274, 0.08445212244987488, 0.19179989397525787, -0.48092082142829895, 0.43162214756011963, -0.07841183990240097, 0.0940341055393219, -0.46669620275497437, -0.03430341184139252, -0.09910936653614044, 0.21820995211601257, 0.1585465371608734, 0.23193752765655518, 0.10788507759571075, 0.28364884853363037, 0.023678161203861237, -0.11489594727754593, 0.27475765347480774, -0.2899666428565979, 0.10943569988012314, 0.6142258644104004, -0.2634483575820923, -0.06005120649933815, 0.05733014643192291, 0.3567154109477997, 0.15972751379013062, 0.49832263588905334, -0.1396799087524414, -0.25287872552871704, -0.02381087839603424, 0.07957251369953156, -0.309080570936203, -0.09774895012378693, 0.09096659719944, 0.09341800957918167, 0.26125600934028625, -0.22187457978725433, -0.5458325147628784, 0.033517301082611084, -0.10036994516849518, 0.040942542254924774, -0.3854818642139435, -0.06635457277297974, 0.13517895340919495, 0.0008795459289103746, 0.17764879763126373, -0.07215960323810577, 0.16130757331848145, -0.6348100304603577, 0.29560747742652893, 0.007234643213450909, -0.09058937430381775, -0.13301196694374084, 0.030395179986953735, 0.15175974369049072, 0.21602310240268707, 0.6258614659309387, 0.10781615972518921, -0.21532315015792847, 0.1519438475370407, -0.17804713547229767, 0.2785569131374359, -0.09622211009263992, -0.0038037337362766266, -0.06433381140232086, 0.08709985762834549, -0.6254619359970093, -0.22553889453411102, 0.07301950454711914, -0.30713433027267456, 0.5059267282485962, 0.2712104618549347, -0.31007540225982666, -0.13416658341884613, 0.2843083143234253, -0.21990340948104858, -0.24895450472831726, -0.1579529494047165, -0.1744946837425232, 0.015762165188789368, 0.016616258770227432, 0.1303013563156128, -0.024747498333454132, -0.22335100173950195, 0.029954157769680023, -0.5287087559700012, 0.10413725674152374, -0.16042384505271912, -0.3321388363838196, 0.4598904550075531, 0.024521872401237488, -0.00946272537112236, -0.1083562821149826, -0.11614629626274109, 0.06940087676048279, -0.3935268223285675, -0.10993383824825287, -0.021427739411592484, 0.33722802996635437, -0.2572250962257385, -0.36782845854759216, 0.012254372239112854, 0.03567275404930115, 0.020726703107357025, -0.24033014476299286, 0.42999088764190674, -0.36108458042144775, -0.3146234154701233, 0.5029320120811462, 0.007959465496242046, 0.29104065895080566, 0.05846777185797691, -0.09393514692783356, -0.011595332995057106, 0.30922991037368774, -0.27544263005256653, 0.37994393706321716, 0.23035258054733276, 0.03148139268159866, -0.3326861262321472, -0.08402951806783676, 0.42255598306655884, 0.10370286554098129, -0.12089760601520538, -0.18826210498809814, 0.3676300048828125, -0.038225121796131134, 0.3769087493419647, -0.24700689315795898, -0.11411909759044647, -0.06436226516962051, -0.068507120013237, 0.6919897794723511, 0.023126110434532166, -0.5936511754989624, 0.020187105983495712, 0.08587751537561417, -0.2579905092716217, 0.31882333755493164, 0.3609517514705658, 0.2379462569952011, 0.15581953525543213, 0.07265643775463104, -0.06216980144381523, 0.2809446156024933, -0.08594252914190292, -0.22840313613414764, -0.49450451135635376, -0.051708560436964035, -0.18085920810699463, 0.058056917041540146, 0.5329778790473938, 0.3566433787345886, -0.1805359423160553, 0.23929491639137268, -0.18583591282367706, 0.2901254892349243, 0.06510819494724274, 0.09220004081726074, -0.00859297625720501, 0.06063263490796089, -0.010010696947574615, 0.005515417084097862, 0.014274097979068756, -0.4072568714618683, -0.6110526919364929, 0.2054445743560791, -0.3626866340637207, 0.02565113455057144, -0.3045368492603302, 0.2546057105064392, -0.3649592101573944, -0.006107497960329056, 0.05115075409412384, 0.3918253481388092, -0.35105395317077637, -0.06790116429328918, -0.08675414323806763, 0.3028794527053833, -0.237096905708313, -0.03655683621764183, -0.2923969030380249, 0.24566404521465302, 0.06588824093341827, -0.4567500948905945, -0.23633092641830444, 0.01658058911561966, 0.17075125873088837, -0.210947185754776, 0.11070181429386139, -0.2495708167552948, 0.22210469841957092, 0.17073386907577515, 0.5277076959609985, -0.2614312767982483, -0.1411346197128296, 0.3107799291610718, -0.15670251846313477, -0.08312768489122391, -0.031427428126335144, 0.14057497680187225, 0.12043584138154984, -0.14238831400871277, 0.15732252597808838, -0.09314808249473572, -0.12952563166618347, 0.006371796131134033, -0.3178570866584778, 0.06791999191045761, 0.12859654426574707, -0.08630542457103729, -0.15120144188404083, 0.1708621382713318, 0.21649068593978882, 0.20293325185775757, 0.12759119272232056, -0.01426449790596962, 0.09495295584201813, -0.02958572283387184, 0.22012609243392944, -0.2813412547111511, -0.060242146253585815, -0.40613308548927307, 0.22363699972629547, 0.17651355266571045, 0.008677128702402115, 0.052948810160160065, -0.07894475758075714, 0.5208948850631714, -0.002542797476053238, 0.07510021328926086, -0.4274217188358307, 0.32201528549194336, 0.10776451230049133, 0.2947080135345459, 0.03279164433479309, 0.14131176471710205, -0.011606939136981964, 0.32993969321250916, -0.04155661165714264, 0.21822236478328705, 0.03088981658220291, 0.015217460691928864, 0.173203706741333, -0.1646437644958496, 0.056948721408843994, 0.047014761716127396, 0.15401136875152588, -0.01223478838801384, 0.1651328206062317, 0.1831376850605011, 0.12281417846679688, 0.01273510605096817, 0.4539087116718292, -0.1366601586341858, 0.02365877293050289, -0.16741234064102173, -0.3406727910041809, 0.28615525364875793, -0.11236129701137543, 0.23681651055812836, -0.48551875352859497, 0.011098971590399742, -0.026937928050756454, -0.028494711965322495, -0.5889542698860168, 0.19840092957019806, -0.1621188372373581, 0.4693014323711395, -0.23166730999946594, -0.32451894879341125, 0.02497016079723835, -0.2863813042640686, 0.20949028432369232, 0.08011581003665924, -0.2880867123603821, 0.012736275792121887, -0.09721067547798157, -0.017741061747074127, 0.31131911277770996, -0.010478585958480835, 0.1709589958190918, 0.046826593577861786, -0.24819062650203705, 0.5057697892189026, 0.09103399515151978, 0.0725044533610344, -0.0613190121948719, 0.07568566501140594, -0.38658052682876587, -0.011817079037427902, 0.08708526194095612, -0.2247685343027115, -0.5601440668106079, 0.28376537561416626, -0.24109524488449097, 0.09221505373716354, -0.3966199457645416, -0.0295419804751873, 0.12452617287635803, 0.7360802888870239, -0.39433223009109497, 0.1469840556383133, -0.2386772185564041, -0.13975462317466736, -0.3441998362541199, -0.05322181433439255, 0.18413233757019043, 0.09534823149442673, -0.14876270294189453, -0.007721990346908569, 0.25048017501831055, -0.05620305612683296, 0.08668144047260284, 0.2186882197856903, 0.2604006826877594, -0.31372225284576416, 0.12607699632644653, 0.6980504989624023, 0.050968900322914124, 0.03299347311258316, 0.16452328860759735, 0.15559373795986176, 0.0667162537574768, -0.1354200392961502, 0.06932597607374191, -0.1036602258682251, -0.356494665145874, -0.2225586473941803, -0.045957181602716446, 0.015636947005987167, -0.2460668981075287, 0.05340059846639633, 0.12835033237934113, -0.18468593060970306, -0.39631327986717224, 0.18830204010009766, -0.44279351830482483, 0.36569178104400635, 0.09442023932933807, -0.3988063931465149, -0.5120460987091064, -0.16760239005088806, 0.38720881938934326, 0.060389865189790726, 0.6383582949638367, 0.06589841842651367, -0.17465734481811523, -0.04792718589305878, -0.1163569986820221, 0.2671907842159271, -0.11771555244922638, -0.13833700120449066, 0.2090960144996643, -0.0806194394826889, -0.008203476667404175, -0.09260521829128265, 0.5156556963920593, 0.01642296276986599, 0.07637414336204529, 0.06722497940063477, 0.15640605986118317, 0.20488116145133972, 0.10976362228393555, 0.25532403588294983, 0.28185951709747314, -0.17083072662353516, 0.08349394798278809, -0.01389378309249878, 0.21711581945419312, -0.4250045418739319, 0.19412018358707428, -0.25978782773017883, -0.03962596505880356, 0.20264407992362976, 0.044001638889312744, -0.212508887052536, -0.1599867343902588, 0.0706055611371994, 0.05413347855210304, 0.3297688364982605, 0.12274812161922455, -0.6227580904960632, 0.4119759202003479, -0.025356914848089218, -0.33380013704299927, 0.2027115821838379, 0.017722029238939285, -0.09157303720712662, -0.1134873628616333, 0.06910383701324463, 0.10860337316989899, 0.30956995487213135, -0.13304756581783295, 0.14256955683231354, -0.40383636951446533, 0.1441139429807663, -0.008341804146766663, 0.097329281270504, 0.03676951304078102, 0.428415447473526, 0.27475303411483765, 0.2307286262512207, -0.2845960557460785, -0.018133029341697693, -0.2810856103897095, 0.18554434180259705, -0.31353792548179626, -0.6156474351882935, 0.23491886258125305, 0.2378530204296112, -0.015621483325958252, 0.6894918084144592, -0.32434144616127014, -0.076041579246521, 0.2277454435825348, 0.34207144379615784, 1.1851916313171387, -0.29278725385665894, 0.28808555006980896, -0.5888304114341736, 0.04547683894634247, 0.10739675164222717, -0.4825814962387085, 0.40810784697532654, -0.47404980659484863, -0.36707013845443726, -0.08172516524791718, -0.08309020102024078, -0.08693753182888031, 0.5167985558509827, 0.06666028499603271, 0.14251771569252014, 0.1036982387304306, 0.10110383480787277, -0.11125554889440536, -0.09913348406553268, -0.276417076587677, -0.13030697405338287, 0.17425477504730225, -0.026023047044873238, 0.0571303516626358, 0.13225452601909637, 0.018283240497112274, 0.11986468732357025, -0.002513118088245392, 0.22444719076156616, -0.27268359065055847, -0.3246591091156006, -0.5018042325973511, 0.20145060122013092, 0.05043916404247284, -0.035333052277565, 0.039449915289878845, 0.11065894365310669, -0.3713327944278717, 0.1400798261165619, 0.14751219749450684, 0.12240978330373764, 0.3501099646091461, -0.009077001363039017, 0.08173595368862152, -0.10519622266292572, 0.012005684897303581, 0.21707892417907715, -0.1251940131187439, 0.17779994010925293, 0.027056369930505753, -0.5736010670661926, -0.05279053747653961, -0.05188015103340149, 0.25618547201156616, 0.15635116398334503, -0.22245244681835175, 0.10547107458114624, -0.40770506858825684, 0.02585383504629135, 0.015071814879775047, 0.07363010942935944, 0.0850079283118248, 0.2949024438858032, 0.08993248641490936, -0.33509087562561035, 0.29577916860580444, 0.33327972888946533, 0.11446148157119751, -0.3719559907913208, 0.30206742882728577, -0.5026944279670715, -0.011886067688465118, -0.09855540096759796, 0.011329151690006256, -0.21388083696365356, -0.41802191734313965, 0.1162874847650528, -0.270376056432724, 0.2659114599227905, 0.03200727701187134, -0.48343372344970703, 0.24798908829689026, 0.7543298006057739, -0.30005812644958496, -0.20980173349380493, -0.1833088994026184, 0.08763831853866577, 0.031132880598306656, 0.06249883770942688, 0.04594191908836365, -0.4605882167816162, -0.20019041001796722, 0.46378758549690247, -0.1406850814819336, 0.46293801069259644, 0.3059263527393341, 0.2284519225358963, 0.10676325112581253, 0.27244633436203003, -0.21184195578098297, -0.05166533589363098, -0.19050249457359314, 0.23063740134239197, -0.11109910905361176, -0.1292770951986313, -0.013718768954277039, 0.19957631826400757, 0.050849199295043945, 0.09047052264213562, -0.05449535697698593, -0.11972588300704956, 0.18678410351276398, -0.20958536863327026, -0.08779176324605942, 0.05226116627454758, 0.049948081374168396, -0.045652106404304504, 0.27434706687927246, -0.06323365867137909, -0.4300391972064972, 0.276758074760437, 0.1894873082637787, 0.20422476530075073, -0.3068946897983551, 0.16739428043365479, 0.04126996546983719, -0.1049514189362526, -0.3430931568145752, 0.06424951553344727, 0.08372001349925995, -0.05480730161070824, 0.23063141107559204, 0.044876664876937866, 0.28823816776275635, 0.1749291568994522, 0.010474681854248047, -0.03055635839700699, -0.05525580793619156, 0.039253659546375275, 0.41244077682495117, 0.05239946395158768, -0.022900652140378952, -0.08127463608980179, 0.25013449788093567, -0.31240135431289673, -0.1077263206243515, 0.14939521253108978, 0.043580710887908936, -0.2072182595729828, -0.21740026772022247, -0.10079547017812729, -0.06048603355884552, -0.3578035533428192, 0.12730249762535095, 0.30595123767852783, 0.43802353739738464, -0.11160608381032944, 0.4056554436683655, 0.3083953261375427, 0.16611595451831818, 0.28830844163894653, 0.22551190853118896, 0.14847834408283234, 0.3981509804725647, 0.25308966636657715, -0.24721083045005798, -0.1977136731147766, 0.12624338269233704, 0.4802069664001465, 0.27367934584617615, 0.5061466097831726, 0.1303814798593521, 0.34797510504722595, 0.4184909462928772, -0.07234767824411392, 0.36624425649642944, 0.26370880007743835, 0.21492928266525269, -0.31778496503829956, 0.2209486961364746, -0.2425214946269989, -0.12298464775085449, 0.15411479771137238, -0.0012735030613839626, 0.4430800676345825, 0.5026168823242188, 0.1574147641658783, 0.051725804805755615, 0.04559927433729172, 0.21294859051704407, 0.14624613523483276, 0.7681081295013428, -0.3883693814277649, -0.37007150053977966, -0.1227307841181755, 0.10712246596813202, 0.32476940751075745, 0.25245729088783264, -0.10446199774742126, 0.2397296130657196, 0.05359550938010216, 0.16088899970054626, -0.16168645024299622, 0.1646057665348053, -0.18808314204216003, -0.07631246745586395, 0.34171050786972046, -0.8487991690635681, -0.2039821296930313, 0.021317407488822937, -0.029690608382225037, -0.02712436020374298, -0.25702571868896484, 0.4061806797981262, -0.01508655771613121, -0.09078758955001831, 0.35792359709739685, -0.4505194425582886, -0.013265695422887802, 0.13641886413097382, -0.12639059126377106, -0.017774077132344246, 0.18920475244522095, -0.3275062143802643, 0.09581232070922852, -0.0887514054775238, 0.02141459286212921, 0.19795727729797363, 0.3150404095649719, 0.22969156503677368, -0.12766270339488983, -0.04822658747434616, -0.1154843121767044, -0.38965195417404175, 0.1797337532043457, 0.027929846197366714, 0.297341912984848, -0.13719700276851654, 0.004535086452960968, -0.0050676241517066956, 0.039149753749370575, 0.3277903199195862, -0.29538294672966003, 0.21122780442237854, 0.5430046319961548, -0.11194871366024017, -0.12104757130146027, 0.3094499409198761, 0.28201115131378174, 0.17428690195083618, -0.43344926834106445, 0.08311690390110016, 0.02411283552646637, -0.04253655672073364, 0.05504763871431351, -0.1876617968082428, 0.09958179295063019, 0.3957401514053345, 0.5032948851585388, -0.054021205753088, -0.12723925709724426, -0.08461970090866089, -0.22030285000801086, 0.03700222820043564, 0.10693216323852539, 0.08689258992671967, 0.13424035906791687, 0.04218180477619171, -0.15508562326431274, -0.4735404849052429, -0.17773737013339996, -0.41102904081344604, -0.0055255405604839325, -0.27977925539016724, 0.08250901103019714, -0.28864386677742004, -0.385520339012146, -0.004254072904586792, 0.008735567331314087, 0.14912275969982147, 0.5093882083892822, 0.014836754649877548, 0.12207332998514175, -0.42419418692588806, 0.11620598286390305, 0.27603766322135925, -0.19413144886493683, -0.08416876196861267, 0.3164278268814087, 0.2515391707420349, 0.17393015325069427, -0.06745480746030807, -0.26483356952667236, 0.046814948320388794, 0.3666107654571533, 0.014451216906309128, 0.0841945931315422, -0.02471194788813591, -0.28117841482162476, 0.22018226981163025, -0.16245675086975098, 0.34270498156547546, 0.09124213457107544, 0.050554245710372925, -0.4424770772457123, -0.20451214909553528 ]
https://github.com/huggingface/datasets/issues/5864
I am highly interested performance of dataset so I ran your example as a curious user. ```python train_dataset.cast_column("x", Array3D(shape=img_shape, dtype="float32")) ``` have return values and "x" is a new column, it shoulde be ```python ds=train_dataset.cast_column("img", Array3D(shape=(3,32,32), dtype="float32")) ``` I rewrite your example as ```python train_dataset = load_dataset( 'cifar100', split='train', use_auth_token=True, ) transform_func = torchvision.transforms.Compose([ ToTensor(), Normalize(mean=[0.485, 0.456, 0.406], std= [0.229, 0.224, 0.225]),] ) train_dataset = train_dataset.map( desc=f"Preprocessing samples", function=lambda x: {"img": transform_func(x["img"])}, ) ds=train_dataset.cast_column("img", Array3D(shape=(3,32,32), dtype="float32")) for i in tqdm(ds): pass ``` that require ~11s in my environment. While ```python ds = load_dataset( 'cifar100', split='train', use_auth_token=True, ) for i in tqdm(ds): pass ``` only need ~6s. (So I guess it's still undesirable)
Slow iteration over Torch tensors
### Describe the bug I have a problem related to this [issue](https://github.com/huggingface/datasets/issues/5841): I get a way slower iteration when using a Torch dataloader if I use vanilla Numpy tensors or if I first apply a ToTensor transform to the input. In particular, it takes 5 seconds to iterate over the vanilla input and ~30s after the transformation. ### Steps to reproduce the bug Here is the minimum code to reproduce the problem ```python import numpy as np from datasets import Dataset, DatasetDict, load_dataset, Array3D, Image, Features from torch.utils.data import DataLoader from tqdm import tqdm import torchvision from torchvision.transforms import ToTensor, Normalize ################################# # Without transform ################################# train_dataset = load_dataset( 'cifar100', split='train', use_auth_token=True, ) train_dataset.set_format(type="numpy", columns=["img", "fine_label"]) train_loader= DataLoader( train_dataset, batch_size=100, pin_memory=False, shuffle=True, num_workers=8, ) for batch in tqdm(train_loader, desc="Loading data, no transform"): pass ################################# # With transform ################################# transform_func = torchvision.transforms.Compose([ ToTensor(), Normalize(mean=[0.485, 0.456, 0.406], std= [0.229, 0.224, 0.225]),] ) train_dataset = train_dataset.map( desc=f"Preprocessing samples", function=lambda x: {"img": transform_func(x["img"])}, ) train_dataset.set_format(type="numpy", columns=["img", "fine_label"]) train_loader= DataLoader( train_dataset, batch_size=100, pin_memory=False, shuffle=True, num_workers=8, ) for batch in tqdm(train_loader, desc="Loading data after transform"): pass ``` I have also tried converting the Image column to an Array3D ```python img_shape = train_dataset[0]["img"].shape features = train_dataset.features.copy() features["x"] = Array3D(shape=img_shape, dtype="float32") train_dataset = train_dataset.map( desc=f"Preprocessing samples", function=lambda x: {"x": np.array(x["img"], dtype=np.uint8)}, features=features, ) train_dataset.cast_column("x", Array3D(shape=img_shape, dtype="float32")) train_dataset.set_format(type="numpy", columns=["x", "fine_label"]) ``` but to no avail. Any clue? ### Expected behavior The iteration should take approximately the same time with or without the transformation, as it doesn't change the shape of the input. What may be the issue here? ### Environment info ``` - `datasets` version: 2.12.0 - Platform: Linux-5.4.0-137-generic-x86_64-with-glibc2.31 - Python version: 3.9.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.1 ```
112
Slow iteration over Torch tensors ### Describe the bug I have a problem related to this [issue](https://github.com/huggingface/datasets/issues/5841): I get a way slower iteration when using a Torch dataloader if I use vanilla Numpy tensors or if I first apply a ToTensor transform to the input. In particular, it takes 5 seconds to iterate over the vanilla input and ~30s after the transformation. ### Steps to reproduce the bug Here is the minimum code to reproduce the problem ```python import numpy as np from datasets import Dataset, DatasetDict, load_dataset, Array3D, Image, Features from torch.utils.data import DataLoader from tqdm import tqdm import torchvision from torchvision.transforms import ToTensor, Normalize ################################# # Without transform ################################# train_dataset = load_dataset( 'cifar100', split='train', use_auth_token=True, ) train_dataset.set_format(type="numpy", columns=["img", "fine_label"]) train_loader= DataLoader( train_dataset, batch_size=100, pin_memory=False, shuffle=True, num_workers=8, ) for batch in tqdm(train_loader, desc="Loading data, no transform"): pass ################################# # With transform ################################# transform_func = torchvision.transforms.Compose([ ToTensor(), Normalize(mean=[0.485, 0.456, 0.406], std= [0.229, 0.224, 0.225]),] ) train_dataset = train_dataset.map( desc=f"Preprocessing samples", function=lambda x: {"img": transform_func(x["img"])}, ) train_dataset.set_format(type="numpy", columns=["img", "fine_label"]) train_loader= DataLoader( train_dataset, batch_size=100, pin_memory=False, shuffle=True, num_workers=8, ) for batch in tqdm(train_loader, desc="Loading data after transform"): pass ``` I have also tried converting the Image column to an Array3D ```python img_shape = train_dataset[0]["img"].shape features = train_dataset.features.copy() features["x"] = Array3D(shape=img_shape, dtype="float32") train_dataset = train_dataset.map( desc=f"Preprocessing samples", function=lambda x: {"x": np.array(x["img"], dtype=np.uint8)}, features=features, ) train_dataset.cast_column("x", Array3D(shape=img_shape, dtype="float32")) train_dataset.set_format(type="numpy", columns=["x", "fine_label"]) ``` but to no avail. Any clue? ### Expected behavior The iteration should take approximately the same time with or without the transformation, as it doesn't change the shape of the input. What may be the issue here? ### Environment info ``` - `datasets` version: 2.12.0 - Platform: Linux-5.4.0-137-generic-x86_64-with-glibc2.31 - Python version: 3.9.16 - Huggingface_hub version: 0.14.1 - PyArrow version: 12.0.0 - Pandas version: 2.0.1 ``` I am highly interested performance of dataset so I ran your example as a curious user. ```python train_dataset.cast_column("x", Array3D(shape=img_shape, dtype="float32")) ``` have return values and "x" is a new column, it shoulde be ```python ds=train_dataset.cast_column("img", Array3D(shape=(3,32,32), dtype="float32")) ``` I rewrite your example as ```python train_dataset = load_dataset( 'cifar100', split='train', use_auth_token=True, ) transform_func = torchvision.transforms.Compose([ ToTensor(), Normalize(mean=[0.485, 0.456, 0.406], std= [0.229, 0.224, 0.225]),] ) train_dataset = train_dataset.map( desc=f"Preprocessing samples", function=lambda x: {"img": transform_func(x["img"])}, ) ds=train_dataset.cast_column("img", Array3D(shape=(3,32,32), dtype="float32")) for i in tqdm(ds): pass ``` that require ~11s in my environment. While ```python ds = load_dataset( 'cifar100', split='train', use_auth_token=True, ) for i in tqdm(ds): pass ``` only need ~6s. (So I guess it's still undesirable)
[ -0.2172592431306839, -0.6703982353210449, -0.03890440985560417, 0.3632587790489197, 0.2197183072566986, -0.024108730256557465, 0.47505125403404236, 0.32326722145080566, -0.01830008625984192, 0.4166612923145294, -0.08816803991794586, 0.4426257610321045, -0.222381591796875, -0.47148168087005615, -0.2631922662258148, -0.2749485671520233, 0.06977224349975586, -0.010152556002140045, -0.42948925495147705, -0.07743841409683228, -0.03971443325281143, -0.08392190933227539, 0.010313183069229126, -0.2751256227493286, -0.14758533239364624, 0.10948262363672256, 0.2474212348461151, 0.03507677838206291, 0.22759172320365906, -0.27340996265411377, 0.14386630058288574, -0.07681365311145782, 0.12853986024856567, 0.6817136406898499, -0.00011754581646528095, 0.17028751969337463, 0.19992414116859436, 0.23766079545021057, 0.04135461524128914, 0.30036452412605286, 0.7184193730354309, -0.18509195744991302, 0.06796304881572723, 0.024290278553962708, -0.0741623044013977, 0.28171253204345703, -0.025554120540618896, -0.2943766415119171, 0.04105459526181221, -0.10646684467792511, 0.11276288330554962, 0.5683965682983398, -0.525982141494751, 0.23555384576320648, 0.031079327687621117, 0.103505440056324, -0.24802646040916443, 0.03273924067616463, 0.6074033379554749, 0.08306854218244553, -0.41797468066215515, 0.6569870710372925, -0.052720069885253906, 0.14537008106708527, 0.23197729885578156, -0.02386205643415451, -0.01907433569431305, -0.23385483026504517, -0.17766311764717102, 0.4017179608345032, 0.026050597429275513, 0.02669110894203186, -0.11831922084093094, -0.14234019815921783, -0.20058774948120117, -0.17913024127483368, 0.12943723797798157, -0.24490976333618164, -0.20888039469718933, -0.16193677484989166, -0.23650209605693817, 0.17656604945659637, 0.020049743354320526, -0.00039955414831638336, -0.136063814163208, -0.16293197870254517, 0.137843519449234, -0.0206044502556324, 0.2956618666648865, -0.2983071804046631, 0.4068492650985718, -0.05708165466785431, 0.2548229992389679, 0.13265961408615112, -0.6263139247894287, -0.1951846033334732, 0.09030263125896454, -0.1946541965007782, -0.12678219377994537, -0.21637029945850372, 0.22479873895645142, 0.29669493436813354, -0.18883417546749115, -0.11721022427082062, -0.07325635105371475, 0.09417987614870071, -0.21583881974220276, -0.03684135898947716, 0.33771392703056335, -0.032856911420822144, 0.1719656139612198, 0.20229656994342804, 0.047704100608825684, -0.2760191559791565, 0.05176334083080292, 0.03624283894896507, 0.26691800355911255, 0.18261702358722687, -0.28205201029777527, -0.037657249718904495, -0.18431814014911652, 0.043346766382455826, 0.17081743478775024, 0.17431147396564484, -0.31709209084510803, 0.5787596702575684, 0.24668674170970917, -0.21478740870952606, -0.2928334176540375, -0.1434219777584076, -0.1274719089269638, -0.11818257719278336, -0.09909138083457947, 0.22093649208545685, 0.2046838104724884, -0.35806843638420105, -0.09427553415298462, 0.3363479673862457, 0.21019767224788666, 0.2461337149143219, 0.11533532291650772, -0.01571599394083023, 0.20131263136863708, -0.10021717101335526, -0.14357519149780273, 0.15635095536708832, -0.04319961741566658, 0.5250433683395386, -0.12272410094738007, 0.061201274394989014, -0.43730515241622925, -0.26552683115005493, 0.03900659829378128, 0.11217981576919556, -0.06505686044692993, 0.10428225994110107, -0.046093035489320755, 0.16084837913513184, 0.3008938431739807, 0.04189911484718323, 0.15198317170143127, -0.402599960565567, -0.298147976398468, 0.012439962476491928, 0.06592726707458496, 0.24110670387744904, 0.033942773938179016, -0.03209301084280014, 0.27943912148475647, 0.30715352296829224, 0.33316197991371155, 0.4975742995738983, -0.235093355178833, 0.23801009356975555, -0.33135920763015747, -0.1905766725540161, 0.18461009860038757, -0.32684049010276794, -0.2907416820526123, 0.11484959721565247, -0.2595091462135315, 0.30582544207572937, 0.15764117240905762, 0.40322408080101013, 0.04357553645968437, -0.21622656285762787, 0.19752870500087738, 0.32640841603279114, 0.08436257392168045, 0.26931506395339966, -0.3828407824039459, 0.025156110525131226, 0.4593278765678406, 0.31461024284362793, -0.16063591837882996, -0.1266108751296997, -0.3607232868671417, 0.10841216146945953, 0.19582362473011017, -0.4012359380722046, -0.1707121580839157, 0.20714709162712097, -0.2934894263744354, -0.1992357224225998, 0.0998949259519577, 0.012171395123004913, -0.30996042490005493, 0.32410335540771484, 0.013527333736419678, 0.2919454872608185, 0.3489961624145508, 0.040328435599803925, 0.24619513750076294, -0.08457813411951065, -0.31621068716049194, -0.02429267391562462, -0.019818272441625595, 0.11637193709611893, -0.08800552785396576, -0.30365610122680664, 0.09658379852771759, 0.12300632148981094, -0.20772139728069305, -0.016215309500694275, -0.7261638641357422, 0.14269807934761047, 0.15824519097805023, -0.08728772401809692, -0.16623961925506592, -0.0056541673839092255, 0.09789372980594635, -0.32100293040275574, -0.15817700326442719, 0.10014752298593521, -0.1287958174943924, 0.2359571009874344, -0.21595919132232666, 0.21889162063598633, 0.2801160514354706, -0.37936532497406006, 0.23832644522190094, 0.46105021238327026, 0.0075361765921115875, -0.26588040590286255, 0.11647692322731018, 0.46206220984458923, -0.0338500440120697, 0.4254031479358673, -0.34289881587028503, -0.15476542711257935, -0.11678679287433624, 0.09539966285228729, -0.1703682243824005, 0.24088063836097717, 0.523466169834137, 0.18390491604804993, 0.1204594224691391, 0.054494649171829224, -0.38014936447143555, 0.1606922745704651, 0.12678714096546173, 0.07899324595928192, -0.4332927465438843, 0.17556479573249817, -0.23193767666816711, 0.03951391577720642, -0.01706524007022381, -0.5379690527915955, 0.39999791979789734, 0.051257647573947906, 0.04043005034327507, 0.04848642647266388, 0.1595025509595871, -0.20331189036369324, 0.053020916879177094, 0.06007680669426918, 0.010526612401008606, 0.11069539189338684, 0.4257391691207886, 0.18458929657936096, -0.23968356847763062, -0.0986710786819458, -0.25304004549980164, 0.1350952535867691, -0.15215474367141724, 0.37120532989501953, -0.05772680789232254, 0.006094545125961304, -0.16682593524456024, -0.12216830253601074, -0.15233606100082397, -0.1150209829211235, -0.08978203684091568, 0.3479085862636566, -0.018797583878040314, 0.27246636152267456, 0.29941388964653015, -0.0012058913707733154, 0.52302086353302, -0.2255333811044693, -0.3743512034416199, 0.03333831951022148, -0.13107769191265106, -0.08139963448047638, 0.03588228300213814, -0.5600679516792297, 0.22343839704990387, -0.27005189657211304, -0.09026756882667542, -0.23565475642681122, -0.3856087327003479, 0.07221189886331558, -0.15062390267848969, -0.2653859555721283, 0.14651355147361755, 0.09884120523929596, 0.22666671872138977, -0.15321862697601318, 0.12661288678646088, -0.08687155693769455, -0.12912458181381226, 0.31160420179367065, -0.08236712962388992, 0.1240958422422409, 0.02579084038734436, -0.25607097148895264, 0.1287979632616043, -0.15140944719314575, 0.08017542958259583, -0.1888241469860077, 0.11888675391674042, 0.2816759943962097, -0.0660562813282013, -0.0507713183760643, 0.2385740727186203, 0.17278113961219788, -0.16244877874851227, -0.35820019245147705, 0.46939581632614136, -0.009503491222858429, -0.14590950310230255, -0.32053783535957336, -0.19848108291625977, 0.036348987370729446, 0.38387107849121094, -0.3808496594429016, -0.1382967233657837, -0.45508337020874023, 0.4578853249549866, -0.40943214297294617, 0.1253361999988556, 0.3235281705856323, 0.07371250540018082, 0.03668965771794319, 0.12334735691547394, -0.1335453987121582, -0.2548055350780487, -0.046154849231243134, 0.27072107791900635, 0.022773776203393936, 0.26727569103240967, 0.2664189338684082, 0.7184383869171143, 0.02530481666326523, -0.5957586169242859, -0.1658054143190384, -0.07414611428976059, 0.08027991652488708, -0.023658674210309982, -0.4034433960914612, 0.00906592607498169, -0.13030023872852325, 0.05817480385303497, 0.016900617629289627, -0.18607495725154877, -0.04130582883954048, -0.006685726344585419, 0.22032567858695984, 0.21179485321044922, -0.15400923788547516, 0.22144968807697296, -0.5282467007637024, 0.1742950826883316, 0.033630356192588806, 0.5178546905517578, -0.3779647648334503, -0.23885606229305267, 0.44070199131965637, -0.04871099069714546, 0.18156808614730835, -0.290789932012558, -0.10827639698982239, 0.277180016040802, -0.5345134139060974, 0.30371224880218506, 0.2509728968143463, 0.35030609369277954, 0.29220354557037354, -0.26379090547561646, 0.17943941056728363, 0.02629077062010765, 0.4506300687789917, 0.041663847863674164, -0.037853434681892395, -0.030870992690324783, -0.6063085794448853, -0.5848591923713684, -0.11617925763130188, -0.09006836265325546, 0.16110801696777344, 0.481783002614975, 0.5256115198135376, 0.018521249294281006, -0.3469820022583008, 0.13449552655220032, 0.22060328722000122, -0.10321866720914841, -0.10192348062992096, -0.09391958266496658, -0.19275730848312378, 0.21783262491226196, -0.006903018802404404, -0.15519891679286957, 0.2110511213541031, 0.08832316845655441, -0.08708435297012329, -0.1447165161371231, -0.005819074809551239, 0.290277361869812, 0.049853794276714325, 0.04461449384689331, 0.043425362557172775, 0.5429047346115112, 0.0008829561993479729, 0.13932067155838013, 0.04766206443309784, 0.22706857323646545, -0.015920864418148994, -0.546044647693634, 0.026412833482027054, 0.2057231068611145, -0.090474933385849, 0.5409645438194275, 0.0405617281794548, -0.02148142084479332, -0.3381315767765045, 0.1195635125041008, -0.21603575348854065, 0.4387962222099304, 0.35567235946655273, 0.1835082769393921, -0.1204364001750946, -0.09574156999588013, 0.1283245086669922, 0.24381032586097717, -0.045630134642124176, 0.5682005882263184, -0.444736123085022, -0.02809935435652733, -0.07868629693984985, 0.3410409986972809, 0.8773272037506104, -0.03267696499824524, 0.20035335421562195, 0.4711713492870331, 0.09464377164840698, 0.08285297453403473, -0.2733624577522278, 0.26535287499427795, -0.3229784071445465, -0.46463319659233093, 0.06550204008817673, -0.3201144337654114, -0.04047548398375511, -0.3498009741306305, 0.13632254302501678, 0.1068967804312706, 0.04175442457199097, 0.23645159602165222, -0.17218990623950958, -0.0065894052386283875, -0.042687252163887024, -0.4964289367198944, -0.020706089213490486, 0.024615533649921417, -0.027918647974729538, 0.36514580249786377, -0.0473436675965786, -0.13831296563148499, -0.13928861916065216, -0.15960972011089325, -0.154325932264328, 0.12835994362831116, -0.3886825442314148, -0.04742453992366791, 0.28313928842544556, -0.48706695437431335, 0.1699884682893753, 0.47755804657936096, 0.3437980115413666, -0.01992766745388508, -0.15459981560707092, 0.09967051446437836, -0.006265647709369659, 0.2099076807498932, 0.13297384977340698, -0.384097695350647, 0.21544741094112396, 0.08424051105976105, 0.1307005137205124, 0.04749611020088196, 0.10613326728343964, -0.07480795681476593, -0.13151058554649353, 0.29968976974487305, 0.06779228895902634, -0.2891256809234619, -0.020039234310388565, -0.008471854031085968, -0.12842302024364471, -0.11118942499160767, 0.08776391297578812, 0.08223177492618561, -0.31240200996398926, 0.25413748621940613, -0.0816352590918541, -0.2892187237739563, 0.11316172778606415, 0.639827311038971, 0.23008838295936584, -0.36912521719932556, 0.258147656917572, 0.28384488821029663, -0.38562339544296265, 0.006082504987716675, 0.27055907249450684, 0.3038511276245117, -0.49446773529052734, 0.20696473121643066, -0.2017015814781189, 0.010408177971839905, -0.06490413099527359, 0.22054119408130646, -0.3458295464515686, -0.1833006888628006, -0.32432955503463745, 0.292057067155838, -0.39693236351013184, -0.19724906980991364, 0.059841785579919815, 0.17512276768684387, -0.09890282899141312, 0.2154138684272766, -0.4489126205444336, 0.009601237252354622, -0.21107517182826996, -0.0071662552654743195, 0.22445793449878693, 0.10262909531593323, 0.12880301475524902, -0.24829590320587158, 0.031429845839738846, 0.04538163170218468, 0.015622381120920181, 0.32348430156707764, -0.2038799226284027, -0.1617901474237442, -0.033241838216781616, 0.14383865892887115, -0.1320447027683258, -0.4078744053840637, 0.07315534353256226, -0.05968819186091423, -0.044509612023830414, -0.3073447048664093, 0.1993907392024994, 0.28854191303253174, -0.07068685442209244, 0.145440936088562, 0.051827363669872284, 0.15090018510818481, 0.2724025845527649, 0.09103080630302429, -0.06435200572013855, 0.46861550211906433, 0.045735906809568405, -0.03621932119131088, -0.030475158244371414, -0.2458021342754364, -0.2613220512866974, 0.24786505103111267, 0.3081319332122803, -0.019958745688199997, 0.24459487199783325, -0.2992253303527832, -0.1774398684501648, 0.010438863188028336, 0.06260110437870026, 0.3150942623615265, -0.36747366189956665, -0.20755650103092194, -0.13201797008514404, 0.07406732439994812, 0.04817413538694382, -0.07556764781475067, -0.1057555228471756, 0.010139018297195435, 0.06418343633413315, 0.14077287912368774, -0.03719530254602432, 0.20468516647815704, 0.18030254542827606, -0.00021345913410186768, 0.0184895358979702, -0.22460107505321503, 0.009071826934814453, 0.2720983326435089, -0.0815790593624115, -0.060799796134233475, 0.29233500361442566, 0.06612420082092285, 0.0040295906364917755, 0.05721726268529892, 0.036970723420381546, 0.5384737849235535, 0.02339061349630356, 0.08381091058254242, -0.11056531220674515, -0.019180864095687866, -0.14463727176189423, -0.06015437841415405, 0.0018697716295719147, 0.15356867015361786, 0.143722802400589, 0.25306710600852966, -0.02859640121459961, -0.3530920147895813, -0.07812107354402542, 0.2697734236717224, -0.15650762617588043, -0.04508701711893082, 0.08366993069648743, 0.11031217873096466, 0.04481042921543121, 0.22604675590991974, -0.22437027096748352, 0.1164880245923996, 0.16209237277507782, 0.23491865396499634, -0.15015387535095215, -0.13443827629089355, -0.2543586790561676, 0.14492014050483704, 0.22319385409355164, 0.015159055590629578, 0.13330397009849548, 0.20338895916938782, 0.1005195900797844, -0.10598038136959076, 0.22930271923542023, 0.2107105702161789, 0.22245831787586212, -0.25633272528648376, 0.18319986760616302, -0.2625963091850281, -0.003031790256500244, 0.151223286986351, 0.19126948714256287, -0.32876119017601013, 0.16705486178398132, 0.1284976601600647, -0.03309040516614914, -0.18681782484054565, -0.05920056253671646, -0.34398913383483887, 0.09766992926597595, -0.14546291530132294, 0.09312191605567932, -0.13637736439704895, 0.018250420689582825, -0.2926597595214844, 0.00037705153226852417, -0.10390904545783997, -0.19479483366012573, 0.3684852123260498, -0.008267771452665329, -0.021440736949443817, 0.03652099892497063, 0.05067182704806328, -0.2529144585132599, 0.3965463936328888, 0.20801158249378204, 0.2517710328102112, -0.21955180168151855, -0.07868556678295135, -0.004285737872123718, 0.1996462047100067, -0.02690712921321392, -0.08679457753896713, 0.01157299429178238, 0.14509552717208862, 0.2866192162036896, 0.28378307819366455, 0.31461331248283386, -0.47049885988235474, 0.33068281412124634, 0.3299979865550995, -0.2692181468009949, -0.07818926870822906, -0.3733668625354767, -0.14048637449741364, 0.13952837884426117, -0.4431270360946655, 0.11192294955253601, 0.1702401340007782, 0.09032536298036575, -0.21160809695720673, -0.00882800668478012, -0.215834379196167, 0.44300931692123413, 0.4313766360282898, 0.23549409210681915, -0.08486045897006989, -0.11071838438510895, -0.05785122513771057, -0.14798858761787415, -0.2423737794160843, -0.07209040224552155, -0.017988640815019608, 0.03791116923093796, 0.09978948533535004, 0.0719839558005333, -0.45193636417388916, -0.27264899015426636, 0.4224066734313965, 0.27158015966415405, -0.32708117365837097, -0.2597113847732544, 0.26861414313316345, -0.2801516652107239, 0.39195120334625244, 0.03051166608929634, 0.39089182019233704, 0.31752628087997437, 0.2571510970592499, -0.40451642870903015, -0.36239832639694214, 0.694416880607605, -0.31010162830352783, -0.22477711737155914, -0.14208567142486572, -0.006562806665897369, 0.1269734799861908, 0.297087162733078, -0.5191027522087097, -0.10070978105068207, 0.0884866714477539, -0.24827134609222412, -0.1608656346797943, 0.301248162984848, 0.06640558689832687, 0.03272956609725952, -0.17902113497257233, 0.2588367462158203, 0.24566064774990082, 0.09201347082853317, -0.08447287976741791, -0.06162704899907112 ]
https://github.com/huggingface/datasets/issues/5862
This error is also raised when data is hosted on Google Drive: - https://huggingface.co/datasets/docred/discussions/5 - https://huggingface.co/datasets/linnaeus/discussions/3 - https://huggingface.co/datasets/poleval2019_mt/discussions/3 - https://huggingface.co/datasets/reddit_tifu/discussions/2 - https://huggingface.co/datasets/species_800/discussions/3 - https://huggingface.co/datasets/wiki_lingua/discussions/1 - https://huggingface.co/datasets/yoruba_text_c3/discussions/1
IndexError: list index out of range with data hosted on Zenodo
The dataset viewer sometimes raises an `IndexError`: ``` IndexError: list index out of range ``` See: - huggingface/datasets-server#1151 - https://huggingface.co/datasets/reddit/discussions/5 - huggingface/datasets-server#1118 - https://huggingface.co/datasets/krr-oxford/OntoLAMA/discussions/1 - https://huggingface.co/datasets/hyperpartisan_news_detection/discussions/3 - https://huggingface.co/datasets/um005/discussions/2 - https://huggingface.co/datasets/tapaco/discussions/2 - https://huggingface.co/datasets/common_language/discussions/3 - https://huggingface.co/datasets/pass/discussions/1 After investigation: - This happens with data files hosted on Zenodo - Indeed, there is an underlying 429 HTTP error: Too Many Requests Note that some time ago, it also happened with data files hosted on Google Drive. See: - #4581 - #4580 The reason then was that there was a 403 HTTP error: Forbidden
26
IndexError: list index out of range with data hosted on Zenodo The dataset viewer sometimes raises an `IndexError`: ``` IndexError: list index out of range ``` See: - huggingface/datasets-server#1151 - https://huggingface.co/datasets/reddit/discussions/5 - huggingface/datasets-server#1118 - https://huggingface.co/datasets/krr-oxford/OntoLAMA/discussions/1 - https://huggingface.co/datasets/hyperpartisan_news_detection/discussions/3 - https://huggingface.co/datasets/um005/discussions/2 - https://huggingface.co/datasets/tapaco/discussions/2 - https://huggingface.co/datasets/common_language/discussions/3 - https://huggingface.co/datasets/pass/discussions/1 After investigation: - This happens with data files hosted on Zenodo - Indeed, there is an underlying 429 HTTP error: Too Many Requests Note that some time ago, it also happened with data files hosted on Google Drive. See: - #4581 - #4580 The reason then was that there was a 403 HTTP error: Forbidden This error is also raised when data is hosted on Google Drive: - https://huggingface.co/datasets/docred/discussions/5 - https://huggingface.co/datasets/linnaeus/discussions/3 - https://huggingface.co/datasets/poleval2019_mt/discussions/3 - https://huggingface.co/datasets/reddit_tifu/discussions/2 - https://huggingface.co/datasets/species_800/discussions/3 - https://huggingface.co/datasets/wiki_lingua/discussions/1 - https://huggingface.co/datasets/yoruba_text_c3/discussions/1
[ -0.15684950351715088, 0.01811794936656952, -0.13773664832115173, 0.5326906442642212, 0.08840986341238022, 0.08455762267112732, 0.32124248147010803, 0.3956218361854553, 0.16981171071529388, 0.20749667286872864, -0.5241460204124451, -0.32136598229408264, 0.16142502427101135, -0.04245036095380783, -0.20137792825698853, -0.18913909792900085, -0.10754458606243134, 0.04888419806957245, -0.4246980547904968, -0.03592144697904587, -0.08856688439846039, -0.04850946366786957, -0.18207944929599762, 0.12184812873601913, 0.14050568640232086, -0.13132373988628387, -0.06422224640846252, 0.2944149672985077, -0.09805487841367722, -0.49142593145370483, 0.08751262724399567, -0.07997055351734161, 0.13328179717063904, 0.5924326181411743, -0.00010998969082720578, 0.1768566370010376, 0.07309262454509735, 0.14544591307640076, -0.08481971174478531, -0.037415437400341034, -0.1965225785970688, -0.2936282157897949, 0.02282130718231201, -0.10881828516721725, 0.029608987271785736, -0.3783597946166992, -0.01903226226568222, -0.15472905337810516, 0.14679306745529175, 0.4982932209968567, 0.16929306089878082, 0.3846288323402405, 0.14821963012218475, -0.06535378098487854, 0.3142372965812683, -0.30591797828674316, -0.11154988408088684, 0.11655329912900925, 0.22616800665855408, 0.27064788341522217, -0.32992634177207947, 0.28551408648490906, 0.018877685070037842, 0.04470605030655861, -0.1886337697505951, -0.24386142194271088, -0.20230433344841003, -0.34990131855010986, -0.005245646461844444, 0.3687404692173004, 0.5947949886322021, 0.05329000949859619, -0.280123770236969, -0.34893932938575745, -0.008798129856586456, 0.04973210394382477, 0.21642769873142242, 0.006742469966411591, 0.04481159895658493, 0.26225677132606506, -0.07419197261333466, -0.07431753724813461, -0.1441909521818161, 0.14320719242095947, -0.18548879027366638, 0.17567908763885498, -0.1293511837720871, 0.10816293954849243, 0.403113454580307, -0.3929500877857208, 0.10675374418497086, -0.15369975566864014, -0.291817307472229, 0.013123482465744019, -0.43651556968688965, -0.22647154331207275, 0.21794144809246063, 0.17823907732963562, 0.27128300070762634, 0.4230916202068329, 0.4959128201007843, 0.06266622990369797, -0.048204224556684494, -0.08103804290294647, 0.5467642545700073, 0.035866349935531616, 0.08166870474815369, -0.2420549988746643, 0.4812118709087372, 0.12078777700662613, 0.07046716660261154, 0.016557522118091583, 0.1028548926115036, -0.2615039050579071, -0.13299068808555603, -0.30490460991859436, 0.3541553318500519, -0.16266798973083496, -0.3679090738296509, 0.19024677574634552, -0.4376930296421051, -0.19788119196891785, 0.3563733994960785, 0.35898759961128235, 0.12052755057811737, 0.06526610255241394, -0.34106141328811646, 0.12990157306194305, -0.04292628914117813, -0.3345296084880829, -0.15024398267269135, -0.13247741758823395, 0.29687678813934326, 0.19539332389831543, 0.06963236629962921, -0.4548739194869995, 0.20155316591262817, 0.004943337291479111, 0.2766851484775543, -0.300448477268219, 0.16521835327148438, -0.23898760974407196, 0.1299305260181427, 0.35106807947158813, 0.26638105511665344, -0.014085888862609863, 0.3262045383453369, 0.2167789340019226, -0.16299979388713837, 0.029250551015138626, -0.21537786722183228, -0.4675397276878357, -0.005694851279258728, 0.12387687712907791, 0.003792576491832733, 0.1418962925672531, 0.08363664150238037, -0.017972560599446297, -0.03343059495091438, -0.1920831799507141, 0.07778435200452805, -0.1119953989982605, -0.025086574256420135, 0.13062483072280884, -0.1863865852355957, 0.3200475871562958, 0.21998019516468048, 0.22477908432483673, -0.07655686885118484, 0.030954334884881973, -0.39527490735054016, 0.4721421003341675, -0.4402405619621277, 0.32570409774780273, -0.26955825090408325, 0.16671212017536163, 0.3301237225532532, -0.3199295103549957, -0.5418851971626282, 0.1815597414970398, -0.11972443759441376, 0.0016480758786201477, 0.08003178238868713, -0.006557431071996689, 0.25468698143959045, -0.10321377217769623, -0.03132525086402893, 0.12823809683322906, 0.15025989711284637, -0.015859335660934448, -0.0010371729731559753, 0.0888902023434639, -0.16362763941287994, 0.0999336689710617, -0.12563665211200714, -0.14152929186820984, 0.40787050127983093, -0.03785158693790436, 0.06201561167836189, -0.19520679116249084, -0.10942181199789047, 0.5847495794296265, -0.0025769653730094433, 0.12973998486995697, 0.06790930032730103, -0.15337298810482025, -0.11204880475997925, 0.00812007486820221, 0.13362745940685272, 0.1345827579498291, 0.0575716607272625, 0.0763423889875412, -0.09451453387737274, 0.07419142872095108, -0.3305443227291107, 0.08883927762508392, 0.14082007110118866, 0.11616487801074982, 0.00458700954914093, -0.005201518535614014, 0.05231499671936035, -0.11305371671915054, 0.009058229625225067, 0.21701012551784515, -0.3859714865684509, 0.2719762325286865, -0.1327424794435501, -0.00605703704059124, 0.009429343044757843, -0.10680356621742249, 0.18713130056858063, -0.166682168841362, 0.034235820174217224, 0.23101955652236938, 0.12003440409898758, 0.03669814020395279, 0.4947025179862976, 0.2553814649581909, 0.3669993579387665, -0.28106689453125, 0.11889062076807022, 0.15924666821956635, -0.0070603638887405396, 0.040527187287807465, 0.031206665560603142, 0.24775032699108124, -0.27440372109413147, 0.27724045515060425, -0.08431005477905273, -0.031944096088409424, 0.544182300567627, 0.15069514513015747, -0.07081194221973419, -0.10242658853530884, 0.35717010498046875, 0.27984878420829773, 0.355413556098938, 0.1420140117406845, -0.32679829001426697, 0.005862638354301453, -0.027120618149638176, -0.2469220608472824, 0.23179779946804047, 0.17184239625930786, -0.009413100779056549, -0.06752052903175354, 0.15476928651332855, -0.08565165847539902, 0.28338852524757385, 0.25097906589508057, -0.021834883838891983, -0.10056158155202866, 0.18116267025470734, -0.36455726623535156, 0.23645395040512085, 0.19628705084323883, 0.3348599970340729, 0.2898979187011719, 0.19322596490383148, -0.16899102926254272, -0.4568697214126587, -0.4913124144077301, 0.06463827192783356, 0.211803138256073, -0.2244872748851776, -0.11536294221878052, -0.10718633234500885, -0.03171730414032936, 0.02589118480682373, -0.2581931948661804, -0.5445266962051392, -0.35284224152565, 0.015364766120910645, 0.47942641377449036, -0.36847925186157227, -0.052660923451185226, -0.4019046127796173, 0.19215847551822662, 0.3549657166004181, 0.15835818648338318, 0.1823100596666336, -0.027055375277996063, 0.09992578625679016, 0.0038576126098632812, 0.3326663672924042, -0.10257506370544434, 0.07480777055025101, -0.12928086519241333, 0.17806102335453033, -0.6514831185340881, -0.15661825239658356, 0.2847549319267273, -0.07532462477684021, 0.13381662964820862, -0.0705074667930603, 0.28868165612220764, -0.038161154836416245, 0.052218370139598846, 0.12692700326442719, 0.2310393899679184, -0.01702040433883667, 0.1390172243118286, 0.017725348472595215, 0.31830817461013794, 0.30437400937080383, -0.09619496017694473, -0.04459713399410248, -0.40265989303588867, 0.22553390264511108, -0.11568640172481537, 0.35858380794525146, 0.2043229639530182, 0.005900949239730835, 0.1828421652317047, -0.20512239634990692, 0.03541094809770584, -0.19071133434772491, -0.31332987546920776, 0.30549156665802, -0.283365398645401, -0.29801106452941895, -0.1287824660539627, 0.22514764964580536, 0.028684675693511963, -0.044674620032310486, -0.5617801547050476, -0.04096434265375137, -0.30700546503067017, 0.39099833369255066, -0.18560276925563812, -0.17568063735961914, 0.5827440023422241, -0.018954461440443993, -0.1713864654302597, 0.020652778446674347, 0.13975666463375092, 0.016808463260531425, 0.012293364852666855, -0.05235490947961807, 0.12812021374702454, 0.3046327829360962, -0.06655915081501007, 0.542262613773346, 0.22094115614891052, 0.25927630066871643, 0.510741114616394, 0.06238657981157303, 0.5833326578140259, 0.009595414623618126, -0.2003309428691864, -0.10927379876375198, 0.06569881737232208, -0.25746577978134155, 0.4482598304748535, 0.22536182403564453, 0.15080532431602478, -0.3010801374912262, -0.5509858131408691, -0.0197867751121521, -0.21392828226089478, 0.08451063185930252, 0.04332021251320839, 0.05608952045440674, 0.01665688306093216, 0.13451650738716125, -0.09727592766284943, -0.2670740485191345, -0.13122710585594177, -0.09356465190649033, 0.154424250125885, -0.18584778904914856, -0.06844894587993622, -0.041041649878025055, -0.5552438497543335, 0.31528618931770325, 0.2961459755897522, 0.2583995759487152, -0.09219300746917725, -0.07409025728702545, 0.09000325947999954, 0.07824280858039856, 0.44329503178596497, -0.012426164932549, 0.20484520494937897, -0.22243919968605042, -0.1736522912979126, -0.19322754442691803, 0.09404899924993515, -0.3215196132659912, 0.2021600604057312, 0.17793239653110504, 0.7074938416481018, -0.08161483705043793, -0.16636548936367035, -0.003420194610953331, -0.010038312524557114, -0.15504074096679688, -0.15677931904792786, -0.06453053653240204, -0.4165980815887451, -0.20700936019420624, 0.04116642102599144, 0.04436054080724716, 0.07113482058048248, -0.08304294943809509, -0.1626276969909668, 0.1740129142999649, -0.1403205543756485, -0.1977824717760086, 0.04363188520073891, 0.0985027626156807, 0.01576383039355278, 0.134321928024292, 0.3008660078048706, 0.12343145906925201, 0.742605984210968, 0.5864458084106445, 0.26916247606277466, -0.18892879784107208, -0.05157030373811722, -0.014557227492332458, -0.12302233278751373, 0.29332688450813293, 0.3067415952682495, -0.0015981905162334442, 0.0303579680621624, 0.36637935042381287, -0.16572868824005127, -0.18878769874572754, 0.3822695016860962, 0.057124607264995575, -0.26689496636390686, 0.14077088236808777, 0.34870561957359314, -0.16847406327724457, -0.1646335870027542, 0.44589751958847046, 0.3294132351875305, -0.2872564494609833, -0.01127670332789421, 0.2443961352109909, 0.8162931203842163, -0.3420875072479248, 0.1353989690542221, 0.21497046947479248, -0.05321536585688591, 0.4131881594657898, 0.026627443730831146, 0.2331344187259674, -0.0976070687174797, -0.67018723487854, -0.02844582498073578, -0.0951353907585144, 0.31530869007110596, -0.18086344003677368, -0.08775479346513748, 0.06103259697556496, -0.13382484018802643, 0.2739099860191345, -0.08110891282558441, 0.13174068927764893, -0.35021501779556274, -0.09349742531776428, -0.47060054540634155, 0.12352431565523148, -0.09747591614723206, 0.002860059030354023, -0.03575221449136734, -0.15327514708042145, -0.10109908878803253, -0.01301952451467514, -0.09572412073612213, 0.06626762449741364, 0.23298384249210358, 0.2267480492591858, -0.24844598770141602, -0.3381464183330536, -0.06775201857089996, 0.31620335578918457, -0.24320386350154877, -0.04118536040186882, -0.3207909166812897, 0.1388317346572876, -0.1764945238828659, -0.0586712621152401, -0.020493019372224808, 0.05184902995824814, 0.16546744108200073, -0.06036388874053955, -0.3875700533390045, 0.1019146591424942, 0.01599179580807686, -0.5343936681747437, -0.43565452098846436, 0.2920452356338501, -0.5630956292152405, -0.3843674659729004, 0.0328485406935215, -0.1643342822790146, -0.31681904196739197, -0.16272400319576263, 0.09307453036308289, -0.041066724807024, -0.17993678152561188, -0.18479348719120026, 0.19625821709632874, -0.42091017961502075, -0.1366245001554489, 0.49680936336517334, 0.1142663061618805, 0.2885468304157257, 0.42098698019981384, 0.2529855966567993, -0.2456338107585907, -0.15892675518989563, 0.4652562439441681, 0.25403541326522827, -0.016804933547973633, -0.016714369878172874, -0.4089760184288025, 0.12019887566566467, -0.24989517033100128, -0.03666800260543823, 0.21576668322086334, -0.03442562371492386, -0.2430872619152069, -0.33522868156433105, 0.06741364300251007, 0.16302910447120667, 0.04011184722185135, -0.02437020093202591, 0.008981578052043915, -0.10442670434713364, 0.011508136987686157, -0.2172781080007553, -0.2598370909690857, 0.0125000961124897, -0.2799016237258911, 0.046533823013305664, -0.11261752247810364, -0.1827206313610077, 0.1358068585395813, 0.07279031723737717, 0.02476079761981964, -0.11056847125291824, -0.19468429684638977, -0.1795971393585205, 0.2219637930393219, 0.12371139228343964, 0.15739648044109344, -0.42296701669692993, -0.17804118990898132, -0.36432355642318726, -0.08152405172586441, -0.3463587462902069, -0.21811741590499878, 0.22985205054283142, 0.11318549513816833, -0.508463442325592, 0.1054924800992012, -0.09122786670923233, -0.01497667282819748, 0.172489196062088, -0.09363387525081635, 0.365082323551178, -0.15519392490386963, 0.2846784293651581, -0.048284295946359634, -0.12735725939273834, -0.18707263469696045, 0.32300910353660583, 0.18044359982013702, -0.20434506237506866, 0.24878858029842377, -0.2784155011177063, -0.14655093848705292, 0.6824547052383423, 0.6706618070602417, 0.2766622006893158, -0.1580158770084381, -0.1299808770418167, -0.03121744655072689, 0.11575964093208313, -0.06877714395523071, -0.3228161931037903, 0.19451701641082764, -0.08736926317214966, 0.01510389894247055, 0.15597252547740936, 0.036001287400722504, -0.2513931393623352, 0.12418559938669205, 0.013833194971084595, 0.5177640318870544, 0.20453281700611115, -0.031283583492040634, 0.31722888350486755, -0.19454628229141235, -0.15615053474903107, 0.5297912359237671, 0.07542011141777039, 0.4630839228630066, 0.30473875999450684, -0.3535071015357971, 0.1821562498807907, 0.04341772198677063, 0.19441084563732147, 0.12458968162536621, -0.3770540952682495, 0.1884268820285797, 0.16860555112361908, 0.022419823333621025, -0.2161448746919632, -0.06236432120203972, 0.132766455411911, -0.24502485990524292, 0.0812743604183197, -0.42005786299705505, 0.2550698518753052, -0.18004439771175385, 0.2905287444591522, -0.09753772616386414, -0.22363750636577606, 0.1583315134048462, 0.15092630684375763, 0.025984402745962143, -0.2989127039909363, -0.013641297817230225, -0.04164690896868706, -0.3273939788341522, -0.5749644637107849, -0.039578378200531006, 0.046388011425733566, -0.13978685438632965, -0.37932997941970825, 0.26552724838256836, 0.37705153226852417, -0.16086013615131378, 0.19651080667972565, 0.3968215584754944, 0.26365208625793457, 0.06647387146949768, 0.17418794333934784, 0.21940279006958008, -0.23719975352287292, -0.13975679874420166, -0.1182558685541153, 0.03575572744011879, -0.1853933036327362, 0.26853126287460327, 0.2683646082878113, 0.11697695404291153, -0.10037101805210114, 0.10758350789546967, 0.269808828830719, 0.39629554748535156, -0.3428104519844055, -0.2703208029270172, -0.2537307143211365, -0.048342496156692505, 0.0961630791425705, -0.2927074134349823, -0.3093336224555969, 0.310410737991333, 0.3877270519733429, -0.28245270252227783, 0.10138612985610962, -0.029592936858534813, 0.06847630441188812, -0.02157796360552311, 0.39052441716194153, 0.2835017144680023, -0.09363746643066406, 0.09085005521774292, -0.07469597458839417, -0.40220877528190613, 0.39433062076568604, -0.3947218954563141, 0.04639628529548645, 0.1678493618965149, 0.048553287982940674, 0.026509180665016174, 0.2750941514968872, 0.5365505814552307, -0.22026976943016052, 0.15143804252147675, -0.04879307001829147, -0.22284242510795593, -0.10864636301994324, -0.004920778796076775, 0.2196299433708191, -0.3100276291370392, -0.15711510181427002, 0.6121636033058167, 0.07909174263477325, 0.12120363116264343, -0.0296791885048151, 0.2076461762189865, -0.2889142632484436, -0.42414242029190063, 0.17219413816928864, 0.28292179107666016, 0.2643512487411499, -0.04013870283961296, 0.07357306033372879, -0.05016477033495903, -0.23805640637874603, -0.21407823264598846, 0.2248190939426422, 0.19584771990776062, -0.07189787179231644, -0.32495978474617004, -0.576181948184967, -0.08110311627388, 0.6280639171600342, -0.07470262050628662, 0.32867634296417236, -0.07955481112003326, -0.15572887659072876, -0.09523941576480865, -0.32270678877830505, 0.030432306230068207, -0.01489967480301857, 0.26072293519973755, -0.09262959659099579, 0.020384132862091064, -0.21166148781776428, 0.372104287147522, -0.6273751854896545, -0.07551118731498718, -0.029255762696266174, 0.1706160008907318, 0.19000282883644104, -0.2512112557888031, 0.009477704763412476, 0.18444225192070007, 0.256229966878891, 0.11544731259346008, -0.23832541704177856, -0.11590753495693207, -0.1506078988313675, -0.2558238208293915, -0.0551191121339798, 0.07172410190105438, 0.23281383514404297, -0.2921008765697479, 0.10729309916496277, 0.12007791548967361 ]
https://github.com/huggingface/datasets/issues/5858
Thanks for reporting, @sarahwie. Please note that in `datasets` we do not have vectorized operation like `pandas`. Therefore, your equality comparisons above are `False`: - For example: `squad['question']` returns a `list`, and this list is not equal to `"Who was the Norse leader?"` The `False` value is equivalent to `0` when indexing a dataset, thus the reason why you get the first element (with index 0): - For example: `squad[False]` is equivalent to `squad[0]` Maybe we should an exception instead of assuming that `False` is equivalent to `0` (and `True` is equivalent to `1`) in the context of indexing.
Throw an error when dataset improperly indexed
### Describe the bug Pandas-style subset indexing on dataset does not throw an error, when maybe it should. Instead returns the first instance of the dataset regardless of index condition. ### Steps to reproduce the bug Steps to reproduce the behavior: 1. `squad = datasets.load_dataset("squad_v2", split="validation")` 2. `item = squad[squad['question'] == "Who was the Norse leader?"]` or `it = squad[squad['id'] == '56ddde6b9a695914005b962b']` 3. returns the first item in the dataset, which does not satisfy the above conditions: `{'id': '56ddde6b9a695914005b9628', 'title': 'Normans', 'context': 'The Normans (Norman: Nourmands; French: Normands; Latin: Normanni) were the people who in the 10th and 11th centuries gave their name to Normandy, a region in France. They were descended from Norse ("Norman" comes from "Norseman") raiders and pirates from Denmark, Iceland and Norway who, under their leader Rollo, agreed to swear fealty to King Charles III of West Francia. Through generations of assimilation and mixing with the native Frankish and Roman-Gaulish populations, their descendants would gradually merge with the Carolingian-based cultures of West Francia. The distinct cultural and ethnic identity of the Normans emerged initially in the first half of the 10th century, and it continued to evolve over the succeeding centuries.', 'question': 'In what country is Normandy located?', 'answers': {'text': ['France', 'France', 'France', 'France'], 'answer_start': [159, 159, 159, 159]}}` ### Expected behavior Should either throw an error message, or return the dataset item that satisfies the condition. ### Environment info - `datasets` version: 2.9.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.10.8 - PyArrow version: 10.0.1 - Pandas version: 1.5.3
99
Throw an error when dataset improperly indexed ### Describe the bug Pandas-style subset indexing on dataset does not throw an error, when maybe it should. Instead returns the first instance of the dataset regardless of index condition. ### Steps to reproduce the bug Steps to reproduce the behavior: 1. `squad = datasets.load_dataset("squad_v2", split="validation")` 2. `item = squad[squad['question'] == "Who was the Norse leader?"]` or `it = squad[squad['id'] == '56ddde6b9a695914005b962b']` 3. returns the first item in the dataset, which does not satisfy the above conditions: `{'id': '56ddde6b9a695914005b9628', 'title': 'Normans', 'context': 'The Normans (Norman: Nourmands; French: Normands; Latin: Normanni) were the people who in the 10th and 11th centuries gave their name to Normandy, a region in France. They were descended from Norse ("Norman" comes from "Norseman") raiders and pirates from Denmark, Iceland and Norway who, under their leader Rollo, agreed to swear fealty to King Charles III of West Francia. Through generations of assimilation and mixing with the native Frankish and Roman-Gaulish populations, their descendants would gradually merge with the Carolingian-based cultures of West Francia. The distinct cultural and ethnic identity of the Normans emerged initially in the first half of the 10th century, and it continued to evolve over the succeeding centuries.', 'question': 'In what country is Normandy located?', 'answers': {'text': ['France', 'France', 'France', 'France'], 'answer_start': [159, 159, 159, 159]}}` ### Expected behavior Should either throw an error message, or return the dataset item that satisfies the condition. ### Environment info - `datasets` version: 2.9.0 - Platform: macOS-13.3.1-arm64-arm-64bit - Python version: 3.10.8 - PyArrow version: 10.0.1 - Pandas version: 1.5.3 Thanks for reporting, @sarahwie. Please note that in `datasets` we do not have vectorized operation like `pandas`. Therefore, your equality comparisons above are `False`: - For example: `squad['question']` returns a `list`, and this list is not equal to `"Who was the Norse leader?"` The `False` value is equivalent to `0` when indexing a dataset, thus the reason why you get the first element (with index 0): - For example: `squad[False]` is equivalent to `squad[0]` Maybe we should an exception instead of assuming that `False` is equivalent to `0` (and `True` is equivalent to `1`) in the context of indexing.
[ -0.1127646341919899, -0.029433786869049072, -0.032245755195617676, 0.3046644330024719, -0.01760469563305378, 0.198896586894989, 0.3279401659965515, 0.36500996351242065, 0.04006601870059967, 0.15649382770061493, -0.02362341806292534, 0.3770912289619446, 0.0017942748963832855, -0.18223139643669128, -0.04069487750530243, 0.14882029592990875, 0.17640861868858337, 0.03834398090839386, -0.0013692080974578857, -0.09006638079881668, -0.24756580591201782, -0.06640966236591339, -0.4892684817314148, 0.06929938495159149, -0.373688280582428, -0.12089953571557999, 0.03632073849439621, 0.17757755517959595, -0.13078320026397705, -0.4292360246181488, 0.49978044629096985, -0.36722084879875183, 0.18663078546524048, 0.4929872155189514, -0.0001154968558694236, -0.0382147878408432, 0.2942288815975189, 0.13890960812568665, -0.2175741046667099, -0.17704935371875763, -0.3758171796798706, -0.2481115162372589, -0.004762586206197739, -0.28523188829421997, 0.04948648810386658, -0.3418857455253601, -0.09901995211839676, -0.31614381074905396, 0.24385719001293182, 0.2691194713115692, 0.17418795824050903, 0.3950563967227936, -0.11055795103311539, -0.01267116516828537, 0.32025399804115295, -0.1732715666294098, -0.0016711950302124023, 0.07353124022483826, 0.04162609949707985, -0.1629633903503418, -0.046334363520145416, 0.23793259263038635, -0.22064343094825745, 0.03385039418935776, -0.10615259408950806, 0.050719186663627625, -0.25330689549446106, -0.26119890809059143, -0.07752940058708191, 0.16960051655769348, 0.6024918556213379, -0.2659727931022644, -0.5511146783828735, -0.2229883074760437, -0.10212665796279907, -0.04312429204583168, 0.25233370065689087, -0.06037096679210663, 0.09265851974487305, 0.3507877290248871, 0.08286935091018677, 0.23301832377910614, -0.012408576905727386, 0.20995306968688965, -0.2567026615142822, 0.5784335732460022, 0.08094489574432373, 0.04370607063174248, -0.06572292745113373, -0.037672385573387146, 0.12370084226131439, 0.02849879115819931, -0.1987166404724121, 0.17190131545066833, -0.6748610138893127, -0.33548420667648315, 0.2617795467376709, -0.07807929813861847, 0.2749776840209961, 0.31041693687438965, -0.140619695186615, -0.034071117639541626, -0.009596768766641617, 0.10511206090450287, 0.3922463655471802, 0.14873766899108887, 0.20089301466941833, 0.26715773344039917, 0.18148685991764069, -0.19353456795215607, 0.07457882910966873, 0.06290383636951447, 0.33155107498168945, -0.11447176337242126, 0.4229825437068939, -0.0227003525942564, 0.4151436388492584, -0.1232432872056961, -0.5912085771560669, 0.500710129737854, -0.4542648494243622, -0.14134065806865692, 0.18463808298110962, 0.24867527186870575, -0.07592439651489258, -0.07407847791910172, -0.17011192440986633, 0.4452653229236603, -0.21155625581741333, 0.08651848137378693, -0.14907796680927277, 0.1972973346710205, 0.09500543028116226, -0.23359453678131104, 0.17075888812541962, -0.4055783748626709, 0.05914849787950516, 0.2257920801639557, -0.04361896589398384, -0.12200659513473511, 0.025088585913181305, -0.4200286269187927, 0.2847133278846741, 0.21927514672279358, -0.11891675740480423, 0.05037069320678711, 0.16447217762470245, -0.30226439237594604, 0.05226372182369232, 0.21699529886245728, -0.3125029504299164, -0.2895859181880951, -0.12522464990615845, 0.1491028517484665, -0.2742425501346588, 0.1059495359659195, -0.1105213314294815, 0.48391520977020264, 0.13973946869373322, -0.06101476028561592, 0.28274524211883545, -0.08383211493492126, -0.46878358721733093, -0.07434774935245514, 0.17891643941402435, 0.39477014541625977, -0.5000845193862915, 0.2656959295272827, -0.04598595201969147, 0.13042475283145905, -0.1902475655078888, 0.3253940939903259, -0.14600010216236115, 0.10282813012599945, -0.3412860333919525, 0.308124303817749, 0.07431607693433762, -0.17768076062202454, -0.46812787652015686, 0.12392929941415787, -0.30007821321487427, 0.223653182387352, -0.010417096316814423, 0.03454523906111717, -0.07128001749515533, -0.12388065457344055, 0.17599454522132874, 0.37145745754241943, -0.02004557102918625, -0.07853478938341141, -0.0571613647043705, -0.03107289969921112, 0.3779008984565735, 0.1354510486125946, 0.11911267787218094, 0.14450553059577942, 0.270822674036026, -0.11213397979736328, 0.24484843015670776, 0.08376406133174896, -0.10978756844997406, 0.00970999151468277, 0.32106056809425354, -0.16067029535770416, 0.26533353328704834, -0.5394952297210693, -0.4947585463523865, 0.386631578207016, 0.26276081800460815, -0.27490708231925964, -0.15935705602169037, -0.16558146476745605, -0.2816670536994934, 0.09098968654870987, -0.11484995484352112, 0.131846085190773, 0.05933547765016556, -0.20412921905517578, 0.05519227683544159, 0.027661681175231934, -0.39473745226860046, 0.21485167741775513, -0.15125252306461334, 0.16418182849884033, -0.16800598800182343, 0.16297610104084015, -0.04244787245988846, -0.0308600552380085, -0.05453276261687279, 0.02793869934976101, 0.043777234852313995, -0.2187553346157074, -0.026191888377070427, 0.49472105503082275, 0.1092548817396164, -0.23384594917297363, -0.0012724148109555244, -0.45638507604599, 0.030377181246876717, -0.39635664224624634, -0.3692472577095032, 0.29511114954948425, 0.22457429766654968, 0.15219999849796295, -0.41538453102111816, 0.3251670002937317, -0.3307764232158661, 0.1414434015750885, -0.39585551619529724, -0.26089897751808167, 0.07681595534086227, 0.0568423792719841, -0.10305704921483994, -0.3607044816017151, 0.11577826738357544, 0.07202886044979095, 0.26950785517692566, -0.04506760463118553, -0.43907320499420166, -0.16049055755138397, 0.18932411074638367, -0.08556622266769409, 0.23401783406734467, 0.12580469250679016, 0.26892802119255066, 0.0664694681763649, 0.26911115646362305, 0.09668273478746414, 0.3386557102203369, 0.20035195350646973, 0.1206197738647461, -0.06663966923952103, -0.06232180446386337, 0.031118694692850113, 0.11894696205854416, -0.005321957170963287, 0.008128102868795395, 0.17526113986968994, 0.4656662046909332, 0.004697617143392563, -0.09503358602523804, 0.1414848417043686, 0.03819026052951813, 0.13821521401405334, -0.4166795015335083, 0.19663487374782562, -0.3257863521575928, -0.12375832349061966, 0.09793693572282791, -0.3325251340866089, -0.288297176361084, -0.15246817469596863, 0.04428451135754585, 0.16668739914894104, -0.15661174058914185, 0.12256623059511185, -0.2227325737476349, -0.08010365068912506, 0.11313523352146149, -0.1480579972267151, 0.11455254256725311, 0.037927333265542984, 0.14283092319965363, 0.05057385191321373, 0.08916206657886505, 0.10480763763189316, 0.20918886363506317, 0.00023012608289718628, -0.13716033101081848, -0.23794284462928772, -0.13148531317710876, 0.05900217965245247, -0.09728364646434784, 0.4515833854675293, 0.18586412072181702, -0.08635803312063217, -0.283565878868103, -0.2776944935321808, 0.07468155771493912, 0.16276563704013824, -0.07133062183856964, 0.23709753155708313, 0.13186180591583252, 0.1493259072303772, 0.01839892566204071, -0.24424105882644653, -0.08917626738548279, -0.29664379358291626, 0.049006059765815735, -0.0928434431552887, 0.22458294034004211, 0.4898720979690552, -0.02022462710738182, 0.05342969670891762, 0.05408185347914696, -0.08898040652275085, -0.26690277457237244, -0.18171775341033936, 0.4289878010749817, 0.1638845056295395, -0.1783279925584793, -0.205437570810318, -0.21829256415367126, -0.3941420018672943, 0.3488595187664032, -0.2760026454925537, -0.1753181666135788, -0.05887152999639511, 0.1681622713804245, -0.009563625790178776, 0.09449759870767593, 0.36393678188323975, -0.17679066956043243, -0.045705970376729965, -0.1541765034198761, -0.19447755813598633, -0.13739117980003357, 0.21451333165168762, 0.17369289696216583, 0.04564421623945236, 0.4353467524051666, 0.2715953290462494, 0.4296271800994873, 0.09727748483419418, 0.1296606957912445, 0.39640864729881287, 0.05644892156124115, 0.41290438175201416, 0.04366762936115265, -0.3581242859363556, -0.1273111253976822, 0.10425833612680435, -0.2510313093662262, 0.0692419558763504, -0.052258752286434174, -0.0783543586730957, -0.14525897800922394, 0.07267177850008011, -0.2716080844402313, -0.06338566541671753, -0.14568905532360077, -0.10066189616918564, -0.08808503299951553, 0.26657208800315857, 0.22133366763591766, -0.006003774702548981, -0.037846535444259644, -0.14304183423519135, 0.15519778430461884, 0.3013853132724762, 0.057507868856191635, -0.05578776076436043, -0.12496429681777954, -0.07449537515640259, 0.07458562403917313, 0.0518718957901001, 0.5440638661384583, 0.10154232382774353, -0.17104262113571167, -0.047392021864652634, 0.018301285803318024, 0.7013925313949585, -0.4280405342578888, 0.26941344141960144, -0.12383110076189041, -0.0023581907153129578, -0.4155493378639221, -0.09158026427030563, -0.2605566084384918, 0.4189772605895996, 0.01296442374587059, 0.37732863426208496, -0.18772654235363007, 0.08223892748355865, 0.28721630573272705, 0.01711336523294449, 0.1777360439300537, -0.49788081645965576, -0.41007810831069946, 0.09926813840866089, -0.16887399554252625, 0.5701323747634888, 0.2853267192840576, -0.04084521532058716, 0.3538864850997925, -0.07601726055145264, -0.3048843741416931, -0.08708175271749496, -0.03252645209431648, 0.18422982096672058, 0.20470964908599854, 0.043205421417951584, 0.22239945828914642, -0.08976668119430542, -0.030212663114070892, 0.22895249724388123, 0.5542324781417847, 0.05240543186664581, -0.29578033089637756, -0.2483043670654297, -0.11025884747505188, 0.2816755473613739, 0.18317732214927673, -0.2872668504714966, -0.07369621098041534, -0.15009772777557373, -0.034213531762361526, -0.05610562488436699, -0.2474270761013031, 0.23447364568710327, -0.011135522276163101, -0.32474473118782043, -0.08365076035261154, 0.6785354018211365, 0.005165860056877136, -0.07630524039268494, 0.14144256711006165, 0.4283902049064636, -0.24246492981910706, 0.3582492470741272, 0.14791317284107208, 0.5330337285995483, 0.14326514303684235, -0.21101823449134827, 0.2973657250404358, 0.06388655304908752, 0.7944478392601013, 0.18794836103916168, 0.15766732394695282, -0.2633098363876343, -0.5679152011871338, -0.024017345160245895, -0.1283717006444931, -0.03333159536123276, 0.1476220190525055, -0.1851033866405487, 0.3314987123012543, -0.27727067470550537, 0.34171372652053833, 0.05731206387281418, 0.23623967170715332, -0.02555234543979168, -0.07703100144863129, -0.45075130462646484, 0.08074700087308884, 0.06434272229671478, 0.07720932364463806, -0.04672212526202202, 0.23745331168174744, -0.053653784096241, -0.19408676028251648, -0.18949052691459656, 0.1033775731921196, -0.14692072570323944, 0.1972542107105255, 0.13450732827186584, -0.7005057334899902, 0.3598567247390747, 0.28875303268432617, 0.1379818320274353, 0.13736344873905182, -0.04740656912326813, -0.0014349957928061485, 0.1423950344324112, 0.3028508424758911, 0.06812921911478043, -0.3478489816188812, 0.43290218710899353, 0.2067946344614029, -0.12325376272201538, -0.2471027970314026, -0.10244819521903992, -0.2177167385816574, 0.0374908447265625, 0.450340211391449, -0.3859517574310303, -0.17266517877578735, -0.3421379327774048, -0.4495718479156494, 0.1319170743227005, -0.2295912355184555, 0.13274885714054108, -0.04029478132724762, -0.05600123479962349, 0.01850496046245098, -0.04382330924272537, -0.23027560114860535, -0.09034692496061325, 0.4570437967777252, -0.22258442640304565, 0.31515026092529297, 0.29409822821617126, 0.32151561975479126, -0.22501732409000397, -0.17119979858398438, -0.19764868915081024, 0.3642003834247589, 0.0012282803654670715, -0.10039295256137848, -0.2845415472984314, 0.09891949594020844, -0.008345726877450943, -0.24967464804649353, 0.2603205144405365, 0.01763533055782318, -0.17460373044013977, -0.32239222526550293, -0.11094721406698227, 0.23236165940761566, 0.19296319782733917, 0.0022651308681815863, 0.011631160974502563, -0.054476045072078705, 0.037769779562950134, 0.2073993980884552, -0.280412495136261, -0.08056125044822693, -0.14868438243865967, 0.22387591004371643, -0.30951088666915894, 0.1569318175315857, 0.006930902600288391, -0.30511337518692017, 0.03458293527364731, 0.12616275250911713, -0.11792051792144775, -0.20343929529190063, -0.18987077474594116, 0.11493009328842163, 0.22819817066192627, -0.16767793893814087, 0.0868958979845047, -0.3078891932964325, -0.08764021843671799, -0.3193241059780121, -0.018514372408390045, 0.38380831480026245, 0.13425780832767487, 0.013019770383834839, 0.3928552269935608, -0.14522500336170197, -0.2154616266489029, 0.046465661376714706, -0.23233017325401306, -0.1647413820028305, -0.05774157494306564, 0.3225070834159851, 0.041214361786842346, 0.21059517562389374, -0.11446377635002136, 0.1587715446949005, -0.04890575259923935, 0.2592652440071106, -0.06689860671758652, -0.4327339231967926, -0.15114040672779083, 0.4318338632583618, 0.5277023315429688, 0.4037788510322571, -0.060650065541267395, -0.3263600170612335, -0.04874207451939583, 0.207485631108284, -0.2908672094345093, -0.2646304666996002, 0.19756600260734558, -0.058652617037296295, 0.10852335393428802, 0.3764421343803406, 0.04289352148771286, -0.05203602463006973, -0.0029107369482517242, 0.21808961033821106, 0.38259249925613403, -0.059974636882543564, 0.030197996646165848, 0.2741115689277649, -0.14739221334457397, 0.0015100613236427307, 0.4284653663635254, -0.1934347152709961, 0.26699063181877136, 0.3593473434448242, 0.1628972738981247, 0.2942672669887543, 0.4106180965900421, 0.13320603966712952, -0.174148291349411, -0.11930951476097107, 0.38404154777526855, 0.21180316805839539, -0.06993626058101654, -0.27115970849990845, 0.20177677273750305, 0.3936895728111267, -0.23131044209003448, 0.06536683440208435, -0.1881350874900818, -0.30546844005584717, -0.10409441590309143, 0.08381495624780655, 0.0012844651937484741, -0.09266287088394165, 0.04126901924610138, -0.2633427381515503, -0.004629907663911581, -0.30364546179771423, -0.07308562844991684, -0.03923484683036804, -0.03542741388082504, -0.31427061557769775, -0.04096286743879318, 0.17589063942432404, 0.14340132474899292, -0.34173840284347534, 0.06347406655550003, 0.1449924111366272, -0.15113484859466553, 0.22486448287963867, 0.18064846098423004, 0.44611015915870667, 0.21076849102973938, -0.11202499270439148, 0.1782377064228058, -0.26927462220191956, -0.14408278465270996, -0.06156260892748833, 0.14814093708992004, -0.3505341410636902, -0.11555690318346024, 0.43178820610046387, 0.1845921128988266, -0.1165996566414833, 0.022298265248537064, 0.34571319818496704, 0.05485787242650986, -0.5804201364517212, -0.1797061264514923, -0.16192147135734558, -0.06458912789821625, 0.002378927543759346, -0.012076478451490402, 0.13985121250152588, 0.11876703798770905, 0.30602359771728516, 0.043330077081918716, 0.1572810709476471, 0.20123547315597534, 0.08359794318675995, 0.0020013879984617233, 0.13306914269924164, 0.38599294424057007, -0.11500757187604904, -0.10375723242759705, 0.22751183807849884, -0.7846404910087585, 0.19082856178283691, -0.18785330653190613, 0.08338646590709686, 0.5665591359138489, 0.22656460106372833, -0.2739794850349426, 0.23059242963790894, 0.12942492961883545, 0.32908034324645996, -0.03243907913565636, 0.20628032088279724, -0.19500696659088135, -0.2693207859992981, -0.3324374854564667, -0.1198643296957016, -0.2426278442144394, -0.205194354057312, 0.08130034059286118, -0.13460062444210052, 0.013662688434123993, -0.01572476699948311, -0.0734759196639061, 0.11085020005702972, -0.32482460141181946, 0.46705639362335205, 0.2044195830821991, 0.26949405670166016, 0.0382552370429039, 0.2283366322517395, -0.2018352597951889, -0.1798464059829712, -0.4805845618247986, 0.5252028107643127, -0.05784975364804268, 0.4083584249019623, -0.0731554925441742, -0.42918992042541504, -0.009156063199043274, 0.4108656942844391, 0.10638085752725601, 0.07254378497600555, -0.33490893244743347, 0.12960310280323029, -0.301192969083786, 0.11930431425571442, -0.26563185453414917, 0.2143663465976715, 0.17130443453788757, 0.5947890281677246, -0.10434987396001816, -0.6894100904464722, 0.3466266989707947, -0.3321600556373596, -0.3300298750400543, -0.29401981830596924, 0.42887046933174133, 0.41704076528549194, -0.3388293385505676, -0.22644773125648499, -0.16129834949970245, 0.21580633521080017, -0.1921008676290512, -0.2606450021266937, -0.0954994186758995, -0.08036286383867264, 0.19886130094528198, -0.03945114091038704, -0.12508134543895721, 0.10993913561105728, -0.19115495681762695, 0.28476861119270325, -0.20902052521705627 ]
https://github.com/huggingface/datasets/issues/5857
Hi! This would be a nice addition to the Hub! You can find the existing chemistry datasets/models on the Hub (using the `chemistry` tag) [here](https://huggingface.co/search/full-text?q=chemistry&type=model&type=dataset). Feel free to ping us here on the Hub if you need help adding the datasets.
Adding chemistry dataset/models in huggingface
### Feature request Huggingface is really amazing platform for open science. In addition to computer vision, video and NLP, would it be of interest to add chemistry/materials science dataset/models in Huggingface? Or, if its already done, can you provide some pointers. We have been working on a comprehensive benchmark on this topic: [JARVIS-Leaderboard](https://pages.nist.gov/jarvis_leaderboard/) and I am wondering if we could contribute/integrate this project as a part of huggingface. ### Motivation Similar to the main stream AI field, there is need of large scale benchmarks/models/infrastructure for chemistry/materials data. ### Your contribution We can start adding datasets as our [benchmarks](https://github.com/usnistgov/jarvis_leaderboard/tree/main/jarvis_leaderboard/benchmarks) should be easily convertible to the dataset format.
41
Adding chemistry dataset/models in huggingface ### Feature request Huggingface is really amazing platform for open science. In addition to computer vision, video and NLP, would it be of interest to add chemistry/materials science dataset/models in Huggingface? Or, if its already done, can you provide some pointers. We have been working on a comprehensive benchmark on this topic: [JARVIS-Leaderboard](https://pages.nist.gov/jarvis_leaderboard/) and I am wondering if we could contribute/integrate this project as a part of huggingface. ### Motivation Similar to the main stream AI field, there is need of large scale benchmarks/models/infrastructure for chemistry/materials data. ### Your contribution We can start adding datasets as our [benchmarks](https://github.com/usnistgov/jarvis_leaderboard/tree/main/jarvis_leaderboard/benchmarks) should be easily convertible to the dataset format. Hi! This would be a nice addition to the Hub! You can find the existing chemistry datasets/models on the Hub (using the `chemistry` tag) [here](https://huggingface.co/search/full-text?q=chemistry&type=model&type=dataset). Feel free to ping us here on the Hub if you need help adding the datasets.
[ -0.11878088116645813, -0.4045315980911255, -0.13821867108345032, 0.1770075112581253, -0.09072478115558624, -0.04768268018960953, -0.11828918755054474, 0.09518729150295258, 0.2977321147918701, 0.07220054417848587, -0.21887800097465515, 0.06159263104200363, -0.46998897194862366, 0.6341657638549805, 0.46887582540512085, -0.2999032139778137, 0.17276650667190552, -0.17776603996753693, -0.057332199066877365, 0.129678413271904, -0.09534874558448792, 0.08905988186597824, 0.14611533284187317, -0.23208504915237427, -0.11444474756717682, 0.062444157898426056, -0.13241364061832428, -0.054652635008096695, -0.07285947352647781, -0.38309425115585327, 0.022403627634048462, 0.39026951789855957, -0.030911624431610107, 0.3955279588699341, -0.00011509544856380671, -0.1263052374124527, 0.15738487243652344, 0.21355295181274414, -0.24460673332214355, -0.266318142414093, 0.06553083658218384, -0.1222386509180069, -0.12236779183149338, 0.2507823705673218, -0.1807277649641037, 0.3721107244491577, -0.028927382081747055, -0.5459586977958679, 0.2635910212993622, 0.12315501272678375, 0.12985524535179138, 0.549888014793396, 0.20509865880012512, -0.08018126338720322, 0.18447357416152954, 0.2879534363746643, -0.14456452429294586, 0.45455923676490784, 0.6477248072624207, 0.27592357993125916, 0.08534388244152069, 0.33885741233825684, -0.04899417236447334, -0.34646087884902954, 0.5128418803215027, -0.09312567114830017, -0.246799498796463, -0.3412427306175232, -0.17409449815750122, 0.5113223195075989, 0.13069850206375122, -0.24555936455726624, -0.5169721245765686, -0.4175747036933899, -0.05860348418354988, -0.18118135631084442, -0.19368904829025269, 0.21848806738853455, 0.026279617100954056, 0.10299256443977356, -0.26312851905822754, -0.37021008133888245, -0.21610155701637268, 0.056617479771375656, 0.3493903875350952, 0.13958796858787537, -0.24672234058380127, 0.0038123559206724167, 0.23642978072166443, 0.12927016615867615, 0.12391678243875504, -0.09344258904457092, 0.04634418338537216, -0.02181195095181465, -0.27490776777267456, -0.22673898935317993, 0.2120164930820465, 0.4795435070991516, 0.48526421189308167, 0.1483171582221985, -0.05852056294679642, 0.24138128757476807, -0.003094058483839035, 0.024570073932409286, 0.07917596399784088, -0.13933852314949036, 0.045741140842437744, -0.19336874783039093, 0.07493442296981812, 0.1129491925239563, 0.25738370418548584, 0.0005474928766489029, 0.15189793705940247, -0.031669169664382935, -0.35545772314071655, -0.21340763568878174, 0.19974923133850098, -0.18150925636291504, 0.017867326736450195, -0.04171213507652283, 0.26887691020965576, -0.09179015457630157, 0.02201221138238907, 0.20043757557868958, -0.016160640865564346, 0.043144043534994125, 0.1668567657470703, 0.4428739845752716, 0.18486061692237854, -0.2882532477378845, -0.03161285072565079, -0.0038293246179819107, -0.18336519598960876, 0.42558369040489197, 0.32175201177597046, -0.10353631526231766, 0.07525797933340073, 0.02128678187727928, 0.4516603946685791, -0.010783165693283081, 0.11294174194335938, 0.0088278166949749, 0.06660082936286926, 0.020617973059415817, -0.18579497933387756, -0.12840019166469574, 0.11531160771846771, 0.2817628085613251, -0.33578115701675415, -0.22958600521087646, -0.006792889907956123, -0.09712670743465424, -0.10682903975248337, -0.013691768050193787, -0.2327759563922882, -0.10417778789997101, -0.4428907334804535, 0.6322803497314453, -0.2941564917564392, 0.1483592689037323, -0.009733565151691437, 0.2165839672088623, -0.3521333336830139, -0.13273750245571136, 0.24317114055156708, 0.2756999135017395, -0.4145573377609253, -0.4092504382133484, 0.008176296949386597, 0.2125682830810547, -0.25850656628608704, -0.02272176370024681, -0.11636946350336075, 0.1685790866613388, -0.07615922391414642, -0.28624117374420166, 0.004609167575836182, -0.3516275882720947, -0.3014562427997589, -0.12423495203256607, 0.004831172525882721, 0.011541962623596191, 0.007699839770793915, 0.3408227264881134, -0.09440158307552338, 0.07440713047981262, 0.058908626437187195, 0.28788310289382935, -0.24856548011302948, -0.28868407011032104, -0.1509447693824768, -0.19204330444335938, 0.17596419155597687, 0.3100312352180481, 0.06304322183132172, -0.12296512722969055, 0.03840179741382599, -0.30220112204551697, -0.07832109183073044, -0.19523009657859802, 0.10205503553152084, 0.1973457932472229, 0.2204776555299759, 0.3420467674732208, 0.04444756358861923, -0.4102220833301544, -0.2838633060455322, 0.12739628553390503, -0.3765011429786682, 0.15150484442710876, 0.14014500379562378, -0.1302405595779419, 0.03611941263079643, 0.15176112949848175, -0.046094268560409546, -0.2877122163772583, 0.011378854513168335, -0.20421035587787628, 0.07960190623998642, 0.11738450825214386, -0.35632771253585815, 0.25165823101997375, 0.1412079930305481, 0.2480194866657257, -0.5818666219711304, 0.5306028127670288, 0.10308630764484406, -0.04365251213312149, 0.03844548761844635, 0.5421428680419922, -0.08085640519857407, -0.04173621907830238, 0.1907104253768921, 0.10532116889953613, -0.27463415265083313, -0.05225179344415665, 0.5021152496337891, 0.37629014253616333, 0.2546679973602295, -0.324371337890625, 0.18280479311943054, -0.20069347321987152, -0.052548497915267944, -0.05944867059588432, -0.030201293528079987, 0.5755723714828491, -0.13511145114898682, 0.308685302734375, -0.16402262449264526, 0.0957016870379448, 0.0042173415422439575, 0.0006003826856613159, -0.18926090002059937, 0.04341401159763336, 0.3442840278148651, -0.17664557695388794, 0.4005208909511566, -0.27688995003700256, -0.1262485533952713, 0.12540999054908752, -0.014541301876306534, -0.0035589858889579773, 0.12172949314117432, 0.30672532320022583, -0.5113975405693054, -0.10483723878860474, 0.09464053064584732, -0.11468753218650818, 0.3312145471572876, 0.21088683605194092, -0.21508194506168365, 0.10817543417215347, 0.2408023476600647, 0.025087259709835052, 0.015295401215553284, 0.14563333988189697, -0.1973077952861786, -0.07304447144269943, -0.086077019572258, 0.21314404904842377, -0.06377846002578735, -0.11663438379764557, -0.35697105526924133, -0.18640579283237457, -0.2922544479370117, 0.150241419672966, 0.21620072424411774, -0.062198519706726074, -0.0771312564611435, 0.059209343045949936, -0.32128676772117615, -0.15771713852882385, 0.03779822960495949, 0.059708502143621445, 0.03903794288635254, -0.08381439000368118, 0.21094045042991638, 0.8024984002113342, -0.2503052055835724, 0.22433751821517944, -0.20533666014671326, -0.13448956608772278, 0.17709793150424957, 0.04797636717557907, 0.08422505855560303, 0.2336679995059967, 0.8032715320587158, -0.10093048214912415, 0.2964741587638855, -0.2702580392360687, -0.5723961591720581, 0.18434439599514008, -0.22369758784770966, 0.5263497233390808, 0.20964162051677704, -0.23317497968673706, -0.05988403409719467, -0.04172358289361, 0.06972786039113998, -0.27276021242141724, 0.04578264057636261, -0.11632756143808365, 0.0030618347227573395, 0.0007611438632011414, 0.09765975922346115, 0.18167196214199066, -0.3053542375564575, -0.23851478099822998, 0.6569188833236694, -0.16068582236766815, -0.09788021445274353, -0.0029106028378009796, -0.0675709918141365, 0.23232728242874146, -0.664498507976532, 0.0675961896777153, -0.17567798495292664, -0.5057879686355591, -0.021512407809495926, -0.23415060341358185, -0.2284422516822815, -0.16983041167259216, -0.14273536205291748, 0.16184160113334656, -0.15093252062797546, -0.0828961580991745, -0.17584872245788574, -0.14159637689590454, -0.03439988195896149, 0.23053595423698425, 0.2379622459411621, 0.10991513729095459, -0.07719609141349792, 0.09988491237163544, -0.19061115384101868, -0.0938195139169693, -0.08182458579540253, -0.19165220856666565, 0.2258005291223526, 0.10545659065246582, 0.3028900921344757, -0.00562421977519989, 0.6275404691696167, 0.19605500996112823, -0.1370430886745453, 0.06368008255958557, 0.16640475392341614, 0.4629170000553131, 0.08524389564990997, -0.5756952166557312, 0.0945795401930809, -0.17901478707790375, 0.13135270774364471, 0.1280072182416916, 0.17026939988136292, 0.32067692279815674, -0.1311601996421814, 0.03137782961130142, -0.08167120069265366, -0.17078837752342224, 0.07311102002859116, -0.14005959033966064, 0.20243656635284424, -0.17456036806106567, -0.46990689635276794, -0.4263800382614136, -0.22898857295513153, 0.11149072647094727, 0.40967297554016113, 0.28451022505760193, 0.03913255035877228, -0.500667929649353, -0.028947241604328156, -0.8349546790122986, 0.30570319294929504, 0.008641906082630157, -0.2078450322151184, -0.1599246710538864, 0.211406871676445, -0.13402575254440308, 0.2584030330181122, 0.3349757194519043, -0.2311706840991974, -0.3207778334617615, -0.020306620746850967, -0.35377806425094604, -0.23295378684997559, 0.311504602432251, -0.2077924907207489, 0.016866467893123627, 0.2787769138813019, 0.2846342921257019, -0.3019525408744812, -0.08047046512365341, -0.13516578078269958, 0.17755833268165588, -0.03327614814043045, -0.24002665281295776, -0.11316517740488052, 0.08603271842002869, -0.22847023606300354, -0.035526178777217865, 0.1795540601015091, -0.0071145035326480865, 0.0464944988489151, -0.16925907135009766, -0.042911991477012634, -0.003728732466697693, 0.41188615560531616, -0.22775141894817352, 0.1613689512014389, 0.019512206315994263, 0.1558956652879715, 0.3738590478897095, 0.20669041574001312, 0.118246890604496, 0.1341928392648697, -0.2356593906879425, 0.032981835305690765, 0.02118489146232605, -0.0011292025446891785, 0.4272167384624481, 0.21051383018493652, 0.07946109026670456, 0.4015201926231384, -0.024537116289138794, 0.4201899468898773, -0.36814120411872864, 0.18507830798625946, 0.014983687549829483, 0.312659353017807, -0.4212365746498108, -0.23461845517158508, 0.5250730514526367, 0.10460235178470612, -0.09522528201341629, 0.18912644684314728, 0.5496699213981628, -0.2546645402908325, 0.09739644825458527, 0.05701163038611412, 0.9830049872398376, -0.13887090981006622, 0.3028916120529175, -0.05288936197757721, -0.14229384064674377, 0.5894641876220703, -0.07980601489543915, -0.03438589349389076, -0.29068759083747864, -0.3826884627342224, -0.07370952516794205, -0.29493647813796997, 0.06785043329000473, -0.055185139179229736, -0.23708122968673706, 0.14733800292015076, 0.2605157494544983, -0.2392532378435135, -0.11941847950220108, 0.27337509393692017, 0.2086039036512375, -0.25097721815109253, -0.15019047260284424, 0.08132924139499664, -0.038147371262311935, 0.26973533630371094, -0.2173290103673935, -0.27878114581108093, -0.13942523300647736, 0.187545508146286, -0.32563573122024536, -0.22747205197811127, -0.15262523293495178, -0.05080194026231766, 0.37526142597198486, -0.010213896632194519, 0.6185407638549805, -0.023631947115063667, 0.6829299330711365, 0.1569092720746994, -0.2937304377555847, -0.016340341418981552, -0.18722042441368103, -0.156317800283432, 0.1770664006471634, -0.14822332561016083, 0.09835834801197052, -0.07979651540517807, -0.11741410195827484, 0.09695182740688324, 0.22502347826957703, -0.5011423230171204, -0.4181459844112396, -0.11618542671203613, 0.03843378275632858, -0.3006492853164673, -0.03789643198251724, 0.2110854685306549, 0.018991217017173767, -0.08868677914142609, 0.07322163134813309, 0.43820056319236755, -0.1016821637749672, 0.03384307771921158, 0.17485758662223816, -0.10687423497438431, -0.04028644785284996, 0.07249679416418076, -0.21109378337860107, -0.11359389126300812, -0.030247006565332413, 0.3179422914981842, -0.18268261849880219, 0.003858417272567749, -0.10925404727458954, 0.6373415589332581, -0.6249131560325623, 0.1439470499753952, -0.07643813639879227, -0.20650409162044525, -0.025083407759666443, 0.09288894385099411, 0.46157902479171753, -0.30472397804260254, 0.11881452053785324, 0.0018576085567474365, -0.31429049372673035, 0.2694864273071289, -0.20492541790008545, 0.2196490466594696, -0.05890488252043724, 0.05166859179735184, -0.08059505373239517, 0.33800026774406433, -0.2752988338470459, -0.021533288061618805, 0.14291468262672424, -0.1960749626159668, 0.21643836796283722, -0.27500590682029724, -0.0060883499681949615, -0.1650206446647644, -0.17166092991828918, -0.1502530872821808, -0.20116932690143585, -0.12813891470432281, -0.10886643081903458, 0.14682359993457794, -0.04727856069803238, -0.03496226295828819, -0.05075773596763611, 0.06767608225345612, 0.09617789089679718, -0.18565459549427032, 0.16255778074264526, 0.06121039390563965, 0.21961532533168793, -0.1750953197479248, 0.23689699172973633, 0.0893155187368393, -0.003350391983985901, 0.2860293984413147, 0.22105515003204346, 0.06868985295295715, -0.021776564419269562, 0.011864698491990566, -0.07629451155662537, -0.062127482146024704, -0.04156002402305603, 0.37873533368110657, 0.43068158626556396, -0.05999007076025009, 0.36422961950302124, 0.035361774265766144, -0.07690298557281494, 0.3958822786808014, 0.29929226636886597, -0.032455507665872574, -0.14296802878379822, 0.20673590898513794, -0.03444257006049156, 0.08928854018449783, -0.08659999817609787, 0.04002729803323746, 0.0063613951206207275, 0.0035497955977916718, 0.18046589195728302, 0.22623270750045776, 0.45283740758895874, 0.37266969680786133, 0.14928723871707916, 0.08478519320487976, -0.15161670744419098, 0.33863961696624756, 0.17513643205165863, -0.17808935046195984, 0.3119935393333435, 0.13857749104499817, 0.4664953649044037, 0.31315815448760986, 0.1611092984676361, -0.18458610773086548, 0.206537127494812, 0.7185310125350952, -0.3473356366157532, 0.08594028651714325, 0.5682494044303894, 0.03422274440526962, -0.017481738701462746, -0.0775182768702507, 0.31064996123313904, -0.024847757071256638, -0.19676069915294647, 0.5797758102416992, -0.28501448035240173, -0.44843676686286926, 0.054054610431194305, 0.3718004822731018, 0.02326066792011261, -0.20070414245128632, 0.41170835494995117, -0.06349918246269226, -0.17484793066978455, -0.16370715200901031, -0.09950733184814453, -0.3644927144050598, -0.14593014121055603, -0.011301655322313309, 0.023217977955937386, -0.08039645105600357, -0.08577443659305573, 0.4680364727973938, 0.2310112565755844, 0.007559165358543396, -0.12044984102249146, -0.046096071600914, -0.04712575674057007, 0.07565391808748245, 0.362711101770401, 0.026689205318689346, -0.004453398287296295, -0.3906870484352112, 0.3216925859451294, -0.03934770077466965, 0.10033675283193588, 0.1138153225183487, 0.04571516811847687, 0.048578113317489624, -0.07745581865310669, 0.20358145236968994, 0.0639226958155632, -0.05451477691531181, -0.0016478494508191943, -0.32014912366867065, 0.26901739835739136, -0.29736652970314026, 0.3380514979362488, -0.31707680225372314, 0.07230113446712494, -0.3065831959247589, -0.02191890776157379, -0.4978976249694824, 0.03234243020415306, 0.2698575258255005, -0.35673823952674866, -0.1482531726360321, -0.08156520128250122, 0.044290270656347275, 0.08398552238941193, 0.21903955936431885, 0.574259340763092, 0.2757456302642822, -0.3136824369430542, -0.2176360785961151, -0.3054332435131073, 0.01086604967713356, 0.08590307831764221, 0.09223604202270508, 0.10536304116249084, -0.16226330399513245, -0.08595463633537292, 0.11892352998256683, -0.09959365427494049, -0.08741597831249237, -0.1740785837173462, -0.32187581062316895, -0.2508316934108734, 0.056544702500104904, -0.27830588817596436, 0.15451020002365112, 0.20180180668830872, 0.27162325382232666, 0.049091242253780365, 0.16696883738040924, -0.05967877805233002, -0.21498477458953857, 0.24109739065170288, -0.060915082693099976, 0.052509553730487823, 0.04676949232816696, -0.05829296261072159, 0.36607199907302856, 0.024964608252048492, -0.28747063875198364, -0.10888005793094635, -0.2359083741903305, 0.021455544978380203, 0.020942846313118935, -0.15376897156238556, 0.36806899309158325, -0.2880224287509918, -0.506930410861969, -0.121966153383255, 0.3224342465400696, 0.07773429155349731, -0.5053502321243286, -0.38412025570869446, 0.15777091681957245, -0.09966283291578293, 0.20535491406917572, 0.374960333108902, 0.47349923849105835, -0.17363768815994263, 0.2707837224006653, 0.003756195306777954, 0.043065108358860016, 0.3897867202758789, -0.30494236946105957, -0.00043708086013793945, -0.07367543876171112, 0.04293704032897949, 0.28100401163101196, -0.2709673345088959, -0.8283722400665283, -0.20598910748958588, 0.10922210663557053, 0.1905803084373474, 0.2578655779361725, 0.4964478611946106, 0.12307685613632202, -0.016636937856674194, -0.08575750142335892, 0.24637562036514282, 0.11581838130950928, 0.02604442834854126, 0.024274364113807678, -0.05388049781322479 ]